Package org.jacop.constraints
Class Element
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.Element
- All Implemented Interfaces:
UsesQueueVariable
Element constraint implements the element/4 constraint (both with integer
list and variables list). It defines a following relation
variables[index + shift] = value. The default shift value is equal to zero.
The first index in the variables list is equal to 1.
- Version:
- 4.10
-
Field Summary
FieldsFields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace, watchedVariableGroundedFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionIt returns the variables in a scope of the constraint.static ConstraintIt constructs element constraint based on variables.static ConstraintIt constructs element constraint based on variables.static ConstraintIt constructs element constraint based on variables.static ConstraintIt constructs element constraint based on variables.static ConstraintIt constructs element constraint based on variables.static ConstraintIt constructs element constraint based on variables.voidconsistency(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.intIt retrieves the pruning event which causes reevaluation of the constraint.intid()It gives the id string of a constraint.voidIt imposes the constraint in a given store.voidIt increases the weight of the variables in the constraint scope.voidqueueVariable(int level, Var V) This is a function called to indicate which variable in a scope of constraint has changed.voidIt removes the constraint by removing this constraint from all variables.toString()It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.Constraint
afc, cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, impose, imposeDecomposition, intArrayToString, long2int, numberArgs, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
c
-
-
Constructor Details
-
Element
Deprecated.It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.variables- list of variables.value- variable to which index variable is equal to.
-
Element
Deprecated.It constructs element constraint based on variables.- Parameters:
index- index variable.variables- variables list.value- value variable.shift- shift by which the index value is moved to the left.
-
Element
Deprecated.It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.values- list of integers.value- variable to which index variable is equal to.
-
Element
Deprecated.It constructs element constraint based on variables.- Parameters:
index- index variable.values- integer list.value- value variable.shift- shift by which the index value is moved to the left.
-
Element
Deprecated.It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.variables- list of integers.value- variable to which index variable is equal to.
-
Element
Deprecated.It constructs element constraint based on variables.- Parameters:
index- index variable.variables- variables list.value- value variable.shift- shift by which the index value is moved to the left.
-
-
Method Details
-
arguments
Description copied from class:ConstraintIt returns the variables in a scope of the constraint.- Overrides:
argumentsin classConstraint- Returns:
- variables in a scope of the constraint.
-
consistency
Description copied from class:ConstraintIt 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:
consistencyin classConstraint- Parameters:
store- constraint store within which the constraint consistency is being checked.
-
getConsistencyPruningEvent
Description copied from class:ConstraintIt retrieves the pruning event which causes reevaluation of the constraint.- Overrides:
getConsistencyPruningEventin classConstraint- Parameters:
var- variable for which pruning event is retrieved- Returns:
- it returns the int code of the pruning event (GROUND, BOUND, ANY, NONE)
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Specified by:
getDefaultConsistencyPruningEventin classConstraint
-
id
Description copied from class:ConstraintIt gives the id string of a constraint.- Overrides:
idin classConstraint- Returns:
- string id of the constraint.
-
impose
Description copied from class:ConstraintIt imposes the constraint in a given store.- Overrides:
imposein classConstraint- Parameters:
store- the constraint store to which the constraint is imposed to.
-
queueVariable
Description copied from class:ConstraintThis 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:
queueVariablein classConstraint- Parameters:
level- the level of the store at which the change has occurred.V- variable which has changed.
-
removeConstraint
public void removeConstraint()Description copied from class:ConstraintIt removes the constraint by removing this constraint from all variables.- Overrides:
removeConstraintin classConstraint
-
toString
Description copied from class:ConstraintIt produces a string representation of a constraint state.- Overrides:
toStringin classConstraint
-
increaseWeight
public void increaseWeight()Description copied from class:ConstraintIt increases the weight of the variables in the constraint scope.- Overrides:
increaseWeightin classConstraint
-
choose
It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.variables- list of variables.value- variable to which index variable is equal to.- Returns:
- constraint that encodes the desired logic.
-
choose
public static Constraint choose(IntVar index, List<? extends IntVar> variables, IntVar value, int shift) It constructs element constraint based on variables.- Parameters:
index- index variable.variables- variables list.value- value variable.shift- shift by which the index value is moved to the left.- Returns:
- constraint that encodes the desired logic.
-
choose
It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.values- list of integers.value- variable to which index variable is equal to.- Returns:
- constraint that encodes the desired logic.
-
choose
It constructs element constraint based on variables.- Parameters:
index- index variable.values- integer list.value- value variable.shift- shift by which the index value is moved to the left.- Returns:
- constraint that encodes the desired logic.
-
choose
It constructs element constraint based on variables. The default shift value is equal 0.- Parameters:
index- index variable.variables- list of integers.value- variable to which index variable is equal to.- Returns:
- constraint that encodes the desired logic.
-
choose
It constructs element constraint based on variables.- Parameters:
index- index variable.variables- variables list.value- value variable.shift- shift by which the index value is moved to the left.- Returns:
- constraint that encodes the desired logic.
-