Class NetworkSearcher

java.lang.Object
rgu.transport.geospatial.multimodal.NetworkSearcher

public final class NetworkSearcher extends Object
Convenience wrapper for reachability searches using Dijkstra. Instance should be obtained from the searcher() method on TransitNetwork.
Author:
Lee A. Christie
  • 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 null
      earliestDeparture - the earliest departure time, not null
      latestArrival - the latest arrival time, not null
      direction - 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 null
      earliestDeparture - the earliest departure time, not null
      latestArrival - the latest arrival time, not null
      direction - the direction of travel, not null
      extra - 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 null
      earliestDeparture - the earliest departure time, not null
      latestArrival - the latest arrival time, not null
      direction - the direction of travel, not null
      consumer - 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 null
      earliestDeparture - the earliest departure time, not null
      latestArrival - the latest arrival time, not null
      direction - the direction of travel, not null
      extra - additional trips to be included, ignored if null or empty
      consumer - a consumer of reachable locations, with associated costs
      Throws:
      InterruptedException - if the thread is interrupted