PlannerFunction.java (1500B)
1 package osm.planner; 2 3 import java.util.Collection; 4 import java.util.List; 5 6 import osm.routing.RoutingEdge; 7 import osm.routing.RoutingGraph; 8 import osm.routing.RoutingNode; 9 import osm.routing.RoutingStrategy; 10 import osm.routing.entity.Passenger; 11 12 /** 13 * Represents a planner function that generates a list of nodes for a given 14 * routing scenario. 15 * 16 * @param <N> The type of nodes in the graph. 17 * @param <E> The type of edges connecting the nodes. 18 */ 19 @FunctionalInterface 20 public interface PlannerFunction<N extends RoutingNode<N>, E extends RoutingEdge<N>> { 21 22 /** 23 * Plans a route based on the specified routing graph, distance function, 24 * estimate function, garage node, and targets. 25 * 26 * @param router The routing graph. 27 * @param distanceFunction The strategy for calculating distance between nodes. 28 * @param estimateFunction The strategy for estimating remaining distance to 29 * targets. 30 * @param garage The starting node representing the garage or initial 31 * location. 32 * @param targets The collection of passengers with their destination 33 * nodes. 34 * @return A list of nodes representing the planned route. 35 */ 36 List<N> plan( 37 RoutingGraph<N, E> router, 38 RoutingStrategy<N, E> distanceFunction, 39 RoutingStrategy<N, E> estimateFunction, 40 N garage, Collection<Passenger<N>> targets); 41 }