Class NumericConstraint

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

public final class NumericConstraint extends AbstractNumericExpression
This class implements a numeric constraint.
Since:
4.0
See Also:
Serialized Form
  • Constructor Details

    • NumericConstraint

      public NumericConstraint(NumericConstraint other)
      Creates a deep copy of numeric constraints.
      Parameters:
      other - the numeric constraint to be copied.
    • NumericConstraint

      public NumericConstraint(NumericComparator comparator, ArithmeticExpression left, ArithmeticExpression right)
      Creates a new numeric constraints with a specified comparator, left and right expression. The numeric constraint is created with no specific time specifier.
      Parameters:
      comparator - the comparator the numeric constraint.
      left - the left expression of the numeric constraint.
      right - the right expression of the numeric constraint.
  • Method Details

    • getComparator

      public final NumericComparator getComparator()
      Returns the comparator of the numeric constraint.
      Returns:
      the comparator of the numeric constraint.
    • setComparator

      public void setComparator(NumericComparator comparator)
      Sets the comparator of the numeric constraint.
      Parameters:
      comparator - the comparator to set.
    • evaluate

      public boolean evaluate(List<NumericVariable> context)
      Returns the result of the evaluation of the numeric constraint.
      Parameters:
      context - the context of the evaluation, i.e., the numeric variables and their values needed to complete the evalution.
      Returns:
      true if the numeric constraint is evaluated to true; false otherwise.
    • equals

      public boolean equals(Object object)
      Returns if a object is equal to this numeric constraint. A object is equal to this numeric constraints iff the object is an instance of the class NumericConstraint and has the same comparator and left and right exprssion.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to be compared.
      Returns:
      true if the object in parameter is equal to this numeric constraint; false otherwise.
    • hashCode

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

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