Package fr.uga.pddl4j.planners.htn.stn
Class TFDNode
java.lang.Object
fr.uga.pddl4j.planners.htn.stn.AbstractSTNNode
fr.uga.pddl4j.planners.htn.stn.TFDNode
- All Implemented Interfaces:
Serializable
This class implements a node for the TFDPlanner of the PDDL4J library. This class is a simplified version of the
class
PFDNode
. The task network is modeled using a simple task list to speed up searching and optimize
memory size.- Since:
- 4.0
- See Also:
PFDNode
, Serialized Form
-
Field Summary
Fields inherited from class fr.uga.pddl4j.planners.htn.stn.AbstractSTNNode
DEFAULT_OPERATOR, DEFAULT_TASK
-
Constructor Summary
ConstructorDescriptionTFDNode()
Creates a new empty TFDNode.Creates a new TFDNode from an other.Creates a new TFDNode with a specified state and task network.Creates a new TFDNode with a specified state and task network. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if a node is equals to an other object.getTasks()
Returns the list of tasks the node.int
hashCode()
Returns the hash code value of the node.popTask()
Pops the first task of the node and remove it from the node.boolean
pushAllTasks(List<Integer> tasks)
Pushes a list of tasks at beginning of the task list of the node.void
Sets the list of tasks of the node.Methods inherited from class fr.uga.pddl4j.planners.htn.stn.AbstractSTNNode
getOperator, getParent, getState, getTask, setOperator, setParent, setState, setTask
-
Constructor Details
-
TFDNode
Creates a new TFDNode from an other. This constructor creates a deep copy of the node in parameters.- Parameters:
other
- the node to be copied.
-
TFDNode
public TFDNode()Creates a new empty TFDNode. The parent node is set to null, the operator is set to DEFAULT_OPERATOR and the task is set to DEFAULT_TASK. -
TFDNode
Creates a new TFDNode with a specified state and task network. The parent node is set to null, the operator is set to DEFAULT_OPERATOR and the task is set to DEFAULT_TASK.- Parameters:
state
- the state of the node.tasks
- the task network of the node.
-
TFDNode
Creates a new TFDNode with a specified state and task network.- Parameters:
state
- the state of the node.tasks
- the task network of the node.parent
- the parent of the node.operator
- the index of the operator applied to reach this node.task
- the task processed in this node.
-
-
Method Details
-
getTasks
Returns the list of tasks the node. The list describes the list of tasks remaining to be accomplished.- Returns:
- the list of tasks of the node.
-
setTasks
Sets the list of tasks of the node. The list describes the tasks to be accomplished.- Parameters:
tasks
- the list of tasks of the node.
-
popTask
Pops the first task of the node and remove it from the node.- Returns:
- the first task of contained in the node. If the node has no more tasks, the method returns null;
-
pushAllTasks
Pushes a list of tasks at beginning of the task list of the node.- Parameters:
tasks
- the list of tasks to push.- Returns:
- true if the collection was pushed, false otherwise.
-
equals
Returnstrue
if a node is equals to an other object. An object is equals to this node if and only if the other object is an instance ofTFDNode
and have the same state and the same task network.- Overrides:
equals
in classObject
- Parameters:
obj
- the object to be compared.- Returns:
true
if a node is equals to an other object,false
otherwise.- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()Returns the hash code value of the node.- Overrides:
hashCode
in classObject
- Returns:
- the hash code value of the node.
- See Also:
Object.hashCode()
-