- java.lang.Object
-
- org.chocosolver.solver.constraints.Propagator<IntVar>
-
- org.chocosolver.solver.constraints.ternary.PropDivXYZ
-
- All Implemented Interfaces:
java.lang.Comparable<Propagator<IntVar>>
,ICause
,Identity
public class PropDivXYZ extends Propagator<IntVar>
X/Y = Z A propagator for the constraint Z = X / Y where X, Y and Z are integer, possibly negative, variables The filtering algorithm both supports bounded and enumerated integer variables
-
-
Field Summary
-
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 PropDivXYZ(IntVar x, IntVar y, IntVar z)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ESat
isEntailed()
Check wetherthis
is entailed according to the current state of its internal structure.protected boolean
oppSign(IntVar a, IntVar b)
A take the opposite signs of Bvoid
propagate(int evtmask)
The main propagation method that filters according to the constraint defintionprotected boolean
sameSign(IntVar a, IntVar b)
A take the signs of B-
Methods inherited from class org.chocosolver.solver.constraints.Propagator
addVariable, arity, compareTo, defaultExplain, doFinePropagation, doFlush, doSchedule, doScheduleEvent, dynPriority, equals, explain, fails, fails, forcePropagate, forcePropagationOnBacktrack, forEachIntVar, getConstraint, getId, getModel, getNbVars, getPosition, getPriority, getPropagationConditions, getVar, getVars, getVIndice, getVIndices, hashCode, isActive, isCompletelyInstantiated, isPassive, isReified, isReifiedAndSilent, isScheduled, isStateLess, linkVariables, propagate, reactToFineEvent, reifiedWith, setActive, setActive0, setEnabled, setPassive, setPosition, setReifiedSilent, setReifiedTrue, setVIndices, toString, unlinkVariables, unschedule
-
-
-
-
Method Detail
-
propagate
public void propagate(int evtmask) throws ContradictionException
The main propagation method that filters according to the constraint defintion- Specified by:
propagate
in classPropagator<IntVar>
- Parameters:
evtmask
- is it the initial propagation or not?- Throws:
ContradictionException
- if failure occurs
-
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).- Specified by:
isEntailed
in classPropagator<IntVar>
- Returns:
- ESat.TRUE if entailed, ESat.FALSE if not entailed, ESat.UNDEFINED if unknown
-
sameSign
protected boolean sameSign(IntVar a, IntVar b) throws ContradictionException
A take the signs of B- Parameters:
a
- first varb
- second var- Throws:
ContradictionException
-
oppSign
protected boolean oppSign(IntVar a, IntVar b) throws ContradictionException
A take the opposite signs of B- Parameters:
a
- first varb
- second var- Throws:
ContradictionException
-
-