Class NetworkSearcher
java.lang.Object
rgu.transport.geospatial.multimodal.NetworkSearcher
Convenience wrapper for reachability searches using Dijkstra. Instance should be obtained from
the searcher() method on TransitNetwork.
- Author:
- Lee A. Christie
-
Method Summary
Modifier and TypeMethodDescriptionreachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction) Returns a map of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.voidreachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, BiConsumer<GeoLocation, Duration> consumer) Streams to a callback function the set of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.reachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, Map<GeoLocation, List<Trip>> extra) Returns a map of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.voidreachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, Map<GeoLocation, List<Trip>> extra, BiConsumer<GeoLocation, Duration> consumer) Streams to a callback function the set of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.
-
Method Details
-
reachable
public Map<GeoLocation, Duration> reachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction) throws InterruptedException Returns a map of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.- Parameters:
location- the location, not nullearliestDeparture- the earliest departure time, not nulllatestArrival- the latest arrival time, not nulldirection- the direction of travel, not null- Returns:
- an ordered map of reachable locations, with associated costs
- Throws:
InterruptedException- if the thread is interrupted
-
reachable
public Map<GeoLocation, Duration> reachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, Map<GeoLocation, List<Trip>> extra) throws InterruptedException Returns a map of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.- Parameters:
location- the location, not nullearliestDeparture- the earliest departure time, not nulllatestArrival- the latest arrival time, not nulldirection- the direction of travel, not nullextra- additional trips to be included, ignored if null or empty- Returns:
- an ordered map of reachable locations, with associated costs
- Throws:
InterruptedException- if the thread is interrupted
-
reachable
public void reachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, BiConsumer<GeoLocation, Duration> consumer) throws InterruptedException Streams to a callback function the set of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.- Parameters:
location- the location, not nullearliestDeparture- the earliest departure time, not nulllatestArrival- the latest arrival time, not nulldirection- the direction of travel, not nullconsumer- a consumer of reachable locations, with associated costs- Throws:
InterruptedException- if the thread is interrupted
-
reachable
public void reachable(GeoLocation location, LocalTime earliestDeparture, LocalTime latestArrival, TravelDirection direction, Map<GeoLocation, List<Trip>> extra, BiConsumer<GeoLocation, Duration> consumer) throws InterruptedException Streams to a callback function the set of locations reachable within the given time windows, and the corresponding cost of each location's shortest path duration.- Parameters:
location- the location, not nullearliestDeparture- the earliest departure time, not nulllatestArrival- the latest arrival time, not nulldirection- the direction of travel, not nullextra- additional trips to be included, ignored if null or emptyconsumer- a consumer of reachable locations, with associated costs- Throws:
InterruptedException- if the thread is interrupted
-