public class PropSumBool extends PropSum
Modifier and Type | Field and Description |
---|---|
protected IntVar |
sum
The resulting variable
|
b, I, l, maxI, o, pos, sumLB, sumUB
ACTIVE, constraint, DEFAULT_EXPL, model, operations, OUTPUT_DEFAULT_EXPL, priority, reactToFineEvt, state, 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.A mask is a bitwise OR operations over IEventType this can react on. |
protected PropSum |
opposite() |
protected void |
prepare()
Prepare the propagation: compute sumLB, sumUB and I
|
String |
toString() |
check, computePriority, explain, explainGlobal, filter, filterOnNeq, isEntailed, nb, nop, propagate
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
protected 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)
Propagator
Propagator
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 PropSum
vIdx
- index of the variable within the propagatorREMOVE
and/or INSTANTIATE
and/or DECUPP
and/or INCLOW
protected void prepare()
PropSum
protected void filterOnEq() throws ContradictionException
PropSum
filterOnEq
in class PropSum
ContradictionException
- if contradiction is detectedprotected void filterOnLeq() throws ContradictionException
PropSum
filterOnLeq
in class PropSum
ContradictionException
- if contradiction is detectedprotected void filterOnGeq() throws ContradictionException
PropSum
filterOnGeq
in class PropSum
ContradictionException
- if contradiction is detectedCopyright © 2018. All rights reserved.