public abstract class AbstractRoutingAlgorithm extends Object implements RoutingAlgorithm
Modifier and Type | Field and Description |
---|---|
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,
FlagEncoder encoder,
Weighting weighting,
TraversalMode traversalMode) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(EdgeIterator iter,
int prevOrNextEdgeId) |
List<Path> |
calcPaths(int from,
int to)
Calculates multiple possibilities for a path.
|
protected void |
checkAlreadyRun() |
protected Path |
createEmptyPath() |
protected SPTEntry |
createSPTEntry(int node,
double weight) |
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() |
protected void |
updateBestPath(EdgeIteratorState edgeState,
SPTEntry bestSPTEntry,
int traversalId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
calcPath, getVisitedNodes
protected final Graph graph
protected NodeAccess nodeAccess
protected EdgeExplorer inEdgeExplorer
protected EdgeExplorer outEdgeExplorer
protected final Weighting weighting
protected final FlagEncoder flagEncoder
protected final TraversalMode traversalMode
protected int maxVisitedNodes
public AbstractRoutingAlgorithm(Graph graph, FlagEncoder encoder, Weighting weighting, TraversalMode traversalMode)
graph
- specifies the graph where this algorithm will run onencoder
- sets the used vehicle (bike, car, foot)weighting
- 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(EdgeIterator iter, int prevOrNextEdgeId)
protected void updateBestPath(EdgeIteratorState edgeState, SPTEntry bestSPTEntry, int traversalId)
protected void checkAlreadyRun()
protected SPTEntry createSPTEntry(int node, double weight)
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–2016. All rights reserved.