Class IntTaskNetwork

java.lang.Object
fr.uga.pddl4j.problem.operator.IntTaskNetwork
All Implemented Interfaces:
Serializable

public final class IntTaskNetwork extends Object implements Serializable
This class implements a task network. This class is used to store compact representation of a task network during the instantiation process.
See Also:
Serialized Form
  • Constructor Details

    • IntTaskNetwork

      public IntTaskNetwork()
      Create a new task network. The tasks and the ordering constraints are empty and expression.
    • IntTaskNetwork

      public IntTaskNetwork(int arity)
      Create a new task network. The tasks and the ordering constraints are empty and expression.
      Parameters:
      arity - the arity of the task network.
    • IntTaskNetwork

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

      public IntTaskNetwork(Expression<Integer> tasks, Expression<Integer> orderingConstraints, Expression<Integer> constraints, boolean totallyOrdered, boolean durative)
      Create a new task network with a set of tasks and orderings constraints. Warning the method does not check if the ordering constraints given in parameter are consistent with boolean flag that indicates that the task network is totally ordered.
      Parameters:
      tasks - the tasks of the task network.
      orderingConstraints - the orderings constraints of the task network.
      constraints - the constraints of the task network.
      totallyOrdered - the boolean flag to indicate if the task network is totally ordered or not.
      durative - the boolean flag to indicate if the task network is durative or not.
  • Method Details

    • getTasks

      public final Expression<Integer> getTasks()
      Return the tasks of the method.
      Returns:
      the tasks of the method.
    • setTasks

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

      public final Expression<Integer> getOrderingConstraints()
      Return the ordering constraints of the method.
      Returns:
      the ordering constraints of the method.
    • setOrderingConstraints

      public final void setOrderingConstraints(Expression<Integer> ordering)
      Set the new ordering constraints of the method.
      Parameters:
      ordering - the orderings constraints to set
    • getConstraints

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

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

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

      public final void setTotallyOrdered(boolean flag)
      Set this task network totally ordered.
      Parameters:
      flag - the flag used to indicated that this task network is totally ordered.
    • getParameters

      public final int[] getParameters()
      Returns the list of parameters of the task network.
      Returns:
      the list of parameters of the task network.
    • getInstantiations

      public int[] getInstantiations()
      Returns the values that represents the instantiated parameters of the task network.
      Returns:
      the values that represents the instantiated parameters of the task network.
    • arity

      public final int arity()
      Returns the arity of the task network.
      Returns:
      the arity of the task network.
    • getTypeOfParameters

      public final int getTypeOfParameters(int index)
      Returns the type of the parameter at the specified index.
      Parameters:
      index - the index of the parameter.
      Returns:
      the type of the parameter at the specified index.
    • setTypeOfParameter

      public final void setTypeOfParameter(int index, int type)
      Set a new type the parameter at a specified index.
      Parameters:
      index - the index of the parameter. The index must be in [0,arity[.
      type - the type to set.
    • getValueOfParameter

      public final int getValueOfParameter(int index)
      Returns the value of the parameter at a specified index.
      Parameters:
      index - the index. The index must be in [0,arity[.
      Returns:
      the value of the parameter.
    • setValueOfParameter

      public final void setValueOfParameter(int index, int value)
      Instantiate a parameter of the operator at a specified index with a value.

      The assumption is made that different operator parameters are instantiated with different constants, i.e., the planner never generates actions like move(a,a) because we consider this as a bad domain representation that should be revised. In fact, in actions with identical constant parameters, all but one of the constants are superfluous and can be skipped from the representation without loss of information.

      Parameters:
      index - the index of the parameter to instantiate. The index must be in [0,arity[.
      value - the value of instantiation.
    • isDurative

      public final boolean isDurative()
      Returns if this task network is durative.
      Returns:
      true if the tasknetworl is durative; false otherwise.
    • setDurative

      public final void setDurative(boolean durative)
      Sets the flog of this task network as durative.
      Parameters:
      durative - the durative flag to set.
    • equals

      public final boolean equals(Object obj)
      Returns true if this task network is equal to an object. This method returns true if the object is a not null instance of the class IntTaskNetwork and both task network have the same set of tasks, ordering constraints expression.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to be compared.
      Returns:
      true if this task network is equal to an object; false otherwise.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this task network. This method is supported for the benefit of hash tables such as those provided by java.util.Hashtable.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this task network.