ai.search.informed
Class IntCostHeuristic<S extends SearchStateForIntCostFn>

java.lang.Object
  extended by ai.search.informed.IntCostHeuristic<S>

public abstract class IntCostHeuristic<S extends SearchStateForIntCostFn>
extends java.lang.Object

This class represents a heuristic function that can be used to estimate the distance to the closest goal node for a given search state. Needless to say, heuristics are problem-specific.

Author:
Gerhard Wickler

Constructor Summary
IntCostHeuristic()
           
 
Method Summary
protected  java.lang.Object clone()
           This class does not support cloning and an Exception will be thrown if this method is called.
abstract  int goalDistance(S state)
           This function returns an estimate of the distance from the given state to the closest goal state.
abstract  boolean isConsistent()
           This function returns whether this heuristic is consistent.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntCostHeuristic

public IntCostHeuristic()
Method Detail

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException

This class does not support cloning and an Exception will be thrown if this method is called.

Overrides:
clone in class java.lang.Object
Returns:
nothing
Throws:
java.lang.CloneNotSupportedException - will be thrown

isConsistent

public abstract boolean isConsistent()

This function returns whether this heuristic is consistent. A heuristic h(n) is consistent if, for every node n and every successor n’ of n generated by any action a, the estimated cost of reaching the goal from n is no greater than the step cost of getting to n’ plus the estimated cost of reaching the goal from n’: h(n) ≤ c(n, a, n’) + h(n’)

Returns:
whether this heuristic is consistent

goalDistance

public abstract int goalDistance(S state)

This function returns an estimate of the distance from the given state to the closest goal state.

Parameters:
state - the SearchStateForIntCostFn from which to estimate the distance
Returns:
the estimated distance to the closest goal state