public class ExtensionalSupportVA extends Constraint implements UsesQueueVariable, Stateful
This implementation tries to balance the usage of memory versus time efficiency.
Modifier and Type | Field and Description |
---|---|
IntVar[] |
list
It stores variables within this extensional constraint, order does
matter.
|
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace
queueIndex
Constructor and Description |
---|
ExtensionalSupportVA(IntVar[] list)
Partial constructor which stores variables involved in a constraint but
does not get information about tuples yet.
|
ExtensionalSupportVA(IntVar[] list,
int[][] tuples)
Constructor stores reference to tuples until imposition, any changes to
tuples parameter will be reflected in the constraint behavior.
|
ExtensionalSupportVA(List<? extends IntVar> variables,
int[][] tuples)
The constructor does not create local copy of tuples array.
|
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[] |
findFirstAllowed(int varPosition,
int value,
int[] t)
It finds the first allowed tuple from the given tuple.
|
protected int |
findPosition(int value,
int[] values) |
int |
getDefaultConsistencyPruningEvent() |
void |
impose(Store store)
It imposes the constraint in a given store.
|
void |
queueVariable(int level,
Var var)
This is a function called to indicate which variable in a scope of
constraint has changed.
|
void |
removeLevel(int level)
It puts back tuples which have lost their support status at the level
which is being removed.
|
int |
seekInvalidPosition(int[] t)
It gives the position of the variable for which current domain of this
variable does not hold the used value.
|
int[] |
seekSupportVA(int varPosition,
int value)
It seeks support for a given variable-value pair.
|
int[] |
setFirstValid(int varPosition,
int value)
It computes the first valid tuple for a given variable-value pair.
|
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, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGrounded
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isStateful
public IntVar[] list
public ExtensionalSupportVA(IntVar[] list)
list
- list of variables for the constraintpublic ExtensionalSupportVA(List<? extends IntVar> variables, int[][] tuples)
variables
- the constraint scope.tuples
- the tuples which are supports for the constraint.public ExtensionalSupportVA(IntVar[] list, int[][] tuples)
list
- the constraint scope.tuples
- the tuples which are supports for the constraint.public void removeLevel(int level)
removeLevel
in interface Stateful
level
- the level which is being removed.public void consistency(Store store)
Constraint
consistency
in class Constraint
store
- constraint store within which the constraint consistency is being checked.protected int findPosition(int value, int[] values)
public int getDefaultConsistencyPruningEvent()
getDefaultConsistencyPruningEvent
in class Constraint
public void impose(Store store)
Constraint
impose
in class Constraint
store
- the constraint store to which the constraint is imposed to.public void queueVariable(int level, Var var)
Constraint
queueVariable
in class Constraint
level
- the level of the store at which the change has occurred.var
- variable which has changed.public String toString()
Constraint
toString
in class Constraint
public int[] seekSupportVA(int varPosition, int value)
varPosition
- position of the variable for which the support is seek.value
- value for which the support is seek.public int[] setFirstValid(int varPosition, int value)
varPosition
- position of the variable.value
- value for which the fist valid tuple is seek.public int[] findFirstAllowed(int varPosition, int value, int[] t)
varPosition
- position of the variable.value
- value for which first allowed tuple is seek.t
- tuple from which the search commences.public int seekInvalidPosition(int[] t)
t
- tuple being checked.Copyright © 2022. All rights reserved.