Package org.jacop.constraints
Class Stretch
It constructs a Stretch constraint based on Regular constraint. An example
of a Stretch constraint is values = [1, 2], min = [1, 2], max = [2, 3], and
x = [x1, x2, x3, x4]. It specifies that variables x are equal to value 1 and
2, and any sequence of values 1 has to be of length between 1 and 2, and any
sequence of values 2 has to be of length between 2 and 3.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List<Constraint> (package private) int[](package private) int[](package private) int[](package private) IntVar[]Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIt returns an array list of constraint which are used to decompose this constraint.voidimposeDecomposition(Store store) It imposes the constraint in a given store.Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
values
int[] values -
min
int[] min -
max
int[] max -
x
IntVar[] x -
constraints
List<Constraint> constraints
-
-
Constructor Details
-
Stretch
It creates a Stretch constraint.- Parameters:
values- a list of values which can be taken by variables.min- the minimal sequence length for each value.max- the maximal sequence length for each value.x- variables which assignment is constrained by Stretch constraint.
-
-
Method Details
-
imposeDecomposition
Description copied from class:DecomposedConstraintIt imposes the constraint in a given store.- Specified by:
imposeDecompositionin classDecomposedConstraint<Constraint>- Parameters:
store- the constraint store to which the constraint is imposed to.
-
decompose
Description copied from class:DecomposedConstraintIt returns an array list of constraint which are used to decompose this constraint. It actually creates a decomposition (possibly also creating variables), but it does not impose the constraint.- Specified by:
decomposein classDecomposedConstraint<Constraint>- Parameters:
store- the constraint store in which context the decomposition takes place.- Returns:
- an array list of constraints used to decompose this constraint.
-