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,
FlagEncoder encoder,
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, updateBestPath
public AStar(Graph graph, FlagEncoder encoder, 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)
RoutingAlgorithm
protected Path extractPath()
AbstractRoutingAlgorithm
extractPath
in class AbstractRoutingAlgorithm
protected SPTEntry createSPTEntry(int node, double weight)
createSPTEntry
in class AbstractRoutingAlgorithm
protected boolean finished()
AbstractRoutingAlgorithm
finished
in class AbstractRoutingAlgorithm
public int getVisitedNodes()
RoutingAlgorithm
public String getName()
getName
in interface RoutingAlgorithm
getName
in class AbstractRoutingAlgorithm
Copyright © 2012–2016. All rights reserved.