com.cuspy.pathfinder
Class AStar

java.lang.Object
  |
  +--com.cuspy.pathfinder.AbstractPathFinder
        |
        +--com.cuspy.pathfinder.AStar
All Implemented Interfaces:
PathFinder, java.lang.Runnable

public class AStar
extends AbstractPathFinder

An implementation of the A* path finding algorithm.


Field Summary
 
Fields inherited from class com.cuspy.pathfinder.AbstractPathFinder
aborted, goals, listeners, start
 
Constructor Summary
AStar(Node start, java.util.Collection goals)
           
AStar(Node start, Node goal)
           
 
Method Summary
 java.util.List findPath()
          Find a path between the start and the goal Nodes.
 java.util.List getConsideredPath()
          Get the path currently being considered.
 
Methods inherited from class com.cuspy.pathfinder.AbstractPathFinder
abort, addPathListener, fireConsidered, removePathListener, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AStar

public AStar(Node start,
             Node goal)

AStar

public AStar(Node start,
             java.util.Collection goals)
Method Detail

getConsideredPath

public java.util.List getConsideredPath()
Description copied from interface: PathFinder
Get the path currently being considered. This only makes sense if you are using the threaded approach. It is only safe to call this after having received a considered PathEvent.

Returns:
a List of Nodes in the considered path.

findPath

public java.util.List findPath()
Description copied from interface: PathFinder
Find a path between the start and the goal Nodes.

Returns:
a List of Node elements.