]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.route/src/org/simantics/district/route/Router.java
1d2423221440b43706e5b8336949b2718c7412d7
[simantics/district.git] / org.simantics.district.route / src / org / simantics / district / route / Router.java
1 package org.simantics.district.route;
2
3 import java.util.List;
4
5 import org.simantics.db.Resource;
6 import org.simantics.db.layer0.variable.Variable;
7
8 /**
9  * @author Tuukka Lehtonen
10  */
11 public interface Router {
12
13     /**
14      * @return descriptive name of the router
15      */
16     default String name() {
17         return toString();
18     }
19
20     /**
21      * Must be invoked outside of any transaction realm, like a database request or
22      * experiment thread, preferably from a background job thread.
23      * 
24      * @param wayPoints waypoints for the route to find in visiting order. The
25      *            resources must represents district network diagram elements.
26      * @return the piece-wise shortest path between the specified waypoints as a
27      *         fully baked path of district network diagram element resources
28      * @throws RoutingException in case of any problems in routing
29      */
30     List<Variable> findShortestPath(RouterConfiguration config, List<Resource> wayPoints) throws RoutingException;
31
32 }