Package org.jacop.floats.constraints
Class LinearFloat
java.lang.Object
org.jacop.constraints.DecomposedConstraint<Constraint>
org.jacop.constraints.Constraint
org.jacop.constraints.PrimitiveConstraint
org.jacop.floats.constraints.linear.Linear
org.jacop.floats.constraints.LinearFloat
- All Implemented Interfaces:
SatisfiedPresent,StoreAware,UsesQueueVariable
- Direct Known Subclasses:
SumFloat
LinearFloat constraint implements the weighted summation over several
Variable's . It provides the weighted sum from all Variable's on the list.
This version works as argument to Reified and Xor constraints. For other constraints And, Or, Not, Eq, IfThen, IfThenElse it does not work currently.
- Version:
- 4.10
-
Field Summary
Fields inherited from class org.jacop.floats.constraints.linear.Linear
eq, ge, gt, le, list, lt, ne, relationType, sum, weightsFields inherited from class org.jacop.constraints.PrimitiveConstraint
notConsistencyPruningEventsFields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, traceFields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex -
Constructor Summary
ConstructorsConstructorDescriptionIt constructs the constraint LinearFloat.LinearFloat(Store store, List<? extends FloatVar> variables, List<Double> weights, String rel, double sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(Store store, FloatVar[] list, double[] weights, String rel, double sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(Store store, FloatVar[] list, double[] weights, String rel, FloatVar sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(FloatVar[] list, double[] weights, String rel, double sum) LinearFloat(FloatVar[] list, double[] weights, String rel, FloatVar sum) -
Method Summary
Modifier and TypeMethodDescriptionvoidqueueVariable(int level, Var var) This is a function called to indicate which variable in a scope of constraint has changed.Methods inherited from class org.jacop.floats.constraints.linear.Linear
consistency, getDefaultConsistencyPruningEvent, getDefaultNestedConsistencyPruningEvent, getDefaultNestedNotConsistencyPruningEvent, getDefaultNotConsistencyPruningEvent, impose, notConsistency, notSatisfied, rel2String, relation, satisfied, toStringMethods inherited from class org.jacop.constraints.PrimitiveConstraint
getNestedPruningEvent, getNotConsistencyPruningEvent, include, setNotConsistencyPruningEventMethods inherited from class org.jacop.constraints.Constraint
afc, arguments, cleanAfterFailure, decompose, getConsistencyPruningEvent, getGuideConstraint, getGuideValue, getGuideVariable, grounded, grounded, id, impose, imposeDecomposition, increaseWeight, intArrayToString, long2int, numberArgs, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGroundedMethods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, getDubletonsSkipSingletons, imposeDecomposition
-
Constructor Details
-
LinearFloat
@Deprecated public LinearFloat(Store store, FloatVar[] list, double[] weights, String rel, double sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.- 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.
-
LinearFloat
@Deprecated public LinearFloat(Store store, FloatVar[] list, double[] weights, String rel, FloatVar sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.- 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.
-
LinearFloat
@Deprecated public LinearFloat(Store store, List<? extends FloatVar> variables, List<Double> weights, String rel, double sum) Deprecated.LinearFloat constraint does not use Store parameter any longer.It constructs the constraint LinearFloat.- 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.
-
LinearFloat
- 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.
-
LinearFloat
- 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.
-
LinearFloat
public LinearFloat(List<? extends FloatVar> variables, List<Double> weights, String rel, double sum) It constructs the constraint LinearFloat.- 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
-
queueVariable
Description copied from class:ConstraintThis is a function called to indicate which variable in a scope of constraint has changed. It also indicates a store level at which the change has occurred.- Overrides:
queueVariablein classLinear- Parameters:
level- the level of the store at which the change has occurred.var- variable which has changed.
-
derivative
- Overrides:
derivativein classDecomposedConstraint<Constraint>
-