Package org.jacop.constraints
Class LinearIntDom
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.PrimitiveConstraint
org.jacop.constraints.LinearInt
org.jacop.constraints.LinearIntDom
- All Implemented Interfaces:
SatisfiedPresent
,StoreAware
LinearIntDom constraint implements the weighted summation over several
variables.
sum(i in 1..N)(ai*xi) = b
It provides the weighted sum from all variables on the list. The weights are integers. Domain consistency is used.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int[]
Collects support (valid assignments) for variables(package private) static AtomicInteger
(package private) double
Limit on the product of sizes of domains when domain consistency is carried out.(package private) IntervalDomain[]
Defines support (valid values) for each variableFields inherited from class org.jacop.constraints.LinearInt
a, b, eq, ge, gt, I, l, le, lt, ne, negRel, pos, reified, relationType, store, sumMax, sumMin, x
Fields inherited from class org.jacop.constraints.PrimitiveConstraint
notConsistencyPruningEvents
Fields inherited from class org.jacop.constraints.Constraint
afcWeight, atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace, watchedVariableGrounded
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
Constructor Summary
ConstructorsConstructorDescriptionIt constructs the constraint LinearIntDom.LinearIntDom
(IntVar[] list, int[] weights, String rel, int sum) It constructs the constraint LinearIntDom.LinearIntDom
(IntVar[] list, int[] weights, String rel, IntVar sum) It constructs the constraint LinearIntDom.LinearIntDom
(Store store, List<? extends IntVar> variables, List<Integer> weights, String rel, int sum) Deprecated.LinearIntDom constraint does not use Store parameter any longer.LinearIntDom
(Store store, IntVar[] list, int[] weights, String rel, int sum) Deprecated.LinearIntDom constraint does not use Store parameter any longer.LinearIntDom
(Store store, IntVar[] list, int[] weights, String rel, IntVar sum) Deprecated.LinearIntDom constraint does not use Store parameter any longer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
consistency
(Store store) It is a (most probably incomplete) consistency function which removes the values from variables domains.(package private) double
(package private) void
findSupport
(int index, long sum) (package private) void
findSupportNegative
(int index, long partialSum) (package private) void
findSupportPositive
(int index, long partialSum) int
protected int
protected int
protected int
void
notConsistency
(Store store) It makes pruning in such a way that constraint is notConsistent.void
propagate
(int rel) (package private) void
pruneEq()
(package private) void
pruneNeq()
toString()
It produces a string representation of a constraint state.Methods inherited from class org.jacop.constraints.LinearInt
checkForOverflow, commonInitialization, computeInit, impose, notSatisfied, pruneGtEq, pruneLtEq, rel2String, relation, satisfied, satisfiedEq, satisfiedGtEq, satisfiedLtEq, satisfiedNeq
Methods inherited from class org.jacop.constraints.PrimitiveConstraint
getNestedPruningEvent, getNotConsistencyPruningEvent, include, setNotConsistencyPruningEvent
Methods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, queueVariable, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, toInt, toInt, updateAFC, watchedVariableGrounded
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, derivative, getDubletonsSkipSingletons, imposeDecomposition
-
Field Details
-
idNumber
-
support
IntervalDomain[] supportDefines support (valid values) for each variable -
assignments
int[] assignmentsCollects support (valid assignments) for variables -
limitDomainPruning
double limitDomainPruningLimit on the product of sizes of domains when domain consistency is carried out.
-
-
Constructor Details
-
LinearIntDom
Deprecated.LinearIntDom constraint does not use Store parameter any longer.It constructs the constraint LinearIntDom.- Parameters:
store
- current storelist
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- the sum of weighted variables.
-
LinearIntDom
Deprecated.LinearIntDom constraint does not use Store parameter any longer.It constructs the constraint LinearIntDom.- Parameters:
store
- current storelist
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- variable containing the sum of weighted variables.
-
LinearIntDom
@Deprecated public LinearIntDom(Store store, List<? extends IntVar> variables, List<Integer> weights, String rel, int sum) Deprecated.LinearIntDom constraint does not use Store parameter any longer.It constructs the constraint LinearIntDom.- Parameters:
store
- current storevariables
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- variable containing the sum of weighted variables.
-
LinearIntDom
It constructs the constraint LinearIntDom.- Parameters:
list
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- the sum of weighted variables.
-
LinearIntDom
It constructs the constraint LinearIntDom.- Parameters:
list
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- variable containing the sum of weighted variables.
-
LinearIntDom
It constructs the constraint LinearIntDom.- Parameters:
variables
- variables which are being multiplied by weights.weights
- weight for each variable.rel
- the relation, one of "==", "<", ">", "<=", ">=", "!="sum
- variable containing the sum of weighted variables.
-
-
Method Details
-
consistency
Description copied from class:Constraint
It 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.- Overrides:
consistency
in classLinearInt
- Parameters:
store
- constraint store within which the constraint consistency is being checked.
-
notConsistency
Description copied from class:PrimitiveConstraint
It makes pruning in such a way that constraint is notConsistent. It removes values which always belong to a solution.- Overrides:
notConsistency
in classLinearInt
- Parameters:
store
- the constraint store in which context the notConsistency technique is evaluated.
-
propagate
public void propagate(int rel) -
domainSize
double domainSize() -
pruneEq
void pruneEq() -
pruneNeq
void pruneNeq() -
findSupport
void findSupport(int index, long sum) -
findSupportPositive
void findSupportPositive(int index, long partialSum) -
findSupportNegative
void findSupportNegative(int index, long partialSum) -
getDefaultNestedConsistencyPruningEvent
protected int getDefaultNestedConsistencyPruningEvent()- Overrides:
getDefaultNestedConsistencyPruningEvent
in classLinearInt
-
getDefaultNestedNotConsistencyPruningEvent
protected int getDefaultNestedNotConsistencyPruningEvent()- Overrides:
getDefaultNestedNotConsistencyPruningEvent
in classLinearInt
-
getDefaultConsistencyPruningEvent
public int getDefaultConsistencyPruningEvent()- Overrides:
getDefaultConsistencyPruningEvent
in classLinearInt
-
getDefaultNotConsistencyPruningEvent
protected int getDefaultNotConsistencyPruningEvent()- Overrides:
getDefaultNotConsistencyPruningEvent
in classLinearInt
-
toString
Description copied from class:Constraint
It produces a string representation of a constraint state.
-