public abstract class AbstractPropDistanceXYZ extends Propagator<IntVar>
| Modifier and Type | Field and Description |
|---|---|
static int |
X |
static int |
Y |
static int |
Z |
constraint, model, priority, reactToFineEvt, vars| Constructor and Description |
|---|
AbstractPropDistanceXYZ(IntVar[] vars)
Enforces |X - Y| op Z
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
filterFromXYtoLBZ(int delta)
Update lower bound of Z if X !
|
boolean |
filterFromXYtoUBZ(int delta)
update upper bound of Z as max(|Y.sup - X.inf|, |Y.inf - X.sup|) - delta
|
protected abstract boolean |
filterFromXYtoZ() |
protected abstract boolean |
filterFromXZToY() |
protected abstract boolean |
filterFromYZToX() |
boolean |
filterGreaterFromIZToJ(int i,
int j,
int delta)
update bounds of X (resp.
|
boolean |
filterLowerFromIZToJ(int i,
int j,
int delta)
update bounds of X (resp.
|
protected abstract String |
getOperator() |
int |
getPropagationConditions(int vIdx)
Returns the specific mask indicating the variable events on which this
Propagator object can react. |
ESat |
isEntailed()
Check wether
this is entailed according to the current state of its internal structure. |
protected abstract boolean |
isEntailed(int distance,
int value) |
void |
propagate() |
void |
propagate(int evtmask)
Call the main filtering algorithm to apply to the
Domain of the Variable objects. |
void |
propagate(int idxVarInProp,
int mask)
Incremental filtering algorithm defined within the
Propagator, called whenever the variable
of index idxVarInProp has changed. |
String |
toString() |
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, reactToFineEvent, setActive, setPassive, setPosition, setReifiedSilent, setReifiedTrue, setVIndices, unlinkVariables, unschedule, whypublic static final int X
public static final int Y
public static final int Z
public AbstractPropDistanceXYZ(IntVar[] vars)
vars - variablepublic 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 Propagator<IntVar>vIdx - index of the variable within the propagatorREMOVE and/or INSTANTIATE
and/or DECUPP and/or INCLOWpublic final void propagate()
throws ContradictionException
ContradictionExceptionpublic void propagate(int evtmask)
throws ContradictionException
PropagatorDomain of the Variable objects.
It considers the current state of this objects to remove some values from domains and/or instantiate some variables.
Calling this method is done from 2 (and only 2) steps:
propagate in class Propagator<IntVar>evtmask - type of propagation event this must consider.ContradictionException - when a contradiction occurs, like domain wipe out or other incoherencies.public void propagate(int idxVarInProp,
int mask)
throws ContradictionException
PropagatorPropagator, called whenever the variable
of index idxVarInProp has changed. This method calls a CUSTOM_PROPAGATION (coarse-grained) by default.
This method should be overridden if the argument reactToFineEvt is set to true in the constructor.
Otherwise, it executes propagate(PropagatorEventType.CUSTOM_PROPAGATION.getStrengthenedMask());
propagate in class Propagator<IntVar>idxVarInProp - index of the variable var in thismask - type of eventContradictionException - if a contradiction occursprotected abstract boolean filterFromYZToX()
throws ContradictionException
ContradictionExceptionprotected abstract boolean filterFromXZToY()
throws ContradictionException
ContradictionExceptionprotected abstract boolean filterFromXYtoZ()
throws ContradictionException
ContradictionExceptionpublic boolean filterFromXYtoLBZ(int delta)
throws ContradictionException
true if the domain of Z has changedContradictionExceptionpublic boolean filterFromXYtoUBZ(int delta)
throws ContradictionException
true if the domain of Z has changedContradictionExceptionpublic boolean filterLowerFromIZToJ(int i,
int j,
int delta)
throws ContradictionException
ContradictionExceptionpublic boolean filterGreaterFromIZToJ(int i,
int j,
int delta)
throws ContradictionException
ContradictionExceptionprotected abstract boolean isEntailed(int distance,
int value)
protected abstract String getOperator()
public ESat isEntailed()
Propagatorthis is entailed according to the current state of its internal structure.
At least, should check the satisfaction of this (when all is instantiated).isEntailed in class Propagator<IntVar>public String toString()
toString in class Propagator<IntVar>Copyright © 2018. All rights reserved.