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

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

public class TailPlan
extends java.lang.Object

Represents the part of the plan generated by backward chaining from the goal.

Since:
ICF 0.0
Version:
$Id$

Field Summary
private  java.util.Set applicableOps
          the actions in the plan that can be applied, i.e.
private  java.util.Set expandableNodes
          the nodes that have yet to be expanded (used for expanding nodes)
private  java.util.Map literalToGoalNodeMap
          mapping from literals to goal node that considers them (used for repeated goal detection, updating the set of applicable ops, and updating maintainance goals)
private  java.util.Set maintainanceGoals
          the goals that have been achieved that are preconditions of operators in the tail plan that haven't been applied yet (used for noticing when replanning to achieve preconditions is necessary)
private  PlanDAG planDAG
          The graph representing the operators and goals in the tail plan.
 
Constructor Summary
TailPlan()
          Construct an empty tail plan.
 
Method Summary
 boolean applyOp(ActionNode action_node, ChangeTracker change_tracker)
          Apply the action specified to the current state.
 boolean expandGoalNode(GoalNode goal_node, PlannerActionSchema op, ChangeTracker change_tracker)
          Expand the goal node with the given operator.
 boolean expandOpNode(OpNode op_node, Binding binding, ChangeTracker change_tracker)
          Expand the op node with the given binding.
 java.util.Map getLiteralToGoalNodeMap()
          Gets the mapping from literals to goal nodes
 void initialize(GoalNode goal)
          Initialize the tail plan with the given goal acting as the root.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

planDAG

private PlanDAG planDAG
The graph representing the operators and goals in the tail plan.
Since:
ICF 0.0

expandableNodes

private java.util.Set expandableNodes
the nodes that have yet to be expanded (used for expanding nodes)
Since:
ICF 0.0

maintainanceGoals

private java.util.Set maintainanceGoals
the goals that have been achieved that are preconditions of operators in the tail plan that haven't been applied yet (used for noticing when replanning to achieve preconditions is necessary)
Since:
ICF 0.0

literalToGoalNodeMap

private java.util.Map literalToGoalNodeMap
mapping from literals to goal node that considers them (used for repeated goal detection, updating the set of applicable ops, and updating maintainance goals)
Since:
ICF 0.0

applicableOps

private java.util.Set applicableOps
the actions in the plan that can be applied, i.e. the set of action nodes in the plan for which all precondition goals have been achieved. A goal is considered achieved when it is removed from the set of expandable nodes.
Since:
ICF 0.0
Constructor Detail

TailPlan

public TailPlan()
Construct an empty tail plan.
Since:
ICF 0.0
Method Detail

initialize

public void initialize(GoalNode goal)
Initialize the tail plan with the given goal acting as the root.
Parameters:
goal - the goal to achieve
Since:
ICF 0.0

expandGoalNode

public boolean expandGoalNode(GoalNode goal_node,
                              PlannerActionSchema op,
                              ChangeTracker change_tracker)
Expand the goal node with the given operator.
Parameters:
goal_node - the node to expand
op - the operator to use
change_tracker - where to record the changes
Returns:
true if and only if the expansion was successful
Since:
ICF 0.0

expandOpNode

public boolean expandOpNode(OpNode op_node,
                            Binding binding,
                            ChangeTracker change_tracker)
Expand the op node with the given binding.
Parameters:
op_node - the operator node to expand
binding - the binding to use
change_tracker - where to track the changes
Returns:
true if and only if the expansion was successful
Since:
ICF 0.0

applyOp

public boolean applyOp(ActionNode action_node,
                       ChangeTracker change_tracker)
Apply the action specified to the current state.
Parameters:
action_node - the action to apply
change_tracker - where to track the changes
Returns:
true if and only if the application was successful
Since:
ICF 0.0

getLiteralToGoalNodeMap

public java.util.Map getLiteralToGoalNodeMap()
Gets the mapping from literals to goal nodes
Returns:
the mapping from literals to goal nodes
Since:
ICF 0.0