Package edu.uky.ai.planning.pg
Class LiteralNode
java.lang.Object
edu.uky.ai.planning.pg.Node
edu.uky.ai.planning.pg.LiteralNode
- All Implemented Interfaces:
Comparable<Node>
Represents a unique literal, or fact, in a plan graph. Literal nodes have
producers (
step nodes
which have this literal as an effect)
and consumers (step nodes
which have this literal as a
precondition).- Author:
- Stephen G. Ware
-
Field Summary
FieldsModifier and TypeFieldDescriptionAll step nodes which have this literal as a preconditionfinal Literal
The literal represented by this nodeAll step nodes which have this literal as an effect -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LiteralNode
(PlanGraph graph, Literal literal) Constructs a new literal node for the given literal in the given plan graph. -
Method Summary
Modifier and TypeMethodDescriptiongetConsumers
(int level) Returns all steps at the next level of the plan graph which have this literal as a precondition.getProducers
(int level) Returns all steps at a given level of the plan graph which have this literal as an effect.int
hashCode()
protected boolean
setLevel
(int level) Marks this node as having first appeared at the given level.toString()
-
Field Details
-
literal
The literal represented by this node -
producers
All step nodes which have this literal as an effect -
consumers
All step nodes which have this literal as a precondition
-
-
Constructor Details
-
LiteralNode
Constructs a new literal node for the given literal in the given plan graph.- Parameters:
graph
- the graph in which this node will existliteral
- the literal this node represents
-
-
Method Details
-
hashCode
public int hashCode() -
toString
-
setLevel
protected boolean setLevel(int level) Description copied from class:Node
Marks this node as having first appeared at the given level. -
getProducers
Returns all steps at a given level of the plan graph which have this literal as an effect.- Parameters:
level
- the index of a level in the plan graph- Returns:
- all steps which exist at that level and which have this literal as an effect
- Throws:
IllegalArgumentException
- if this literal does not exist at the given level
-
getConsumers
Returns all steps at the next level of the plan graph which have this literal as a precondition. 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 steps which exist at the next level and which have this literal as a precondition
- Throws:
IllegalArgumentException
- if this literal does not exist at the given level
-