|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.solver.variables.integer.AbstractIntDomain
public abstract class AbstractIntDomain
History: 2007-12-07 : FR_1873619 CPRU: DomOverDeg+DomOverWDeg
Field Summary | |
---|---|
protected int |
currentInfPropagated
for the delta domain: current value of the inf (domain lower bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase) |
protected int |
currentSupPropagated
for the delta domain: current value of the sup (domain upper bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase) |
Fields inherited from interface choco.kernel.solver.variables.integer.IntDomain |
---|
LOGGER |
Constructor Summary | |
---|---|
protected |
AbstractIntDomain(IntDomainVar aVariable,
PropagationEngine propagationEngine)
|
Method Summary | |
---|---|
void |
clearDeltaDomain()
cleans the data structure implementing the delta domain |
IDeltaDomain |
copyDelta()
|
int |
fastNextValue(int x)
Accessing the smallest value stored in the domain and strictly greater than x, assuming x is greater or equal to the lower bound. |
int |
fastPrevValue(int x)
Accessing the largest value stored in the domain and strictly smaller than x, assuming x is less or equal to the upper bound. |
void |
freezeDeltaDomain()
The delta domain container is "frozen" (it can no longer accept new value removals) so that this set of values can be iterated as such |
DisposableIntIterator |
getDeltaIterator()
Returns an getIterator over the set of values that have been removed from the domain since the last propagation |
boolean |
getReleasedDeltaDomain()
checks whether the delta domain has indeed been released (ie: chechks that no domain updates are pending) |
boolean |
instantiate(int x,
SConstraint cause,
boolean forceAwake)
Internal var: instantiation of the variable caused by its i-th constraint Returns a boolean indicating whether the call indeed added new information. |
boolean |
releaseDeltaDomain()
release the delta domain |
boolean |
removeInterval(int a,
int b,
SConstraint cause,
boolean forceAwake)
Internal var: remove an interval (a sequence of consecutive values) from the domain of a variable caused by its i-th constraint. |
boolean |
removeVal(int x,
SConstraint cause,
boolean forceAwake)
Internal var: update (value removal) on the domain of a variable caused by its i-th constraint. |
String |
toString()
|
boolean |
updateInf(int x,
SConstraint cause,
boolean forceAwake)
Internal var: update on the variable lower bound caused by its i-th constraint. |
boolean |
updateSup(int x,
SConstraint cause,
boolean forceAwake)
Internal var: update on the variable upper bound caused by its i-th constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.kernel.solver.variables.integer.IntDomain |
---|
contains, getInf, getIterator, getNextValue, getPrevValue, getRandomValue, getSize, getSup, hasNextValue, hasPrevValue, isBoolean, isEnumerated, remove, restrict, updateInf, updateSup |
Methods inherited from interface choco.IPretty |
---|
pretty |
Field Detail |
---|
protected int currentInfPropagated
protected int currentSupPropagated
Constructor Detail |
---|
protected AbstractIntDomain(IntDomainVar aVariable, PropagationEngine propagationEngine)
Method Detail |
---|
public int fastNextValue(int x)
IntDomain
IntDomain
,
use the following loop:
int ub = dom.getSup(); for (int val = dom.getInf(); val <= ub; val = dom.fastNextValue(val)) { // operate on value 'val' here }
fastNextValue
in interface IntDomain
public int fastPrevValue(int x)
IntDomain
IntDomain
,
use the following loop:
int lb = dom.getInf(); for (int val = dom.getSup(); val >= lb; val = dom.fastPrevValue(val)) { // operate on value 'val' here }
fastPrevValue
in interface IntDomain
public boolean updateSup(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
x
- The new upper boundcause
- constraint causing the modificationforceAwake
-
ContradictionException
- contradiction exceptionpublic boolean updateInf(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
x
- The new lower bound.cause
- constraint causing the modificationforceAwake
-
ContradictionException
- contradiction exceptionpublic boolean removeVal(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
x
- The removed valuecause
- constraint causing the modificationforceAwake
-
ContradictionException
- contradiction exceptionpublic boolean removeInterval(int a, int b, SConstraint cause, boolean forceAwake) throws ContradictionException
a
- the first removed valueb
- the last removed valuecause
- constraint causing the modificationforceAwake
-
ContradictionException
- contradiction exceptionpublic boolean instantiate(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
x
- the new upper boundcause
- constraint causing the modificationforceAwake
-
ContradictionException
- contradiction exceptionpublic String toString()
toString
in class Object
public final DisposableIntIterator getDeltaIterator()
IntDomain
getDeltaIterator
in interface IntDomain
public void freezeDeltaDomain()
IntDomain
freezeDeltaDomain
in interface IntDomain
public boolean releaseDeltaDomain()
releaseDeltaDomain
in interface IntDomain
public final void clearDeltaDomain()
IntDomain
clearDeltaDomain
in interface IntDomain
public boolean getReleasedDeltaDomain()
getReleasedDeltaDomain
in interface IntDomain
public final IDeltaDomain copyDelta()
copyDelta
in interface IntDomain
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |