public class ShortestPathTree extends AbstractRoutingAlgorithm
IMPLEMENTATION NOTE: util.PriorityQueue doesn't support efficient removes. We work around this by giving the labels a deleted flag, not remove()ing them, and popping deleted elements off both queues. Note to self/others: If you think this optimization is not needed, please test it with a scenario where updates actually occur a lot, such as using finite, non-zero u-turn costs.
| Modifier and Type | Class and Description |
|---|---|
static class |
ShortestPathTree.IsoLabel |
edgeExplorer, graph, maxVisitedNodes, nodeAccess, traversalMode, weighting| Constructor and Description |
|---|
ShortestPathTree(Graph g,
Weighting weighting,
boolean reverseFlow,
TraversalMode traversalMode) |
| Modifier and Type | Method and Description |
|---|---|
Path |
calcPath(int from,
int to)
Calculates the best path between the specified nodes.
|
protected Path |
extractPath()
To be overwritten from extending class.
|
protected boolean |
finished()
To be overwritten from extending class.
|
Collection<ShortestPathTree.IsoLabel> |
getIsochroneEdges() |
String |
getName() |
int |
getVisitedNodes()
Returns the visited nodes after searching.
|
void |
search(int from,
Consumer<ShortestPathTree.IsoLabel> consumer) |
void |
setDistanceLimit(double limit)
Distance limit in meter
|
void |
setTimeLimit(double limit)
Time limit in milliseconds
|
void |
setWeightLimit(double limit) |
accept, calcPaths, checkAlreadyRun, createEmptyPath, isMaxVisitedNodesExceeded, setMaxVisitedNodes, toStringpublic ShortestPathTree(Graph g, Weighting weighting, boolean reverseFlow, TraversalMode traversalMode)
public Path calcPath(int from, int to)
RoutingAlgorithmpublic void setTimeLimit(double limit)
public void setDistanceLimit(double limit)
public void setWeightLimit(double limit)
public void search(int from,
Consumer<ShortestPathTree.IsoLabel> consumer)
public Collection<ShortestPathTree.IsoLabel> getIsochroneEdges()
protected boolean finished()
AbstractRoutingAlgorithmfinished in class AbstractRoutingAlgorithmprotected Path extractPath()
AbstractRoutingAlgorithmextractPath in class AbstractRoutingAlgorithmpublic String getName()
getName in interface RoutingAlgorithmgetName in class AbstractRoutingAlgorithmpublic int getVisitedNodes()
RoutingAlgorithmCopyright © 2012–2022. All rights reserved.