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
public class LinearFloat extends Linear implements UsesQueueVariable
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.8
-
-
Field Summary
-
Fields inherited from class org.jacop.floats.constraints.linear.Linear
eq, ge, gt, le, list, lt, ne, relationType, sum, weights
-
Fields inherited from class org.jacop.constraints.PrimitiveConstraint
notConsistencyPruningEvents
-
Fields inherited from class org.jacop.constraints.Constraint
atomicExecution, consistencyPruningEvents, constraintScope, earlyTerminationOK, increaseWeight, numberId, scope, trace
-
Fields inherited from class org.jacop.constraints.DecomposedConstraint
queueIndex
-
-
Constructor Summary
Constructors Constructor Description LinearFloat(java.util.List<? extends FloatVar> variables, java.util.List<java.lang.Double> weights, java.lang.String rel, double sum)
It constructs the constraint LinearFloat.LinearFloat(Store store, java.util.List<? extends FloatVar> variables, java.util.List<java.lang.Double> weights, java.lang.String rel, double sum)
Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(Store store, FloatVar[] list, double[] weights, java.lang.String rel, double sum)
Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(Store store, FloatVar[] list, double[] weights, java.lang.String rel, FloatVar sum)
Deprecated.LinearFloat constraint does not use Store parameter any longer.LinearFloat(FloatVar[] list, double[] weights, java.lang.String rel, double sum)
LinearFloat(FloatVar[] list, double[] weights, java.lang.String rel, FloatVar sum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FloatVar
derivative(Store store, FloatVar f, java.util.Set<FloatVar> vars, FloatVar x)
void
queueVariable(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, toString
-
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, numberArgs, removeConstraint, requiresMonotonicity, setConsistencyPruningEvent, setConstraintScope, setScope, setScope, setScope, setScope, setScope, setWatchedVariableGrounded, supplyGuideFeedback, updateAFC, watchedVariableGrounded
-
Methods inherited from class org.jacop.constraints.DecomposedConstraint
auxiliaryVariables, checkInput, checkInput, checkInputForDuplication, checkInputForDuplicationSkipSingletons, checkInputForNullness, checkInputForNullness, checkInputForNullness, getDubletonsSkipSingletons, imposeDecomposition
-
-
-
-
Constructor Detail
-
LinearFloat
@Deprecated public LinearFloat(Store store, FloatVar[] list, double[] weights, java.lang.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, java.lang.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, java.util.List<? extends FloatVar> variables, java.util.List<java.lang.Double> weights, java.lang.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
public LinearFloat(FloatVar[] list, double[] weights, java.lang.String rel, double sum)
- 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
public LinearFloat(FloatVar[] list, double[] weights, java.lang.String rel, FloatVar sum)
- 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(java.util.List<? extends FloatVar> variables, java.util.List<java.lang.Double> weights, java.lang.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 Detail
-
queueVariable
public void queueVariable(int level, Var var)
Description copied from class:Constraint
This 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:
queueVariable
in classLinear
- Parameters:
level
- the level of the store at which the change has occurred.var
- variable which has changed.
-
derivative
public FloatVar derivative(Store store, FloatVar f, java.util.Set<FloatVar> vars, FloatVar x)
- Overrides:
derivative
in classDecomposedConstraint<Constraint>
-
-