Package org.jacop.set.constraints
Class PartitionSet
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.set.constraints.PartitionSet
- All Implemented Interfaces:
UsesQueueVariable
Channel constraint requires that array of int variables x and array
of set variables y are related such that (x[i] = j) <->
(i in s[j]). Indexes start form 0, both for integer and set variables,
by default. To define other starting index use offset definitions.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) static AtomicInteger
(package private) int
(package private) SetVar[]
(package private) Store
(package private) IntDomain
(package private) LinkedHashSet
<Integer> Fields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionSet
(SetVar[] s, IntDomain universe) It constructs a Channel constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoid
consistency
(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.int
void
queueVariable
(int level, Var var) This is a function called to indicate which variable in a scope of constraint has changed.toString()
It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGrounded
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
idNumber
-
s
SetVar[] s -
n
int n -
u
-
firstConsistencyCheck
boolean firstConsistencyCheck -
variableQueue
LinkedHashSet<Integer> variableQueue -
varMap
-
store
Store store
-
-
Constructor Details
-
PartitionSet
It constructs a Channel constraint.- Parameters:
s
- array of set variables.universe
- set of all values.
-
-
Method Details
-
consistency
Description copied from class:Constraint
It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.- Specified by:
consistency
in classConstraint
- Parameters:
store
- constraint store within which the constraint consistency is being checked.- Throws:
FailException
-
queueVariable
Description copied from class:Constraint
This is a function called to indicate which variable in a scope of constraint has changed. It also indicates a store level at which the change has occurred.- Overrides:
queueVariable
in classConstraint
- Parameters:
level
- the level of the store at which the change has occurred.var
- variable which has changed.
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEvent
in classConstraint
-
toString
Description copied from class:Constraint
It produces a string representation of a constraint state.- Overrides:
toString
in classConstraint
-