public class NoGood extends Constraint
Do not be fooled by watched literals, if you add thousands of no-goods then traversing even 1/10 of them if they are watched by variable which has been grounded can slow down search considerably.
NoGoods constraints are imposed at all levels once added. Do not use in subsearches, as it will not take into account the assignments performed in master search.
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
listOfValues
It specifies a list of values in no-good constraint.
|
protected IntVar[] |
listOfVars
It specifies a list of variables in no-good constraint.
|
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, tracequeueIndex| Constructor and Description |
|---|
NoGood(IntVar[] listOfVars,
int[] listOfValues)
It creates a no-good constraint.
|
NoGood(List<? extends IntVar> listOfVars,
List<Integer> listOfValues)
It creates a no-good constraint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the
values from variables domains.
|
int |
getDefaultConsistencyPruningEvent() |
void |
impose(Store store)
It imposes the constraint in a given store.
|
void |
removeConstraint()
This function does nothing as constraints can not be removed for a given
level.
|
String |
toString()
It produces a string representation of a constraint state.
|
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, queueVariable, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGroundedauxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecompositionprotected IntVar[] listOfVars
protected int[] listOfValues
public NoGood(IntVar[] listOfVars, int[] listOfValues)
listOfVars - the scope of the constraint.listOfValues - no-good values which all-together assignment to variables within constraint scope is a no-good.public void consistency(Store store)
Constraintconsistency in class Constraintstore - constraint store within which the constraint consistency is being checked.public int getDefaultConsistencyPruningEvent()
getDefaultConsistencyPruningEvent in class Constraintpublic void impose(Store store)
Constraintimpose in class Constraintstore - the constraint store to which the constraint is imposed to.public void removeConstraint()
removeConstraint in class Constraintpublic String toString()
ConstrainttoString in class ConstraintCopyright © 2022. All rights reserved.