|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAStarShortestPathFinder
public class AStarShortestPathFinder
Calculates the shortest path between two nodes using the A Star algorithm (for details see http://en.wikipedia.org/wiki/A_star)
AStarIterator
modules/extension/graph (gt-graph.jar)
Constructor Summary | |
---|---|
AStarShortestPathFinder(Graph graph,
Node source,
Node target,
AStarIterator.AStarFunctions afuncs)
Constructs a new path finder |
Method Summary | |
---|---|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
public void calculate()
public int visit(Graphable element, GraphTraversal traversal)
GraphWalker
visit
in interface GraphWalker
element
- The component being visited.traversal
- The traversal controlling the sequence of graph
component visits.
GraphWalker.visit(Graphable, GraphTraversal)
public Path getPath() throws WrongPathException
WrongPathException
Walk.riterator()
,
Walk.reverse()
public void finish()
finish
in interface GraphWalker
GraphWalker.finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |