Class ParsedMethod

All Implemented Interfaces:
ParsedObject, ParsedOperator, Serializable

public class ParsedMethod extends ParsedAbstractOperator
This class implements a method for htn planning operator parsed.
See Also:
Serialized Form
  • Constructor Details

    • ParsedMethod

      public ParsedMethod(ParsedMethod other)
      Create a new method from another.
      Parameters:
      other - the other method.
    • ParsedMethod

      public ParsedMethod(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> task, Expression<String> duration, Expression<String> preconditions, Expression<String> tasks, Expression<String> ordering, Expression<String> constraints, boolean ordered, boolean durative)
      Creates method with a specified name, parameter, task performed, precondition and task network.
      Parameters:
      name - The name of the method.
      parameters - The list of the method parameters.
      task - The task performed by the method.
      duration - The duration constraints of the method.
      preconditions - The preconditions of the task. This parameter can be null.
      tasks - The subtasks of the method.
      ordering - The ordering constraints between the subtasks of the method.
      constraints - The constraint on the subtasks of the method.
      ordered - The flag to indicate if the subtasks of the method is total ordered or not.
      durative - The flag to indicate if the method is durative or not.
    • ParsedMethod

      public ParsedMethod(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> task, Expression<String> preconditions, Expression<String> tasks, Expression<String> ordering, Expression<String> constraints, boolean ordered, boolean durative)
      Creates method with a specified name, parameter, task performed, precondition and task network.
      Parameters:
      name - The name of the method.
      parameters - The list of the method parameters.
      task - The task performed by the method.
      preconditions - The preconditions of the task. This parameter can be null.
      tasks - The subtasks of the method.
      ordering - The ordering constraints between the subtasks of the method.
      constraints - The constraint on the subtasks of the method.
      ordered - The flag to indicate if the subtasks of the method is total ordered or not.
      durative - The flag to indicate if the method is durative or not.
    • ParsedMethod

      public ParsedMethod(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> task, Expression<String> duration, Expression<String> preconditions, ParsedTaskNetwork network)
      Creates method with a specified name, parameter, task performed, precondition and task network.
      Parameters:
      name - The name of the method.
      parameters - The list of the method parameters.
      task - The task performed by the method.
      duration - The duration constraints of the method.
      preconditions - The preconditions of the task. This parameter can be null.
      network - the task network of the method.
    • ParsedMethod

      public ParsedMethod(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> task, Expression<String> preconditions, ParsedTaskNetwork network)
      Creates method with a specified name, parameter, task performed, precondition and task network.
      Parameters:
      name - The name of the method.
      parameters - The list of the method parameters.
      task - The task performed by the method.
      preconditions - The preconditions of the task. This parameter can be null.
      network - the task network of the method.
  • Method Details

    • getTask

      public final Expression<String> getTask()
      Returns the task performed by the method.
      Returns:
      the method tasks.
    • setTask

      public final void setTask(Expression<String> task)
      Sets the task performed by the method.
      Parameters:
      task - The task performed by the method.
    • getSubTasks

      public final Expression<String> getSubTasks()
      Returns the tasks of the task network.
      Returns:
      the tasks of the task network.
    • setSubTasks

      public final void setSubTasks(Expression<String> tasks)
      Sets the tasks of the task network.
      Parameters:
      tasks - The tasks to set.
    • getOrdering

      public final Expression<String> getOrdering()
      Returns the ordering constraints between the tasks of the task network.
      Returns:
      the ordering constraints of the task network.
    • setOrdering

      public final void setOrdering(Expression<String> constraints)
      Sets the ordering constraints between the tasks of the task network.
      Parameters:
      constraints - The constraints to set.
    • getConstraints

      public final Expression<String> getConstraints()
      Returns the logical constraints between the tasks of the task network.
      Returns:
      the logical constraints of the task network.
    • setLogicalConstraints

      public final void setLogicalConstraints(Expression<String> constraints)
      Sets the logical constraints between the tasks of the task network.
      Parameters:
      constraints - The constraints to set.
    • isTotallyOrdered

      public final boolean isTotallyOrdered()
      Returns if the task network is total ordered or not.
      Returns:
      true the method is total ordered or not, false otherwise.
    • setTotallyOrdered

      public final void setTotallyOrdered(boolean flag)
      Set the boolean totally ordered flag of the task network to a specified value.
      Parameters:
      flag - The flag to set.
    • getTaskNetwork

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

      public final void setTaskNetwork(ParsedTaskNetwork tasknetwork)
      Sets the task network of this method.
      Parameters:
      tasknetwork - the tasknetwork to set.
    • toString

      public String toString()
      Returns a PDDL string representation of the method.
      Overrides:
      toString in class Object
      Returns:
      a string PDDL representation of the method.