public class PropSumBool extends PropSum
| Modifier and Type | Field and Description |
|---|---|
protected IntVar |
sum
The resulting variable
|
b, I, l, maxI, o, pos, sumLB, sumUBconstraint, model, priority, reactToFineEvt, vars| Modifier | Constructor and Description |
|---|---|
|
PropSumBool(BoolVar[] variables,
int pos,
Operator o,
IntVar sum,
int b)
Creates a sum propagator: SUM(x_i) Op sum + b, where x_i are boolean variables.
|
protected |
PropSumBool(BoolVar[] variables,
int pos,
Operator o,
IntVar sum,
int b,
boolean reactOnFineEvent)
Creates a sum propagator: SUM(x_i) Op sum + b, where x_i are boolean variables.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
filterOnEq()
Apply filtering when operator is EQ
|
protected void |
filterOnGeq()
Apply filtering when operator is GE
|
protected void |
filterOnLeq()
Apply filtering when operator is LE
|
int |
getPropagationConditions(int vIdx)
Returns the specific mask indicating the variable events on which this
Propagator object can react. |
protected PropSum |
opposite() |
protected void |
prepare()
Prepare the propagation: compute sumLB, sumUB and I
|
String |
toString() |
check, computePriority, filter, filterOnNeq, isEntailed, nb, nop, propagate, whyaddVariable, 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, unscheduleprotected final IntVar sum
protected PropSumBool(BoolVar[] variables, int pos, Operator o, IntVar sum, int b, boolean reactOnFineEvent)
pos:
those before pos (included) are equal to 1,
the other ones are equal to -1.variables - list of boolean variablespos - position of the last positive (induced) coefficiento - operatorsum - resulting variableb - bound to respectreactOnFineEvent - set to true to react on fine eventspublic PropSumBool(BoolVar[] variables, int pos, Operator o, IntVar sum, int b)
pos:
those before pos (included) are equal to 1,
the other ones are equal to -1.variables - list of boolean variablespos - position of the last positive (induced) coefficiento - operatorsum - resulting variableb - bound to respectpublic int getPropagationConditions(int vIdx)
PropagatorPropagator object can react.IEventType this can react on.
For example, consider a propagator that can deduce filtering based on the lower bound of the integer variable X.
Then, for this variable, the mask should be equal to :
int mask = IntEventType.INCLOW.getMask() | IntEventType.INSTANTIATE.getMask();
or, in a more convenient way:
int mask = IntEvtType.combine(IntEventType.INCLOW,IntEventType.INSTANTIATE);
That indicates the following behavior:
IntEventType.VOID which states
that this propagator should not be aware of modifications applied to the variable in position vIdx.getPropagationConditions in class PropSumvIdx - index of the variable within the propagatorREMOVE and/or INSTANTIATE
and/or DECUPP and/or INCLOWprotected void prepare()
PropSumprotected void filterOnEq()
throws ContradictionException
PropSumfilterOnEq in class PropSumContradictionException - if contradiction is detectedprotected void filterOnLeq()
throws ContradictionException
PropSumfilterOnLeq in class PropSumContradictionException - if contradiction is detectedprotected void filterOnGeq()
throws ContradictionException
PropSumfilterOnGeq in class PropSumContradictionException - if contradiction is detectedCopyright © 2018. All rights reserved.