Package org.projog.clp
Interface Constraint
- All Superinterfaces:
Expression
- All Known Subinterfaces:
LeafExpression
- All Known Implementing Classes:
And,Between,EqualTo,Equivalent,FixedValue,Implication,LessThan,LessThanOrEqualTo,Nand,Nor,Not,NotEqualTo,Or,Variable,Xor
A rule that restricts the numeric values that can be used to solve a problem.
-
Method Summary
Modifier and TypeMethodDescriptionenforce(ConstraintStore constraintStore) Attempts to enforce this constraint using the givenConstraintStore.default longgetMax(ReadConstraintStore constraintStore) default longgetMin(ReadConstraintStore constraintStore) prevent(ConstraintStore constraintStore) Attempts to prevent this constraint using the givenConstraintStore.reify(ReadConstraintStore constraintStore) replace(Function<LeafExpression, LeafExpression> function) Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.default ExpressionResultsetMax(ConstraintStore constraintStore, long max) default ExpressionResultsetMin(ConstraintStore constraintStore, long min) voidwalk(Consumer<Expression> consumer) Traverse this constraint.Methods inherited from interface org.projog.clp.Expression
setNot
-
Method Details
-
enforce
Attempts to enforce this constraint using the givenConstraintStore. -
prevent
Attempts to prevent this constraint using the givenConstraintStore. -
reify
-
walk
Traverse this constraint.- Specified by:
walkin interfaceExpression- Parameters:
consumer- will be called for eachExpressioncontained within thisConstraint.
-
replace
Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.- Specified by:
replacein interfaceExpression- Parameters:
function- returns theLeafExpressionto use as a replacement for theLeafExpressionit is called with, ornullif the originalLeafExpressionshould continue to be used.- Returns:
- a new
ConstraintwithLeafExpressions in thisConstraintreplaced with versions returned fromfunction.
-
getMin
- Specified by:
getMinin interfaceExpression
-
getMax
- Specified by:
getMaxin interfaceExpression
-
setMin
- Specified by:
setMinin interfaceExpression
-
setMax
- Specified by:
setMaxin interfaceExpression
-