Class Method

All Implemented Interfaces:
Operator, Serializable

public final class Method extends AbstractOperator
This class implements an method. This class is used to store compact representation of a method in a planning problem.
Since:
4.0
See Also:
Serialized Form
  • Field Details

    • DEFAULT_TASK_INDEX

      public static final int DEFAULT_TASK_INDEX
      The default task index.
      See Also:
      Constant Field Values
  • Constructor Details

    • Method

      public Method(Method other)
      Create a new method from a specified method. This constructor create a deep copy of the specified method.
      Parameters:
      other - the other method.
    • Method

      public Method(String name, int arity)
      Create a new method with a specified name. The task is set to the DEFAULT_TASK_INDEX and the task network is set to an empty task network with no orderings constraints.
      Parameters:
      name - the name of the method.
      arity - the arity of the method. The arity cannot be less that 0.
  • Method Details

    • getTask

      public final int getTask()
      Return the task that is carried out by the method.
      Returns:
      the task carried out by the method.
    • setTask

      public final void setTask(int task)
      Set the task carried out by the method.
      Parameters:
      task - the task the carried out by the method.
    • getSubTasks

      public final List<Integer> getSubTasks()
      Return the subtasks of the method.
      Returns:
      the subtasks of the method.
    • setSubTasks

      public final void setSubTasks(List<Integer> tasks)
      Set the subtasks of the method.
      Parameters:
      tasks - the subtasks to set.
    • getOrderingConstraints

      public final DefaultOrderingConstraintNetwork getOrderingConstraints()
      Return the ordering constraints of the method.
      Returns:
      the ordering constraints of the method.
    • setOrderingConstraints

      public final void setOrderingConstraints(DefaultOrderingConstraintNetwork constraints)
      Set the new ordering constraints of the method.
      Parameters:
      constraints - the orderings constraints to set
    • getTaskNetwork

      public final TaskNetwork getTaskNetwork()
      Returns the task network of this method.
      Returns:
      the task network of this method.
    • setTaskNetwork

      public final void setTaskNetwork(TaskNetwork taskNetwork)
      Set the task network of this method.
      Parameters:
      taskNetwork - the task network to set.
    • getBeforeConstraints

      public Condition getBeforeConstraints(int task)
      Returns the condition that must hold before a specific task of the task network of the method.
      Parameters:
      task - the task.
      Returns:
      the condition that must hold before a task or null if the task is not a task of the task network.
    • getAfterConstraints

      public Condition getAfterConstraints(int task)
      Returns the condition that must hold after a specific task of the task network of the method.
      Parameters:
      task - the task.
      Returns:
      the condition that must hold after a task or null if the task is not a task of the task network.
    • getBetweenConstraints

      public Condition getBetweenConstraints(int task1, int task2)
      Returns the condition that must hold between two specific tasks of the task network of the method.
      Parameters:
      task1 - the first task.
      task2 - the second task.
      Returns:
      the condition that must hold between two tasks or null if t1 or t2 task is not a task of the task network.