Class BlockingHeuristic

java.lang.Object
  extended byBlockingHeuristic
All Implemented Interfaces:
Heuristic

public class BlockingHeuristic
extends java.lang.Object
implements Heuristic

This is a template for the class corresponding to the blocking heuristic. This heuristic returns zero for goal states, and otherwise returns one plus the number of cars blocking the path of the goal car to the exit. This class is an implementation of the Heuristic interface, and must be implemented by filling in the constructor and the getValue method.


Constructor Summary
BlockingHeuristic(Puzzle puzzle)
          This is the required constructor, which must be of the given form.
 
Method Summary
 int getValue(State state)
          This method returns the value of the heuristic function at the given state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingHeuristic

public BlockingHeuristic(Puzzle puzzle)
This is the required constructor, which must be of the given form.

Method Detail

getValue

public int getValue(State state)
This method returns the value of the heuristic function at the given state.

Specified by:
getValue in interface Heuristic