Class NumericConstraintPredicate
java.lang.Object
org.projog.core.predicate.AbstractSingleResultPredicate
org.projog.core.predicate.builtin.clp.NumericConstraintPredicate
- All Implemented Interfaces:
KnowledgeBaseConsumer, ConstraintFactory, PredicateFactory
public final class NumericConstraintPredicate
extends AbstractSingleResultPredicate
implements ConstraintFactory
CLP predicates for comparing numeric values.
#=equal to#\=not equal to#>greater than#>=greater than or equal to#<less than#=<less than or equal to
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiFunction<org.projog.clp.Expression, org.projog.clp.Expression, org.projog.clp.Constraint> private ExpressionFactories -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNumericConstraintPredicate(BiFunction<org.projog.clp.Expression, org.projog.clp.Expression, org.projog.clp.Constraint> constraintGenerator) -
Method Summary
Modifier and TypeMethodDescriptionorg.projog.clp.ConstraintcreateConstraint(Term[] args, Set<ClpVariable> vars) static NumericConstraintPredicateequalTo()booleanstatic NumericConstraintPredicatestatic NumericConstraintPredicateprotected voidinit()This method is called byAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase).static NumericConstraintPredicatelessThan()static NumericConstraintPredicatestatic NumericConstraintPredicateMethods inherited from class AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, isRetryable, setKnowledgeBaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PredicateFactory
isAlwaysCutOnBacktrack
-
Field Details
-
constraintGenerator
private final BiFunction<org.projog.clp.Expression, org.projog.clp.Expression, org.projog.clp.Constraint> constraintGenerator -
expressions
-
-
Constructor Details
-
NumericConstraintPredicate
private NumericConstraintPredicate(BiFunction<org.projog.clp.Expression, org.projog.clp.Expression, org.projog.clp.Constraint> constraintGenerator)
-
-
Method Details
-
equalTo
-
notEqualTo
-
lessThan
-
greaterThan
-
lessThanOrEqualTo
-
greaterThanOrEqualTo
-
evaluate
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
init
protected void init()Description copied from class:AbstractSingleResultPredicateThis method is called byAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase).Can be overridden by subclasses to perform initialisation before any calls to
AbstractSingleResultPredicate.evaluate(Term...)are made. AsAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase)will have already been called before this method is invoked, overridden versions will be able to access theKnowledgeBaseusingAbstractSingleResultPredicate.getKnowledgeBase().- Overrides:
initin classAbstractSingleResultPredicate
-
createConstraint
- Specified by:
createConstraintin interfaceConstraintFactory
-