public abstract class AbstractRoutingAlgorithm extends Object implements RoutingAlgorithm
Modifier and Type | Field and Description |
---|---|
protected EdgeFilter |
additionalEdgeFilter |
protected FlagEncoder |
flagEncoder |
protected Graph |
graph |
protected EdgeExplorer |
inEdgeExplorer |
protected int |
maxVisitedNodes |
protected NodeAccess |
nodeAccess |
protected EdgeExplorer |
outEdgeExplorer |
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() |
protected abstract Path |
extractPath()
To be overwritten from extending class.
|
protected abstract boolean |
finished()
To be overwritten from extending class.
|
String |
getName() |
protected boolean |
isMaxVisitedNodesExceeded() |
RoutingAlgorithm |
setEdgeFilter(EdgeFilter additionalEdgeFilter) |
void |
setMaxVisitedNodes(int numberOfNodes)
Limit the search to numberOfNodes.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
calcPath, getVisitedNodes
protected final Graph graph
protected final Weighting weighting
protected final FlagEncoder flagEncoder
protected final TraversalMode traversalMode
protected NodeAccess nodeAccess
protected EdgeExplorer inEdgeExplorer
protected EdgeExplorer outEdgeExplorer
protected int maxVisitedNodes
protected EdgeFilter additionalEdgeFilter
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 RoutingAlgorithm setEdgeFilter(EdgeFilter additionalEdgeFilter)
protected boolean accept(EdgeIteratorState iter, int prevOrNextEdgeId)
protected void checkAlreadyRun()
protected abstract boolean finished()
protected abstract Path extractPath()
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()
Copyright © 2012–2019. All rights reserved.