Class AdjustedSum2

All Implemented Interfaces:
Heuristic, PlanningGraphHeuristic, StateHeuristic, Serializable

public final class AdjustedSum2 extends RelaxedGraphHeuristic
This class implement the adjusted sum 2 heuristic. This heuristic improves the adjusted sum heuristic by replacing the computation of the cost(S) by the used the relaxed plan heuristic. Now, we have the following heuristic:
 hadjsum2(S) := cost(S) + delta(S)
 
where
  • cost(S) := 1 + cost(S + prec(a) - add(a))
  • delta(S) := lev(S) - max(lev(p)) for all p in S
Warning: The adjusted sum heuristic is not admissible.
See Also:
AdjustedSum, Max, FastForward, Sum, Serialized Form
  • Constructor Details

    • AdjustedSum2

      public AdjustedSum2(Problem problem)
      Creates a new AdjustedSum2 heuristic for a specified planning problem.
      Parameters:
      problem - the planning problem.
      Throws:
      NullPointerException - if problem == null.
  • Method Details

    • estimate

      public int estimate(State state, Condition goal)
      Return the estimated distance to the goal to reach the specified state. If the return value is Integer.MAX_VALUE, it means that the goal is unreachable from the specified state.
      Parameters:
      state - the state from which the distance to the goal must be estimated.
      goal - the goal expression.
      Returns:
      the distance to the goal state from the specified state.
    • estimate

      public double estimate(Node node, Condition goal)
      Return the estimated distance to the goal to reach the specified state. If the return value is DOUBLE.MAX_VALUE, it means that the goal is unreachable from the specified state.
      Parameters:
      node - the state from which the distance to the goal must be estimated.
      goal - the goal expression.
      Returns:
      the distance to the goal state from the specified state.