Class NumericAssignment

java.lang.Object
fr.uga.pddl4j.problem.numeric.AbstractNumericExpression
fr.uga.pddl4j.problem.numeric.NumericAssignment
All Implemented Interfaces:
NumericExpression, Serializable

public final class NumericAssignment extends AbstractNumericExpression
This class implements a numeric assignment. This class is used to specified numeric assignment in the effect of an action.
Since:
4.0
See Also:
Serialized Form
  • Constructor Details

    • NumericAssignment

      public NumericAssignment(NumericAssignment other)
      Creates a deep copy of numeric assignment.
      Parameters:
      other - the numeric assignment to be copied.
    • NumericAssignment

      public NumericAssignment(AssignmentOperator operator, NumericVariable fluent, ArithmeticExpression expression)
      Creates a new numeric assignement with a specified operator, left and right expression.
      Parameters:
      operator - the operator the numeric assignment.
      fluent - the variable of the numeric assignment.
      expression - the arithmetic expression of the numeric assignment.
  • Method Details

    • setOperator

      public final void setOperator(AssignmentOperator operator)
      Sets the operator of this numeric assignment.
      Parameters:
      operator - the operator to set.
    • getOperator

      public final AssignmentOperator getOperator()
      Returns the operator of the numeric assignment.
      Returns:
      the operator of the numeric assignment.
    • equals

      public boolean equals(Object object)
      Returns if the numeric assignment is equal to an other object. The object is an instance of the class NumericAssignment and has the same operator and left and right expressions.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to be compared.
      Returns:
      true if the object in parameter is equal to this numeric assignmennt; false otherwise.
    • assign

      public NumericVariable assign(List<NumericVariable> context)
      Returns the value assigned.
      Parameters:
      context - the context, i.e., the value of the different variables.
      Returns:
      the value assigned.
    • hashCode

      public int hashCode()
      Returns the hash code value of this numeric assignment.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value of this numeric assignment.
    • toString

      public String toString()
      Returns a string representation of this numeric assignment.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this numeric assignment.