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 EdgeExplorer
protected final Graph
protected int
protected final NodeAccess
protected long
protected final TraversalMode
protected final Weighting
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRoutingAlgorithm
(Graph graph, Weighting weighting, TraversalMode traversalMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
accept
(EdgeIteratorState iter, int prevOrNextEdgeId) calcPaths
(int from, int to) Calculates multiple possibilities for a path.protected void
protected Path
getName()
protected boolean
protected boolean
void
setMaxVisitedNodes
(int numberOfNodes) Limit the search to numberOfNodes.void
setTimeoutMillis
(long timeoutMillis) Limit the search to the given time in millisecondsprotected void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:RoutingAlgorithm
Limit the search to numberOfNodes. See #681- Specified by:
setMaxVisitedNodes
in interfaceRoutingAlgorithm
-
setTimeoutMillis
public void setTimeoutMillis(long timeoutMillis) Description copied from interface:RoutingAlgorithm
Limit the search to the given time in milliseconds- Specified by:
setTimeoutMillis
in interfaceRoutingAlgorithm
-
accept
-
checkAlreadyRun
protected void checkAlreadyRun() -
setupFinishTime
protected void setupFinishTime() -
calcPaths
Description copied from interface:RoutingAlgorithm
Calculates multiple possibilities for a path.- Specified by:
calcPaths
in interfaceRoutingAlgorithm
- See Also:
-
createEmptyPath
-
getName
- Specified by:
getName
in interfaceRoutingAlgorithm
- Returns:
- name of this algorithm
-
toString
-
isMaxVisitedNodesExceeded
protected boolean isMaxVisitedNodesExceeded() -
isTimeoutExceeded
protected boolean isTimeoutExceeded()
-