Package fr.uga.pddl4j.problem.operator
Class AbstractIntOperator
java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractInstantiatedOperator
fr.uga.pddl4j.problem.operator.AbstractIntOperator
- All Implemented Interfaces:
Operator,Serializable
This abstract class implements the common part of an operator (action of method) with integer representation.
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new operator from another.protectedAbstractIntOperator(String name, int arity)Creates a new operator with.protectedAbstractIntOperator(String name, int[] parameters, int[] instantiations, Expression<Integer> preconditions)Creates a new operator. -
Method Summary
Modifier and TypeMethodDescriptionReturns the duration of the action.Return the preconditions of the operator.booleanReturns if this action is a durative action.voidsetDuration(Expression<Integer> duration)Sets the duration of the action.voidsetPreconditions(Expression<Integer> preconditions)Set the precondition of the operator.Methods inherited from class fr.uga.pddl4j.problem.operator.AbstractInstantiatedOperator
arity, equals, getInstantiations, getName, getParameters, getTypeOfParameters, getValueOfParameter, hashCode, isAlreadyInstantiatedWith, isDummy, setDummy, setName, setTypeOfParameter, setValueOfParameter
-
Constructor Details
-
AbstractIntOperator
Creates a new operator from another.- Parameters:
other- the other operator.
-
AbstractIntOperator
Creates a new operator with. The precondition is initialized with OR expression.- Parameters:
name- the name of the operator.arity- the arity of the operator.
-
AbstractIntOperator
protected AbstractIntOperator(String name, int[] parameters, int[] instantiations, Expression<Integer> preconditions)Creates a new operator. The length of the parameters and the length of instantiations must be the same.- Parameters:
name- the name of the operator.parameters- the types of the parameters.instantiations- the values of the parameters.preconditions- the preconditions of the operator.
-
-
Method Details
-
getPreconditions
Return the preconditions of the operator.- Returns:
- the preconditions of the operator.
-
setPreconditions
Set the precondition of the operator.- Parameters:
preconditions- the preconditions to set.
-
isDurative
public final boolean isDurative()Returns if this action is a durative action.- Returns:
trueif this action is durative;falseotherwise.
-
getDuration
Returns the duration of the action.- Returns:
- the duration of the action.
-
setDuration
Sets the duration of the action.- Parameters:
duration- the duration to set.
-