Package edu.uky.ai.planning.pg
Class StepNode
java.lang.Object
edu.uky.ai.planning.pg.Node
edu.uky.ai.planning.pg.StepNode
- All Implemented Interfaces:
Comparable<Node>
Represents a unique step, or action, in a plan graph. Step nodes have
preconditions (
literal nodes
which must be ture before
this step can happen) and effects (literal nodes
which
become true after this step happens).- Author:
- Stephen G. Ware
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayList<LiteralNode>
All literal nodes which become true after this step happensfinal boolean
Whether or not this is a dummy persistence stepprotected final ArrayList<LiteralNode>
All literal nodes which must be true before this step can happenfinal Step
The step represented by this node -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEffects
(int level) Returns all literals at a given level of the plan graph which are effects of this step.getPreconditions
(int level) Returns all literals at the previous level of the plan graph which are preconditions of this step.int
hashCode()
protected void
Notifies this step that one of its preconditions has been met.protected void
reset()
Resets this node (called when the plan graph is being reset).protected boolean
setLevel
(int level) Marks this node as having first appeared at the given level.toString()
-
Field Details
-
step
The step represented by this node -
persistence
public final boolean persistenceWhether or not this is a dummy persistence step -
preconditions
All literal nodes which must be true before this step can happen -
effects
All literal nodes which become true after this step happens
-
-
Constructor Details
-
StepNode
Constructs a new step node for the given literal in the given plan graph.- Parameters:
graph
- the graph in which this node will existstep
- the step this node represents
-
StepNode
Constructs a dummy persistence step for a given literal (i.e. a step which has only this literal as a precondition and only this literal as an effect).- Parameters:
graph
- the graph in which this node will existliteral
- the literal which is this step's only precondition and effect
-
-
Method Details
-
hashCode
public int hashCode() -
toString
-
incrementLiteralCount
protected void incrementLiteralCount()Notifies this step that one of its preconditions has been met. -
setLevel
protected boolean setLevel(int level) Description copied from class:Node
Marks this node as having first appeared at the given level. -
reset
protected void reset()Description copied from class:Node
Resets this node (called when the plan graph is being reset). -
getPreconditions
Returns all literals at the previous level of the plan graph which are preconditions of this step. Note that when this method is called for level n, it returns steps which exist at level n - 1.- Parameters:
level
- the index of a level in the plan graph at which this node exists- Returns:
- all literals which exist at the previous level and which are preconditions of this step
- Throws:
IllegalArgumentException
- if this step does not exist at the given level
-
getEffects
Returns all literals at a given level of the plan graph which are effects of this step.- Parameters:
level
- the index of a level in the plan graph- Returns:
- all literals which exist at that level and which are effects of this step
- Throws:
IllegalArgumentException
- if this step does not exist at the given level
-