edu.cmu.cs.coral.icf.plan_based.planners.pip
Class PIPPlanGenerator

java.lang.Object
  |
  +--edu.cmu.cs.coral.icf.plan_based.planners.pip.PIPPlanGenerator

public class PIPPlanGenerator
extends java.lang.Object

Generates plan for the Prodigy Inspired Planner (PIP). This class implements the guts of the algrithm

Since:
ICF 0.0
Version:
$Id$

Field Summary
private  java.util.Stack backtrackPoints
          the decisions that have been made so far (used for backtracking)
private  Choice lastChoice
          the last choice that was made
private  PIPPlan plan
          the current plan
 
Constructor Summary
PIPPlanGenerator()
          Construct a PIPPlanGenerator
 
Method Summary
private  java.util.Iterator genChoices()
          Generates the choices that can be used for the next decision.
private  void preprocess(PlannerDomain domain, PlannerProblem problem)
          Preprocess the domain and problem to be used by the planning algorithm
private  PIPPlan search(PlannerDomain domain, PlannerProblem problem)
          Finds a plan that solves the problem if one exists
 PIPPlan solve(PlannerDomain domain, PlannerProblem problem)
          Solve a planning problem.
private  boolean tryBindingSelection(OpNodeExpansionChoice op_choice, BindingSelectionChoice binding_choice, ChangeTracker change_tracker)
          Tries to expand the op node chosen with the variable binding chosen.
private  boolean tryChoice(Choice choice, ChangeTracker change_tracker)
          Tries to execute the choice that was made.
private  boolean tryGoalNodeExpansion(GoalNodeExpansionChoice choice, ChangeTracker change_tracker)
          Tries to expand the given goal node.
private  boolean tryNextAlternative(Decision decision)
          Tries the next altenative remaining at this decision point.
private  boolean tryOpApplication(OpApplicationChoice choice, ChangeTracker change_tracker)
          Tries to apply the operator specified by this choice.
private  boolean tryOpNodeExpansion(OpNodeExpansionChoice choice, ChangeTracker change_tracker)
          Tries to expand the given op node.
private  boolean tryOpSelection(GoalNodeExpansionChoice goal_choice, OperatorSelectionChoice op_choice, ChangeTracker change_tracker)
          Tries to expand the goal node chosen with the operator chosen.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

backtrackPoints

private java.util.Stack backtrackPoints
the decisions that have been made so far (used for backtracking)
Since:
ICF 0.0

plan

private PIPPlan plan
the current plan
Since:
ICF 0.0

lastChoice

private Choice lastChoice
the last choice that was made
Since:
ICF 0.0
Constructor Detail

PIPPlanGenerator

public PIPPlanGenerator()
Construct a PIPPlanGenerator
Since:
ICF 0.0
Method Detail

solve

public PIPPlan solve(PlannerDomain domain,
                     PlannerProblem problem)
Solve a planning problem.
Parameters:
domain - the domain to use
problem - the problem to solve
Returns:
a plan that solves the problem or null if no such plan exists
Since:
ICF 0.0

preprocess

private void preprocess(PlannerDomain domain,
                        PlannerProblem problem)
Preprocess the domain and problem to be used by the planning algorithm
Parameters:
domain - the domain to use
problem - the problem to use
Since:
ICF 0.0

search

private PIPPlan search(PlannerDomain domain,
                       PlannerProblem problem)
Finds a plan that solves the problem if one exists
Parameters:
domain - the domain to use
problem - the problem to use
Returns:
a plan that solves the problem or null if no such plan exists
Since:
ICF 0.0

genChoices

private java.util.Iterator genChoices()
Generates the choices that can be used for the next decision.
Returns:
an iterator over the possible choice for the next decision
Since:
ICF 0.0

tryNextAlternative

private boolean tryNextAlternative(Decision decision)
Tries the next altenative remaining at this decision point.
Parameters:
decision - the decision point to try the next alternative for
Returns:
true if and only if a valid alternative was found and executed
Since:
ICF 0.0

tryChoice

private boolean tryChoice(Choice choice,
                          ChangeTracker change_tracker)
Tries to execute the choice that was made.
Parameters:
choice - the option to try
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if the choice was successfully done
Since:
ICF 0.0

tryOpApplication

private boolean tryOpApplication(OpApplicationChoice choice,
                                 ChangeTracker change_tracker)
Tries to apply the operator specified by this choice.
Parameters:
choice - the op application choice made
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if this operator was successfuly applied
Since:
ICF 0.0

tryGoalNodeExpansion

private boolean tryGoalNodeExpansion(GoalNodeExpansionChoice choice,
                                     ChangeTracker change_tracker)
Tries to expand the given goal node. This merely indicated that this node should be expanded and doesn't actually do the expansion.
Parameters:
choice - the goal node chosen to be expanded
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if this node was successfully marked for expansion
Since:
ICF 0.0

tryOpNodeExpansion

private boolean tryOpNodeExpansion(OpNodeExpansionChoice choice,
                                   ChangeTracker change_tracker)
Tries to expand the given op node. This merely indicated that this node should be expanded and doesn't actually do the expansion.
Parameters:
choice - the op node chosen to be expanded
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if this node was successfully marked for expansion
Since:
ICF 0.0

tryOpSelection

private boolean tryOpSelection(GoalNodeExpansionChoice goal_choice,
                               OperatorSelectionChoice op_choice,
                               ChangeTracker change_tracker)
Tries to expand the goal node chosen with the operator chosen.
Parameters:
goal_choice - the choice of goal node
op_choice - the choice of operator
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if the expansion was successfully carried out
Since:
ICF 0.0

tryBindingSelection

private boolean tryBindingSelection(OpNodeExpansionChoice op_choice,
                                    BindingSelectionChoice binding_choice,
                                    ChangeTracker change_tracker)
Tries to expand the op node chosen with the variable binding chosen.
Parameters:
op_choice - the operator chosen for expansion
binding_choice - the binding chosen
change_tracker - the change tracker to track changes to the plan with
Returns:
true if and only if the binding was successful
Since:
ICF 0.0