com.brackeen.javagamebook.path
Class AStarSearch

java.lang.Object
  extended bycom.brackeen.javagamebook.path.AStarSearch
Direct Known Subclasses:
AStarSearchWithBSP

public class AStarSearch
extends java.lang.Object

The AStarSearch class, along with the AStarNode class, implements a generic A* search algorthim. The AStarNode class should be subclassed to provide searching capability.


Nested Class Summary
static class AStarSearch.PriorityList
          A simple priority list, also called a priority queue.
 
Constructor Summary
AStarSearch()
           
 
Method Summary
 java.util.List findPath(AStarNode startNode, AStarNode goalNode)
          Find the path from the start node to the end node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AStarSearch

public AStarSearch()
Method Detail

findPath

public java.util.List findPath(AStarNode startNode,
                               AStarNode goalNode)
Find the path from the start node to the end node. A list of AStarNodes is returned, or null if the path is not found.