Class AStar

java.lang.Object
  extended byAStar

public class AStar
extends java.lang.Object

This is the template for a class that performs A* search on a given rush hour puzzle with a given heuristic. The main search computation is carried out by the constructor for this class, which must be filled in. The solution (a path from the initial state to a goal state) is returned as an array of States called path (where the first element path[0] is the initial state). If no solution is found, the path field should be set to null. You may also wish to return other information by adding additional fields to the class.


Field Summary
 State[] path
          The solution path is stored here
 
Constructor Summary
AStar(Puzzle puzzle, Heuristic heuristic)
          This is the constructor that performs A* search to compute a solution for the given puzzle using the given heuristic.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

public State[] path
The solution path is stored here

Constructor Detail

AStar

public AStar(Puzzle puzzle,
             Heuristic heuristic)
This is the constructor that performs A* search to compute a solution for the given puzzle using the given heuristic.