Class NetworkJoiner
java.lang.Object
rgu.transport.geospatial.multimodal.NetworkJoiner
Used to join multiple transit networks to one another, using roads to inform connection times.
Connection times will be calculated by walking on the road network, unless there is no road
network within a radius around a stop, in which case, the connection times default to as the crow
flies.
- Author:
- Lee A. Christie
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkJoiner(Graph<GeoLocation, RoadEdge> roadGraph, TwoDTree<GeoLocation> tree, Collection<TransitNetwork> networks, Speed speed, Duration maxTime, Distance maxDistanceToNearbyRoad) Creates a joiner which will connect multiple transit networks to one another. -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(BiConsumer<GeoLocation, GeoLocation> consumer, BiConsumer<GeoLocation, GeoLocation> consumerArtificial, ProgressListener progress, Consumer<TransitNetwork> callback) Runs the joiner to produce a joined network.
-
Constructor Details
-
NetworkJoiner
public NetworkJoiner(Graph<GeoLocation, RoadEdge> roadGraph, TwoDTree<GeoLocation> tree, Collection<TransitNetwork> networks, Speed speed, Duration maxTime, Distance maxDistanceToNearbyRoad) Creates a joiner which will connect multiple transit networks to one another.- Parameters:
roadGraph- the road graph, null if there is no road graphtree- the 2D tree used as a nearest finder for the road network, null if there is no road graph or if the neighbour finder should be generated by the Joinernetworks- the collection of one or more transit networks, not nullspeed- the walking speed, not nullmaxTime- the maximum time to walk between stops on the transit networks, not nullmaxDistanceToNearbyRoad- if the nearest road is further away than this, the routing uses as the crow flies distance instead of walking on the road network, null if there is no limit and road routing should always be used
-
-
Method Details
-
run
public void run(BiConsumer<GeoLocation, GeoLocation> consumer, BiConsumer<GeoLocation, GeoLocation> consumerArtificial, ProgressListener progress, Consumer<TransitNetwork> callback) throws InterruptedException Runs the joiner to produce a joined network.- Parameters:
consumer- callback for edges, can be null if not neededconsumerArtificial- callback for artificial edge, can be null if not neededprogress- the progress listener, not nullcallback- the callback to accept the result of joining- Throws:
InterruptedException- if the thread is interrupted
-