public class Action extends GraphNodeObject
GraphNodeObject.ParameterPairs
Modifier and Type | Field and Description |
---|---|
protected planner.graphPlan.Action.ConditionList |
postconditions
List of literals that will be asserted upon completion of this action
|
protected planner.graphPlan.Action.ConditionList |
preconditions
List of literals that must be asserted before this action can be taken
|
name, parameters
Constructor and Description |
---|
Action(String name,
Literal[] preconditions,
Literal[] postconditions)
Creates a new instance of Action
|
Modifier and Type | Method and Description |
---|---|
void |
addPostcondition(Literal postcon)
Adds a postcondition to the list iff it is not already present
|
void |
addPrecondition(Literal precon)
Adds a precondition to the list iff it is not already present
|
Literal |
getPostcondition(int index)
Returns the specified precondition
|
Literal |
getPrecondition(int index)
Returns the specified precondition
|
boolean |
match(GraphNodeObject l2)
Compares this action against another and returns true if they are equivalent
|
protected static boolean |
matchConditions(planner.graphPlan.Action.ConditionList list1,
planner.graphPlan.Action.ConditionList list2)
Compares two lists of postconditions or preconditions for equivalence
|
int |
numPostconditions()
Returns the number of postconditions for this action
|
int |
numPreconditions()
Returns the number of preconditions for this action
|
List<GraphNode> |
preconditionsMet(LiteralLayer literals)
Determines whether or not the preconditions for the action are met at a certain layer
|
String |
toString()
Converts the Action object to a String
|
addParameter, addParameter, addParameter, addParameter, compareTo, copyParameters, getName, getParameter, matchParams, numParameters, removeParameter
protected planner.graphPlan.Action.ConditionList preconditions
protected planner.graphPlan.Action.ConditionList postconditions
public Action(String name, Literal[] preconditions, Literal[] postconditions)
name
- descriptor for this actionpreconditions
- world state literals that must be true to execute this actionpostconditions
- world state literals that will be true upon completion of this actionpublic int numPreconditions()
public int numPostconditions()
public final void addPrecondition(Literal precon)
precon
- public final void addPostcondition(Literal postcon)
postcon
- public Literal getPrecondition(int index)
index
- public Literal getPostcondition(int index)
index
- public List<GraphNode> preconditionsMet(LiteralLayer literals)
literals
- LiteralLayer of the graph that is being checked for precondition satisfactionpublic boolean match(GraphNodeObject l2)
match
in class GraphNodeObject
l2
- protected static boolean matchConditions(planner.graphPlan.Action.ConditionList list1, planner.graphPlan.Action.ConditionList list2)
list1
- list2
- public String toString()
toString
in class GraphNodeObject