public class AStar extends AbstractRoutingAlgorithm
Different distance calculations can be used via setApproximation.
| Modifier and Type | Class and Description |
|---|---|
static class |
AStar.AStarEntry |
edgeExplorer, graph, maxVisitedNodes, nodeAccess, traversalMode, weighting| Constructor and Description |
|---|
AStar(Graph graph,
Weighting weighting,
TraversalMode tMode) |
| Modifier and Type | Method and Description |
|---|---|
Path |
calcPath(int from,
int to)
Calculates the best path between the specified nodes.
|
protected Path |
extractPath()
To be overwritten from extending class.
|
protected boolean |
finished()
To be overwritten from extending class.
|
String |
getName() |
int |
getVisitedNodes()
Returns the visited nodes after searching.
|
protected void |
initCollections(int size) |
AStar |
setApproximation(WeightApproximator approx) |
protected void |
updateBestPath(EdgeIteratorState edgeState,
SPTEntry bestSPTEntry,
int traversalId) |
accept, calcPaths, checkAlreadyRun, createEmptyPath, isMaxVisitedNodesExceeded, setMaxVisitedNodes, toStringpublic AStar(Graph graph, Weighting weighting, TraversalMode tMode)
public AStar setApproximation(WeightApproximator approx)
approx - defines how distance to goal Node is approximatedprotected void initCollections(int size)
public Path calcPath(int from, int to)
RoutingAlgorithmprotected boolean finished()
AbstractRoutingAlgorithmfinished in class AbstractRoutingAlgorithmprotected Path extractPath()
AbstractRoutingAlgorithmextractPath in class AbstractRoutingAlgorithmpublic int getVisitedNodes()
RoutingAlgorithmprotected void updateBestPath(EdgeIteratorState edgeState, SPTEntry bestSPTEntry, int traversalId)
public String getName()
getName in interface RoutingAlgorithmgetName in class AbstractRoutingAlgorithmCopyright © 2012–2022. All rights reserved.