Package fr.uga.pddl4j.problem.operator
Class Action
java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractInstantiatedOperator
fr.uga.pddl4j.problem.operator.AbstractOperator
fr.uga.pddl4j.problem.operator.Action
- All Implemented Interfaces:
Operator,Serializable
This class implements a compact representation for action of the planning problem.
Revisions:
- 21.10.2020: change the duration attribute to encode temporal problem.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConditionalEffect(ConditionalEffect effect)Adds a conditional effect to the action.Returns the effects of the action.getCost()Returns the cost of the action.Returns the duration of the action.Returns the duration of the action.Returns the unconditional effect of the action.booleanisApplicable(State state)Returnstrueif this action is applicable in a specified state.booleanReturns if this action is durative.voidsetConditionalEffects(List<ConditionalEffect> effects)Returns the conditional effects to the action.voidsetCost(NumericVariable cost)Sets the cost of the action.voidsetDuration(NumericVariable duration)Sets the duration of the action.voidsetDurationConstraints(List<NumericConstraint> constraints)Sets the duration of the action.Methods inherited from class fr.uga.pddl4j.problem.operator.AbstractOperator
getPrecondition, setPreconditionMethods 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
-
Action
Creates a new action from an other. This constructor is the copy constructor.- Parameters:
other- the other action.
-
Action
Creates a new action.- Parameters:
name- the name of the action.arity- the arity of the action.
-
Action
Creates a new action.- Parameters:
name- the name of the action.arity- the arity of the action.precondition- the precondition of the action.effect- the effects of the action.
-
-
Method Details
-
getConditionalEffects
Returns the effects of the action.- Returns:
- the effects of the action.
-
setConditionalEffects
Returns the conditional effects to the action.- Parameters:
effects- the conditional effects of the action.
-
addConditionalEffect
Adds a conditional effect to the action.- Parameters:
effect- the conditional effect to addValue.
-
isApplicable
Returnstrueif this action is applicable in a specified state.- Parameters:
state- the state.- Returns:
trueif this action is applicable in a specified state;falseotherwise.
-
getUnconditionalEffect
Returns the unconditional effect of the action.- Returns:
- the unconditional effect of the action.
-
isDurative
public final boolean isDurative()Returns if this action is durative.- Returns:
trueif this action is durative orfalseotherwise.
-
getDurationConstraints
Returns the duration of the action.- Returns:
- the duration of the action.
-
setDurationConstraints
Sets the duration of the action.- Parameters:
constraints- the duration to set.
-
getCost
Returns the cost of the action.- Returns:
- the cost of the action.
-
setCost
Sets the cost of the action.- Parameters:
cost- the cost to set.
-
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.
-