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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConditionalEffect(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.boolean
isApplicable(State state)
Returnstrue
if this action is applicable in a specified state.boolean
Returns if this action is durative.void
setConditionalEffects(List<ConditionalEffect> effects)
Returns the conditional effects to the action.void
setCost(NumericVariable cost)
Sets the cost of the action.void
setDuration(NumericVariable duration)
Sets the duration of the action.void
setDurationConstraints(List<NumericConstraint> constraints)
Sets the duration of the action.Methods inherited from class fr.uga.pddl4j.problem.operator.AbstractOperator
getPrecondition, setPrecondition
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
-
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
Returnstrue
if this action is applicable in a specified state.- Parameters:
state
- the state.- Returns:
true
if this action is applicable in a specified state;false
otherwise.
-
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:
true
if this action is durative orfalse
otherwise.
-
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.
-