X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.route%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Froute%2FRouter.java;fp=org.simantics.district.route%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Froute%2FRouter.java;h=1d2423221440b43706e5b8336949b2718c7412d7;hb=716ce6c9abe27be04635922ad437f242c4bd7dfc;hp=0000000000000000000000000000000000000000;hpb=cb14c9e0dfd0b7179c11f0a54af87e2b7fe16113;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.route/src/org/simantics/district/route/Router.java b/org.simantics.district.route/src/org/simantics/district/route/Router.java new file mode 100644 index 00000000..1d242322 --- /dev/null +++ b/org.simantics.district.route/src/org/simantics/district/route/Router.java @@ -0,0 +1,32 @@ +package org.simantics.district.route; + +import java.util.List; + +import org.simantics.db.Resource; +import org.simantics.db.layer0.variable.Variable; + +/** + * @author Tuukka Lehtonen + */ +public interface Router { + + /** + * @return descriptive name of the router + */ + default String name() { + return toString(); + } + + /** + * Must be invoked outside of any transaction realm, like a database request or + * experiment thread, preferably from a background job thread. + * + * @param wayPoints waypoints for the route to find in visiting order. The + * resources must represents district network diagram elements. + * @return the piece-wise shortest path between the specified waypoints as a + * fully baked path of district network diagram element resources + * @throws RoutingException in case of any problems in routing + */ + List findShortestPath(RouterConfiguration config, List wayPoints) throws RoutingException; + +}