public class AStar extends AbstractRoutingAlgorithm
Different distance calculations can be used via setApproximation.
| Modifier and Type | Class and Description |
|---|---|
static class |
AStar.AStarEntry |
flagEncoder, graph, inEdgeExplorer, maxVisitedNodes, nodeAccess, outEdgeExplorer, 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 SPTEntry |
createSPTEntry(int node,
double weight) |
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) |
accept, calcPaths, checkAlreadyRun, createEmptyPath, isMaxVisitedNodesExceeded, setEdgeFilter, setMaxVisitedNodes, toString, updateBestPathpublic 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 Path extractPath()
AbstractRoutingAlgorithmextractPath in class AbstractRoutingAlgorithmprotected SPTEntry createSPTEntry(int node, double weight)
createSPTEntry in class AbstractRoutingAlgorithmprotected boolean finished()
AbstractRoutingAlgorithmfinished in class AbstractRoutingAlgorithmpublic int getVisitedNodes()
RoutingAlgorithmpublic String getName()
getName in interface RoutingAlgorithmgetName in class AbstractRoutingAlgorithmCopyright © 2012–2018. All rights reserved.