Package org.jacop.constraints
Class PrimitiveConstraint
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.PrimitiveConstraint
- All Implemented Interfaces:
SatisfiedPresent
,StoreAware
- Direct Known Subclasses:
AbsXeqY
,AeqB
,AeqS
,AinB
,AinS
,AleB
,AllEqual
,AltB
,And
,AndBoolSimple
,AndBoolVector
,AtLeast
,AtMost
,BoolClause
,Count
,CountBounds
,CountVar
,Distance
,EinA
,Eq
,EqBool
,IfThen
,IfThenBool
,IfThenElse
,Implies
,In
,Linear
,LinearInt
,Member
,Not
,Or
,OrBoolSimple
,OrBoolVector
,PeqC
,PeqQ
,PgtC
,PgteqC
,PgteqQ
,PgtQ
,PltC
,PlteqC
,PlteqQ
,PltQ
,PneqC
,PneqQ
,PplusCeqR
,PplusQeqR
,Reified
,SinA
,SumBool
,SumInt
,XeqA
,XeqC
,XeqY
,XgtC
,XgteqC
,XgteqY
,XgtY
,XinA
,XltC
,XlteqC
,XlteqY
,XltY
,XmulCeqZ
,XmulYeqC
,XneqC
,XneqY
,Xor
,XorBool
,XplusCeqZ
,XplusClteqZ
,XplusYeqC
,XplusYeqZ
,XplusYgtC
,XplusYlteqZ
public abstract class PrimitiveConstraint
extends Constraint
implements StoreAware, SatisfiedPresent
Standard unified interface for all primitive constraints. In addition to
functions defined by interface Constraint it also defines function
notConsistency and notSatisfied. Only PrimitiveConstraints can be used as
arguments to constraints Not, And, Or, etc.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionIt specifies the events which must occur for notConsistency() method being executed.Fields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace, watchedVariableGrounded
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected int
protected abstract int
int
getNestedPruningEvent
(Var var, boolean mode) It retrieves the pruning event for which any composed constraint which uses this constraint should be evaluated.int
It retrieves the pruning event which causes reevaluation of the constraint notConsistency() function.void
It imposes the constraint in a given store.void
It provide store for constraints that are not imposed but called from other constraints.abstract void
notConsistency
(Store store) It makes pruning in such a way that constraint is notConsistent.abstract boolean
It checks if constraint would be always not satisfied.void
setNotConsistencyPruningEvent
(Var var, int pruningEvent) It allows to specify customized events required to trigger execution of notConsitency() method.Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, consistency, decompose, getConsistencyPruningEvent, getDefaultConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, queueVariable, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, toString, updateAFC, watchedVariableGrounded
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jacop.api.SatisfiedPresent
satisfied
-
Field Details
-
notConsistencyPruningEvents
It specifies the events which must occur for notConsistency() method being executed.
-
-
Constructor Details
-
PrimitiveConstraint
public PrimitiveConstraint()
-
-
Method Details
-
getNotConsistencyPruningEvent
It retrieves the pruning event which causes reevaluation of the constraint notConsistency() function.- Parameters:
var
- for which pruning event is retrieved- Returns:
- the int denoting the pruning event associated with given variable.
-
impose
Description copied from class:Constraint
It imposes the constraint in a given store.- Overrides:
impose
in classConstraint
- Parameters:
store
- the constraint store to which the constraint is imposed to.
-
getNestedPruningEvent
It retrieves the pruning event for which any composed constraint which uses this constraint should be evaluated. This events are the ones which can change satisfied status?- Parameters:
var
- for which pruning event is retrievedmode
- decides if pruning event for consistency or nonconsistency is required.- Returns:
- pruning event associated with the given variable for a given consistency mode.
-
getDefaultNestedNotConsistencyPruningEvent
protected int getDefaultNestedNotConsistencyPruningEvent() -
getDefaultNestedConsistencyPruningEvent
protected int getDefaultNestedConsistencyPruningEvent() -
getDefaultNotConsistencyPruningEvent
protected abstract int getDefaultNotConsistencyPruningEvent() -
notConsistency
It makes pruning in such a way that constraint is notConsistent. It removes values which always belong to a solution.- Parameters:
store
- the constraint store in which context the notConsistency technique is evaluated.
-
notSatisfied
public abstract boolean notSatisfied()It checks if constraint would be always not satisfied.- Returns:
- true if constraint must be notSatisfied, false otherwise.
-
setNotConsistencyPruningEvent
It allows to specify customized events required to trigger execution of notConsitency() method.- Parameters:
var
- variable for which customized event is setup.pruningEvent
- the type of the event being setup.
-
include
Description copied from interface:StoreAware
It provide store for constraints that are not imposed but called from other constraints.- Specified by:
include
in interfaceStoreAware
- Parameters:
store
- the constraint store in which context the constraint is executed.
-