public class AStarShortestPathFinder extends Object implements GraphWalker
AStarIterator| Constructor and Description |
|---|
AStarShortestPathFinder(Graph graph,
Node source,
Node target,
AStarIterator.AStarFunctions afuncs)
Constructs a new path finder
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculate()
Performs the graph traversal and calculates the shortest path from the source node to destiny
node in the graph.
|
void |
finish()
Does nothing.
|
Path |
getPath()
Returns a path from the target to the source.
|
int |
visit(Graphable element,
GraphTraversal traversal)
Visits a graph component.
|
public AStarShortestPathFinder(Graph graph, Node source, Node target, AStarIterator.AStarFunctions afuncs)
graph - Graph where we will perform the search.source - Node to calculate path from.target - Node to calculate path to.weighter - Associates weights with edges in the graph.public void calculate()
public int visit(Graphable element, GraphTraversal traversal)
GraphWalkervisit in interface GraphWalkerelement - The component being visited.traversal - The traversal controlling the sequence of graph component visits.GraphWalker.visit(Graphable, GraphTraversal)public Path getPath() throws WrongPathException
WrongPathExceptionWalk.riterator(),
Walk.reverse()public void finish()
finish in interface GraphWalkerGraphWalker.finish()Copyright © 1996–2019 Geotools. All rights reserved.