JaCoP.constraints
Class Stretch
java.lang.Object
JaCoP.constraints.DecomposedConstraint
JaCoP.constraints.Stretch
public class Stretch
- extends DecomposedConstraint
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:
- 3.1
- Author:
- Radoslaw Szymanek and Polina Makeeva
|
Constructor Summary |
Stretch(int[] values,
int[] min,
int[] max,
IntVar[] x)
It creates a Stretch constraint. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Stretch
public Stretch(int[] values,
int[] min,
int[] max,
IntVar[] x)
- 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.
imposeDecomposition
public void imposeDecomposition(Store store)
- Description copied from class:
DecomposedConstraint
- It imposes the constraint in a given store.
- Specified by:
imposeDecomposition in class DecomposedConstraint
- Parameters:
store - the constraint store to which the constraint is imposed to.
decompose
public java.util.ArrayList<Constraint> decompose(Store store)
- Description copied from class:
DecomposedConstraint
- It 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:
decompose in class DecomposedConstraint
- Parameters:
store - the constraint store in which context the decomposition takes place.
- Returns:
- an array list of constraints used to decompose this constraint.