PlannerFunction.java (1500B) download
1package osm.planner;
2
3import java.util.Collection;
4import java.util.List;
5
6import osm.routing.RoutingEdge;
7import osm.routing.RoutingGraph;
8import osm.routing.RoutingNode;
9import osm.routing.RoutingStrategy;
10import 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
20public 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}