Class TFDNode

All Implemented Interfaces:
Serializable

public class TFDNode extends AbstractSTNNode
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
  • Constructor Details

    • TFDNode

      public TFDNode(TFDNode other)
      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

      public TFDNode(State state, List<Integer> tasks)
      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

      public TFDNode(State state, List<Integer> tasks, TFDNode parent, int operator, int task)
      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

      public final List<Integer> 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

      public final void setTasks(List<Integer> tasks)
      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

      public final Integer 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

      public final boolean pushAllTasks(List<Integer> tasks)
      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

      public boolean equals(Object obj)
      Returns true 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 of TFDNode and have the same state and the same task network.
      Overrides:
      equals in class Object
      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 class Object
      Returns:
      the hash code value of the node.
      See Also:
      Object.hashCode()