Class ParsedAbstractOperator

java.lang.Object
fr.uga.pddl4j.parser.AbstractParsedObject
fr.uga.pddl4j.parser.ParsedAbstractOperator
All Implemented Interfaces:
ParsedObject, ParsedOperator, Serializable
Direct Known Subclasses:
ParsedAction, ParsedMethod

public abstract class ParsedAbstractOperator extends AbstractParsedObject implements ParsedOperator
This class defines an abstract planning operator.
See Also:
Serialized Form
  • Constructor Details

    • ParsedAbstractOperator

      protected ParsedAbstractOperator(ParsedOperator other)
      Create a new operator from another.
      Parameters:
      other - the other operator.
    • ParsedAbstractOperator

      protected ParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions)
      Creates operator with a specified name, list of parameters, preconditions.
      Parameters:
      name - The name of the operator.
      parameters - The list of parameters of the operator.
      preconditions - The goal description that represents the preconditions of the operator.
    • ParsedAbstractOperator

      protected ParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions, Expression<String> duration)
      Creates operator with a specified name, list of parameters, preconditions and duration constraints.
      Parameters:
      name - The name of the operator.
      parameters - The list of parameters of the operator.
      preconditions - The goal description that represents the preconditions of the operator.
      duration - the duration constraint of the operator.
  • Method Details

    • getName

      public final Symbol<String> getName()
      Returns the name of the operator.
      Specified by:
      getName in interface ParsedOperator
      Returns:
      the name of the operator.
    • setName

      public final void setName(Symbol<String> name)
      Sets a new name to the operator.
      Specified by:
      setName in interface ParsedOperator
      Parameters:
      name - the name to set.
    • getParameters

      public final List<TypedSymbol<String>> getParameters()
      Returns the list of parameters of the operator.
      Specified by:
      getParameters in interface ParsedOperator
      Returns:
      the list of parameters of the operator.
    • getParameter

      public final TypedSymbol<String> getParameter(Symbol<String> symbol)
      Returns the parameter of the operator that has a specified symbol.
      Specified by:
      getParameter in interface ParsedOperator
      Parameters:
      symbol - The symbol.
      Returns:
      the parameter of the operator that has a specified symbol or null if the operator has no such parameter.
    • toTask

      public final NamedTypedList toTask()
      Returns the task representaion of this operator.
      Specified by:
      toTask in interface ParsedOperator
      Returns:
      the task representaion of this operator.
    • setParameters

      public final void setParameters(List<TypedSymbol<String>> parameters)
      Sets a new list of parameters to this operator.
      Specified by:
      setParameters in interface ParsedOperator
      Parameters:
      parameters - The list of parameters to set.
      Throws:
      NullPointerException - if the specified parameters is null.
    • getPreconditions

      public final Expression<String> getPreconditions()
      Returns the goal description that represents the preconditions of the operator.
      Specified by:
      getPreconditions in interface ParsedOperator
      Returns:
      The goal description that represents the preconditions of the operator.
    • setPreconditions

      public final void setPreconditions(Expression<String> preconditions)
      Sets new preconditions to the operator.
      Specified by:
      setPreconditions in interface ParsedOperator
      Parameters:
      preconditions - The new goal description that represents the preconditions of the operator to set.
      Throws:
      NullPointerException - if the specified preconditions is null.
    • getArity

      public final int getArity()
      Return the arity of the operator, i.e., the number of parameters of the operator.
      Specified by:
      getArity in interface ParsedOperator
      Returns:
      the arity of the operator.
    • getDuration

      public final Expression<String> getDuration()
      Returns the duration constraints of the operator.
      Specified by:
      getDuration in interface ParsedOperator
      Returns:
      the duration constraints of the operator.
    • setDuration

      public final void setDuration(Expression<String> duration)
      Sets new duration constraints to the operator.
      Specified by:
      setDuration in interface ParsedOperator
      Parameters:
      duration - the duration constraint to set
    • isDurative

      public final boolean isDurative()
      Returns if this action is durative operator.
      Specified by:
      isDurative in interface ParsedOperator
      Returns:
      true if this operator is a durative, false otherwise.
    • equals

      public final boolean equals(Object object)
      Return if this operator is equals to another object.
      Overrides:
      equals in class Object
      Parameters:
      object - the other object.
      Returns:
      true if object is not null, is an instance of the class Action, and has the same name; otherwise it returns false.
      See Also:
      Object.equals(java.lang.Object)
    • hashCode

      public final int hashCode()
      Returns the hash code value of the operator.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value of the operator.
      See Also:
      Object.hashCode()