Package edu.uky.ai.planning.pg
Class Node
java.lang.Object
edu.uky.ai.planning.pg.Node
- All Implemented Interfaces:
Comparable<Node>
- Direct Known Subclasses:
LiteralNode
,StepNode
The abstract superclass of
LiteralNode
and StepNode
.- Author:
- Stephen G. Ware
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
exists
(int level) Tests whether or not this node exists at a given level.int
getLevel()
Returns the index of the earliest level at which this node appears, or -1 if this node has not yet appeared at any level.protected void
Marks this node as needing to be reset when the plan graph is reset.boolean
Tests whether or not this node is mutually exclusive with another given node at the given level.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.
-
Field Details
-
graph
The graph to which this node belongs -
level
protected int levelThe index of the level at which this node first appears, or -1 if it has not yet appeared
-
-
Constructor Details
-
Node
Constructs a new node object in the given plan graph.- Parameters:
graph
- the plan graph
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Node>
-
exists
public boolean exists(int level) Tests whether or not this node exists at a given level.- Parameters:
level
- the index of a level in the plan graph- Returns:
- true if this node appears at the given level, false otherwise
-
getLevel
public int getLevel()Returns the index of the earliest level at which this node appears, or -1 if this node has not yet appeared at any level.- Returns:
- this node's earliest level or -1
-
setLevel
protected boolean setLevel(int level) Marks this node as having first appeared at the given level.- Parameters:
level
- the index of the level at which this node first appears- Returns:
- true if this node's level was not previously set, false otherwise
-
markForReset
protected void markForReset()Marks this node as needing to be reset when the plan graph is reset. -
mutex
Tests whether or not this node is mutually exclusive with another given node at the given level.- Parameters:
node
- some other node in the graphlevel
- the index of a level in this graph- Returns:
- true if these nodes are mutex at this level, false otherwise
- Throws:
IllegalArgumentException
- if either node does not exist at the given level
-
reset
protected void reset()Resets this node (called when the plan graph is being reset).
-