Package com.graphhopper.routing
Class AbstractRoutingAlgorithm
java.lang.Object
com.graphhopper.routing.AbstractRoutingAlgorithm
- All Implemented Interfaces:
RoutingAlgorithm
- Direct Known Subclasses:
AStar,Dijkstra,DijkstraOneToMany,ShortestPathTree
- Author:
- Peter Karich
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EdgeExplorerprotected final Graphprotected intprotected final NodeAccessprotected longprotected final TraversalModeprotected final Weighting -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRoutingAlgorithm(Graph graph, Weighting weighting, TraversalMode traversalMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaccept(EdgeIteratorState iter, int prevOrNextEdgeId) calcPaths(int from, int to) Calculates multiple possibilities for a path.protected voidprotected PathgetName()protected booleanprotected booleanvoidsetMaxVisitedNodes(int numberOfNodes) Limit the search to numberOfNodes.voidsetTimeoutMillis(long timeoutMillis) Limit the search to the given time in millisecondsprotected voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.graphhopper.routing.RoutingAlgorithm
calcPath, getVisitedNodes
-
Field Details
-
graph
-
weighting
-
traversalMode
-
nodeAccess
-
edgeExplorer
-
maxVisitedNodes
protected int maxVisitedNodes -
timeoutMillis
protected long timeoutMillis
-
-
Constructor Details
-
AbstractRoutingAlgorithm
- Parameters:
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.
-
-
Method Details
-
setMaxVisitedNodes
public void setMaxVisitedNodes(int numberOfNodes) Description copied from interface:RoutingAlgorithmLimit the search to numberOfNodes. See #681- Specified by:
setMaxVisitedNodesin interfaceRoutingAlgorithm
-
setTimeoutMillis
public void setTimeoutMillis(long timeoutMillis) Description copied from interface:RoutingAlgorithmLimit the search to the given time in milliseconds- Specified by:
setTimeoutMillisin interfaceRoutingAlgorithm
-
accept
-
checkAlreadyRun
protected void checkAlreadyRun() -
setupFinishTime
protected void setupFinishTime() -
calcPaths
Description copied from interface:RoutingAlgorithmCalculates multiple possibilities for a path.- Specified by:
calcPathsin interfaceRoutingAlgorithm- See Also:
-
createEmptyPath
-
getName
- Specified by:
getNamein interfaceRoutingAlgorithm- Returns:
- name of this algorithm
-
toString
-
isMaxVisitedNodesExceeded
protected boolean isMaxVisitedNodesExceeded() -
isTimeoutExceeded
protected boolean isTimeoutExceeded()
-