Package fr.uga.pddl4j.planners.htn.stn
Class AbstractSTNNode
java.lang.Object
fr.uga.pddl4j.planners.htn.stn.AbstractSTNNode
- All Implemented Interfaces:
Serializable
This class implements a node for the simple task network planners of the PDDL4J library.
- Since:
- 4.0
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
The default operator value.static int
The default task value. -
Constructor Summary
ConstructorDescriptionCreates a new empty node with an empty state.AbstractSTNNode(AbstractSTNNode other)
Creates a new node from an other.AbstractSTNNode(State state, AbstractSTNNode parent, int operator, int task)
Creates a new node with a specified state and task network. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the operator applied to reach this node.Returns the parente node of this node.getState()
Returns the state of this node.int
getTask()
Returns the task process in this node.void
setOperator(int operator)
Sets the operator applied to reach this node.void
setParent(AbstractSTNNode parent)
Sets the parent node of this node.void
Sets the state of this node.void
setTask(int task)
Sets the task process in this node.
-
Field Details
-
DEFAULT_OPERATOR
public static int DEFAULT_OPERATORThe default operator value. -
DEFAULT_TASK
public static int DEFAULT_TASKThe default task value.
-
-
Constructor Details
-
AbstractSTNNode
Creates a new node from an other. This constructor creates a deep copy of the node in parameters.- Parameters:
other
- the node to be copied.
-
AbstractSTNNode
public AbstractSTNNode()Creates a new empty node with an empty state. The parent node is set to null, the operator to DEFAULT_OPERATOR and the task is set to DEFAULT_TASK. -
AbstractSTNNode
Creates a new node with a specified state and task network.- Parameters:
state
- state of this node.parent
- the parent node of the node.operator
- the index of the operator applied to reach the node.task
- the task processed in this node.
-
-
Method Details
-
getState
Returns the state of this node. The state describes the state of the world reached by the search.- Returns:
- the state of this node.
-
setState
Sets the state of this node. The state describes the state of the world reached by the search.- Parameters:
state
- the state to set.
-
getParent
Returns the parente node of this node. By convention, a node with a parent node equals to null is considered as the root node.- Returns:
- the parent node of this node.
-
setParent
Sets the parent node of this node.- Parameters:
parent
- the parent node to set.
-
getOperator
public final int getOperator()Returns the operator applied to reach this node. The operator can be an action or a method. By convention, the operator is represented by its index in the action or method tables of the problem. To dissociate actions and methods, positive indexes are used for actions and negative ones for methods.- Returns:
- the operator applied to reach this node.
-
setOperator
public final void setOperator(int operator)Sets the operator applied to reach this node. The operator can be an action or a method. By convention, the operator is represented by its index in the action or method tables of the problem. To dissociate actions and methods, positive indexes are used for actions and negative ones for methods.- Parameters:
operator
- the operator applied to reach this node.
-
getTask
public int getTask()Returns the task process in this node.- Returns:
- the task process in this node.
-
setTask
public void setTask(int task)Sets the task process in this node.- Parameters:
task
- the task process in this node.
-