public abstract class AbstractRoutingAlgorithm extends Object implements RoutingAlgorithm
Modifier and Type | Field and Description |
---|---|
protected EdgeExplorer |
edgeExplorer |
protected Graph |
graph |
protected int |
maxVisitedNodes |
protected NodeAccess |
nodeAccess |
protected long |
timeoutMillis |
protected TraversalMode |
traversalMode |
protected Weighting |
weighting |
Constructor and Description |
---|
AbstractRoutingAlgorithm(Graph graph,
Weighting weighting,
TraversalMode traversalMode) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(EdgeIteratorState iter,
int prevOrNextEdgeId) |
List<Path> |
calcPaths(int from,
int to)
Calculates multiple possibilities for a path.
|
protected void |
checkAlreadyRun() |
protected Path |
createEmptyPath() |
String |
getName() |
protected boolean |
isMaxVisitedNodesExceeded() |
protected boolean |
isTimeoutExceeded() |
void |
setMaxVisitedNodes(int numberOfNodes)
Limit the search to numberOfNodes.
|
void |
setTimeoutMillis(long timeoutMillis)
Limit the search to the given time in milliseconds
|
protected void |
setupFinishTime() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
calcPath, getVisitedNodes
protected final Graph graph
protected final Weighting weighting
protected final TraversalMode traversalMode
protected final NodeAccess nodeAccess
protected final EdgeExplorer edgeExplorer
protected int maxVisitedNodes
protected long timeoutMillis
public AbstractRoutingAlgorithm(Graph graph, Weighting weighting, TraversalMode traversalMode)
graph
- specifies the graph where this algorithm will run onweighting
- set the used weight calculation (e.g. fastest, shortest).traversalMode
- how the graph is traversed e.g. if via nodes or edges.public void setMaxVisitedNodes(int numberOfNodes)
RoutingAlgorithm
setMaxVisitedNodes
in interface RoutingAlgorithm
public void setTimeoutMillis(long timeoutMillis)
RoutingAlgorithm
setTimeoutMillis
in interface RoutingAlgorithm
protected boolean accept(EdgeIteratorState iter, int prevOrNextEdgeId)
protected void checkAlreadyRun()
protected void setupFinishTime()
public List<Path> calcPaths(int from, int to)
RoutingAlgorithm
calcPaths
in interface RoutingAlgorithm
RoutingAlgorithm.calcPath(int, int)
protected Path createEmptyPath()
public String getName()
getName
in interface RoutingAlgorithm
protected boolean isMaxVisitedNodesExceeded()
protected boolean isTimeoutExceeded()
Copyright © 2012–2023. All rights reserved.