com.cuspy.pathfinder
Class DepthFirstSearch
java.lang.Object
|
+--com.cuspy.pathfinder.AbstractPathFinder
|
+--com.cuspy.pathfinder.DepthFirstSearch
- All Implemented Interfaces:
- PathFinder, java.lang.Runnable
- public class DepthFirstSearch
- extends AbstractPathFinder
An implementation of the Depth First Search path finding algorithm.
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DepthFirstSearch
public DepthFirstSearch(Node start,
Node goal)
DepthFirstSearch
public DepthFirstSearch(Node start,
java.util.Collection goals)
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.
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.