Package org.jacop.constraints
Class DecomposedConstraint<T extends Constraint>
java.lang.Object
org.jacop.constraints.DecomposedConstraint<T>
- Direct Known Subclasses:
AndBool
,Arithmetic
,Constraint
,CosPeqR_decomposed
,DiffnDecomposed
,Lex
,OrBool
,Sequence
,SoftAlldifferent
,SoftGCC
,Stretch
Standard unified interface/abstract class for constraints, which can only be decomposed.
Defines how to construct a constraint out of other constraints.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
It specifies the queue (index), which is used to record that constraint needs to be re-evaluated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkInput
(int[] list, Predicate<Integer> condition, String conditionDescription) <T> void
checkInput
(T[] list, Predicate<T> condition, String conditionDescription) void
checkInputForDuplication
(String a, Object[] parameters) void
checkInputForDuplicationSkipSingletons
(String a, Var[] parameters) void
checkInputForNullness
(String[] a, Object[]... parameters) void
checkInputForNullness
(String a, int[] parameters) void
checkInputForNullness
(String a, Object[] parameters) It returns an array list of constraint which are used to decompose this constraint.getDubletonsSkipSingletons
(Var[] parameters) abstract void
imposeDecomposition
(Store store) It imposes the constraint in a given store.void
imposeDecomposition
(Store store, int queueIndex) It imposes the constraint and adjusts the queue index.
-
Field Details
-
queueIndex
public int queueIndexIt specifies the queue (index), which is used to record that constraint needs to be re-evaluated.Priorytet 0 - O(c), constant execution time, e.g. primitive constraints Priorytet 1 - O(n), linear execution time, e.g. Sum, SumWeight Priorytet 2 - O(n^2) quadratic execution time, e.g. Cumulative Diff2 Priorytet 3 - polynomial execution time Priorytet 4 - execution time can be exponential in worst case, SumWeightDom
-
-
Constructor Details
-
DecomposedConstraint
public DecomposedConstraint()
-
-
Method Details
-
imposeDecomposition
It imposes the constraint in a given store.- Parameters:
store
- the constraint store to which the constraint is imposed to.
-
imposeDecomposition
It imposes the constraint and adjusts the queue index.- Parameters:
store
- the constraint store to which the constraint is imposed to.queueIndex
- the index of the queue in the store it is assigned to.
-
decompose
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.- Parameters:
store
- the constraint store in which context the decomposition takes place.- Returns:
- an array list of constraints used to decompose this constraint.
-
auxiliaryVariables
- Returns:
- null if no auxiliary variables were created, otherwise a list with variables.
-
checkInputForNullness
-
checkInputForNullness
-
checkInputForDuplication
-
checkInputForDuplicationSkipSingletons
-
getDubletonsSkipSingletons
-
checkInputForNullness
-
checkInput
-
checkInput
-
derivative
-