- 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
ACTIVE, constraint, DEFAULT_EXPL, model, operations, OUTPUT_DEFAULT_EXPL, priority, reactToFineEvt, state, 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 void
explainGlobal(ExplanationForSignedClause explanation, ValueSortedMap<IntVar> front, Implications ig, int F, int E)
protected void
filterOnEq()
Apply filtering when operator is EQprotected void
filterOnGeq()
Apply filtering when operator is GEprotected void
filterOnLeq()
Apply filtering when operator is LEprotected void
filterOnNeq()
Apply filtering when operator is NEESat
isEntailed()
Check wetherthis
is entailed according to the current state of its internal structure.protected PropSum
opposite()
protected void
prepare()
Prepare the propagation: compute sumLB, sumUB and IString
toString()
-
Methods inherited from class org.chocosolver.solver.constraints.nary.sum.PropSum
check, computePriority, explain, filter, getPropagationConditions, nb, nop, propagate
-
Methods inherited from class org.chocosolver.solver.constraints.Propagator
addVariable, arity, compareTo, defaultExplain, doFinePropagation, doFlush, doSchedule, doScheduleEvent, dynPriority, equals, fails, forcePropagate, forcePropagationOnBacktrack, forEachIntVar, getConstraint, getId, getModel, getNbVars, getPosition, getPriority, getVar, getVars, getVIndice, getVIndices, hashCode, isActive, isCompletelyInstantiated, isPassive, isReified, isReifiedAndSilent, isScheduled, isStateLess, linkVariables, propagate, reactToFineEvent, reifiedWith, setActive, setActive0, 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:PropSum
Prepare the propagation: compute sumLB, sumUB and I
-
filterOnEq
protected void filterOnEq() throws ContradictionException
Description copied from class:PropSum
Apply filtering when operator is EQ- Overrides:
filterOnEq
in classPropSum
- Throws:
ContradictionException
- if contradiction is detected
-
filterOnLeq
protected void filterOnLeq() throws ContradictionException
Description copied from class:PropSum
Apply filtering when operator is LE- Overrides:
filterOnLeq
in classPropSum
- Throws:
ContradictionException
- if contradiction is detected
-
filterOnGeq
protected void filterOnGeq() throws ContradictionException
Description copied from class:PropSum
Apply filtering when operator is GE- Overrides:
filterOnGeq
in classPropSum
- Throws:
ContradictionException
- if contradiction is detected
-
filterOnNeq
protected void filterOnNeq() throws ContradictionException
Description copied from class:PropSum
Apply filtering when operator is NE- Overrides:
filterOnNeq
in classPropSum
- Throws:
ContradictionException
- if contradiction is detected
-
isEntailed
public ESat isEntailed()
Description copied from class:Propagator
Check wetherthis
is entailed according to the current state of its internal structure. At least, should check the satisfaction ofthis
(when all is instantiated).- Overrides:
isEntailed
in classPropSum
- Returns:
- ESat.TRUE if entailed, ESat.FALSE if not entailed, ESat.UNDEFINED if unknown
-
explainGlobal
protected void explainGlobal(ExplanationForSignedClause explanation, ValueSortedMap<IntVar> front, Implications ig, int F, int E)
- Overrides:
explainGlobal
in classPropSum
-
-