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 TypeFieldDescriptionintIt specifies the queue (index), which is used to record that constraint needs to be re-evaluated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckInput(int[] list, Predicate<Integer> condition, String conditionDescription) <T> voidcheckInput(T[] list, Predicate<T> condition, String conditionDescription) voidcheckInputForDuplication(String a, Object[] parameters) voidcheckInputForDuplicationSkipSingletons(String a, Var[] parameters) voidcheckInputForNullness(String[] a, Object[]... parameters) voidcheckInputForNullness(String a, int[] parameters) voidcheckInputForNullness(String a, Object[] parameters) It returns an array list of constraint which are used to decompose this constraint.getDubletonsSkipSingletons(Var[] parameters) abstract voidimposeDecomposition(Store store) It imposes the constraint in a given store.voidimposeDecomposition(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
-