Package fr.uga.pddl4j.problem.operator
Class IntTaskNetwork
java.lang.Object
fr.uga.pddl4j.problem.operator.IntTaskNetwork
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionCreate a new task network.IntTaskNetwork(int arity)
Create a new task network.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.IntTaskNetwork(IntTaskNetwork other)
Create a new method from a specified task network. -
Method Summary
Modifier and TypeMethodDescriptionint
arity()
Returns the arity of the task network.boolean
Returnstrue
if this task network is equal to an object.Returns the logicial constraints between the tasks of the task network.int[]
Returns the values that represents the instantiated parameters of the task network.Return the ordering constraints of the method.int[]
Returns the list of parameters of the task network.getTasks()
Return the tasks of the method.int
getTypeOfParameters(int index)
Returns the type of the parameter at the specified index.int
getValueOfParameter(int index)
Returns the value of the parameter at a specified index.int
hashCode()
Returns a hash code value for this task network.boolean
Returns if this task network is durative.boolean
Returnstrue
if the task network is totally ordered.void
setConstraints(Expression<Integer> constraints)
Sets the logical constraints between the tasks of the task network.void
setDurative(boolean durative)
Sets the flog of this task network as durative.void
setOrderingConstraints(Expression<Integer> ordering)
Set the new ordering constraints of the method.void
setTasks(Expression<Integer> tasks)
Set the tasks of the method.void
setTotallyOrdered(boolean flag)
Set this task network totally ordered.void
setTypeOfParameter(int index, int type)
Set a new type the parameter at a specified index.void
setValueOfParameter(int index, int value)
Instantiate a parameter of the operator at a specified index with a value.
-
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
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
Return the tasks of the method.- Returns:
- the tasks of the method.
-
setTasks
Set the tasks of the method.- Parameters:
tasks
- the tasks to set.
-
getOrderingConstraints
Return the ordering constraints of the method.- Returns:
- the ordering constraints of the method.
-
setOrderingConstraints
Set the new ordering constraints of the method.- Parameters:
ordering
- the orderings constraints to set
-
getConstraints
Returns the logicial constraints between the tasks of the task network.- Returns:
- the logical constraints of the task network.
-
setConstraints
Sets the logical constraints between the tasks of the task network.- Parameters:
constraints
- The constraints to set.
-
isTotallyOrdered
public final boolean isTotallyOrdered()Returnstrue
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
Returnstrue
if this task network is equal to an object. This method returnstrue
if the object is a not null instance of the classIntTaskNetwork
and both task network have the same set of tasks, ordering constraints expression. -
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 byjava.util.Hashtable
.
-