Package fr.uga.pddl4j.problem.numeric
Class NumericConstraint
java.lang.Object
fr.uga.pddl4j.problem.numeric.AbstractNumericExpression
fr.uga.pddl4j.problem.numeric.NumericConstraint
- All Implemented Interfaces:
NumericExpression
,Serializable
This class implements a numeric constraint.
- Since:
- 4.0
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorDescriptionNumericConstraint(NumericComparator comparator, ArithmeticExpression left, ArithmeticExpression right)
Creates a new numeric constraints with a specified comparator, left and right expression.NumericConstraint(NumericConstraint other)
Creates a deep copy of numeric constraints. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns if a object is equal to this numeric constraint.boolean
evaluate(List<NumericVariable> context)
Returns the result of the evaluation of the numeric constraint.Returns the comparator of the numeric constraint.int
hashCode()
Returns the hash code value of this numeric constraint.void
setComparator(NumericComparator comparator)
Sets the comparator of the numeric constraint.toString()
Returns a string representation of this numeric constraints.Methods inherited from class fr.uga.pddl4j.problem.numeric.AbstractNumericExpression
getLeftExpression, getRightExpression, setLeftExpression, setRightExpression
-
Constructor Details
-
NumericConstraint
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
Returns the comparator of the numeric constraint.- Returns:
- the comparator of the numeric constraint.
-
setComparator
Sets the comparator of the numeric constraint.- Parameters:
comparator
- the comparator to set.
-
evaluate
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
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 classNumericConstraint
and has the same comparator and left and right exprssion. -
hashCode
public int hashCode()Returns the hash code value of this numeric constraint. -
toString
Returns a string representation of this numeric constraints.
-