Class Action

All Implemented Interfaces:
Operator, Serializable

public class Action extends AbstractOperator
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 Details

    • Action

      public Action(Action other)
      Creates a new action from an other. This constructor is the copy constructor.
      Parameters:
      other - the other action.
    • Action

      public Action(String name, int arity)
      Creates a new action.
      Parameters:
      name - the name of the action.
      arity - the arity of the action.
    • Action

      public Action(String name, int arity, Condition precondition, Effect effect)
      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

      public final List<ConditionalEffect> getConditionalEffects()
      Returns the effects of the action.
      Returns:
      the effects of the action.
    • setConditionalEffects

      public final void setConditionalEffects(List<ConditionalEffect> effects)
      Returns the conditional effects to the action.
      Parameters:
      effects - the conditional effects of the action.
    • addConditionalEffect

      public final void addConditionalEffect(ConditionalEffect effect)
      Adds a conditional effect to the action.
      Parameters:
      effect - the conditional effect to addValue.
    • isApplicable

      public boolean isApplicable(State state)
      Returns true 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

      public final Effect 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 or false otherwise.
    • getDurationConstraints

      public final List<NumericConstraint> getDurationConstraints()
      Returns the duration of the action.
      Returns:
      the duration of the action.
    • setDurationConstraints

      public final void setDurationConstraints(List<NumericConstraint> constraints)
      Sets the duration of the action.
      Parameters:
      constraints - the duration to set.
    • getCost

      public final NumericVariable getCost()
      Returns the cost of the action.
      Returns:
      the cost of the action.
    • setCost

      public final void setCost(NumericVariable cost)
      Sets the cost of the action.
      Parameters:
      cost - the cost to set.
    • getDuration

      public final NumericVariable getDuration()
      Returns the duration of the action.
      Returns:
      the duration of the action.
    • setDuration

      public final void setDuration(NumericVariable duration)
      Sets the duration of the action.
      Parameters:
      duration - the duration to set.