Class PropScalar
- java.lang.Object
-
- org.chocosolver.solver.constraints.Propagator<IntVar>
-
- org.chocosolver.solver.constraints.nary.sum.PropSum
-
- org.chocosolver.solver.constraints.nary.sum.PropScalar
-
- All Implemented Interfaces:
Comparable<Propagator>,ICause,Identity
public class PropScalar extends PropSum
A propagator for SUM(x_i*c_i) = b
Based on "Bounds Consistency Techniques for Long Linear Constraint" W. Harvey and J. Schimpf- Since:
- 18/03/11
- Author:
- Charles Prud'homme
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.constraints.nary.sum.PropSum
b, I, l, maxI, o, pos, sumLB, sumUB
-
Fields inherited from class org.chocosolver.solver.constraints.Propagator
constraint, model, priority, reactToFineEvt, vars
-
-
Constructor Summary
Constructors Constructor Description PropScalar(IntVar[] variables, int[] coeffs, int pos, Operator o, int b)Create a scalar product: SUM(x_i*c_i) o b Variables and coefficients are excepted to be ordered wrt to coefficients: first positive ones then negative ones.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfilterOnEq()Apply filtering when operator is EQprotected voidfilterOnGeq()Apply filtering when operator is GEprotected voidfilterOnLeq()Apply filtering when operator is LEprotected voidfilterOnNeq()Apply filtering when operator is NEESatisEntailed()Check wetherthisis entailed according to the current state of its internal structure.protected PropSumopposite()protected voidprepare()Prepare the propagation: compute sumLB, sumUB and IStringtoString()-
Methods inherited from class org.chocosolver.solver.constraints.nary.sum.PropSum
check, computePriority, filter, getPropagationConditions, nb, nop, propagate, why
-
Methods inherited from class org.chocosolver.solver.constraints.Propagator
addVariable, arity, compareTo, doFinePropagation, doFlush, doSchedule, doScheduleEvent, dynPriority, equals, fails, forcePropagate, forcePropagationOnBacktrack, getConstraint, getId, getModel, getNbVars, getPosition, getPriority, getVar, getVars, getVIndice, getVIndices, hashCode, isActive, isCompletelyInstantiated, isPassive, isReifiedAndSilent, isStateLess, linkVariables, propagate, reactToFineEvent, setActive, setPassive, setPosition, setReifiedSilent, setReifiedTrue, setVIndices, unlinkVariables, unschedule
-
-
-
-
Constructor Detail
-
PropScalar
public PropScalar(IntVar[] variables, int[] coeffs, int pos, Operator o, int b)
Create a scalar product: SUM(x_i*c_i) o b Variables and coefficients are excepted to be ordered wrt to coefficients: first positive ones then negative ones.- Parameters:
variables- list of integer variablescoeffs- list of coefficientspos- position of the last positive coefficiento- operatorb- bound to respect.
-
-
Method Detail
-
prepare
protected void prepare()
Description copied from class:PropSumPrepare the propagation: compute sumLB, sumUB and I
-
filterOnEq
protected void filterOnEq() throws ContradictionExceptionDescription copied from class:PropSumApply filtering when operator is EQ- Overrides:
filterOnEqin classPropSum- Throws:
ContradictionException- if contradiction is detected
-
filterOnLeq
protected void filterOnLeq() throws ContradictionExceptionDescription copied from class:PropSumApply filtering when operator is LE- Overrides:
filterOnLeqin classPropSum- Throws:
ContradictionException- if contradiction is detected
-
filterOnGeq
protected void filterOnGeq() throws ContradictionExceptionDescription copied from class:PropSumApply filtering when operator is GE- Overrides:
filterOnGeqin classPropSum- Throws:
ContradictionException- if contradiction is detected
-
filterOnNeq
protected void filterOnNeq() throws ContradictionExceptionDescription copied from class:PropSumApply filtering when operator is NE- Overrides:
filterOnNeqin classPropSum- Throws:
ContradictionException- if contradiction is detected
-
isEntailed
public ESat isEntailed()
Description copied from class:PropagatorCheck wetherthisis entailed according to the current state of its internal structure. At least, should check the satisfaction ofthis(when all is instantiated).- Overrides:
isEntailedin classPropSum- Returns:
- ESat.TRUE if entailed, ESat.FALSE if not entailed, ESat.UNDEFINED if unknown
-
-