Class RoutePathHelper
java.lang.Object
org.deltava.beans.schedule.RoutePathHelper
A utility class that uses Dijkstra's algorithm to calculate the shortest multi-airport leg.
- Since:
- 7.5
- Version:
- 11.2
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculates the shortest path between two Airports.void
setLinks
(Collection<ScheduleRoute> links) Populates the links between the airports.
-
Constructor Details
-
RoutePathHelper
public RoutePathHelper(int legCost, int historicCost) Creates the helper bean.- Parameters:
legCost
- the flat extra cost of each additional leg in miles, to prioritize fewer legs over absolute distancehistoricCost
- the flat extra cost of route pair served only by historical flights
-
-
Method Details
-
setLinks
Populates the links between the airports.- Parameters:
links
- a Collection of ScheduleRoutes
-
getShortestPath
Calculates the shortest path between two Airports.- Parameters:
rp
- the RoutePair- Returns:
- a Collection of RoutePair legs, or empty if no route found
-