|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.solver.variables.integer.AbstractIntDomain
choco.cp.solver.variables.integer.BitSetIntDomain
public final class BitSetIntDomain
Field Summary | |
---|---|
protected DisposableIntIterator |
_cachedDeltaIntDomainIterator
|
protected BitSetIntDomainIterator |
_iterator
|
Fields inherited from class choco.cp.solver.variables.integer.AbstractIntDomain |
---|
currentInfPropagated, currentSupPropagated |
Fields inherited from interface choco.kernel.solver.variables.integer.IntDomain |
---|
LOGGER |
Constructor Summary | |
---|---|
BitSetIntDomain(IntDomainVarImpl v,
int[] sortedValues,
IEnvironment environment,
PropagationEngine propagationEngine)
|
|
BitSetIntDomain(IntDomainVarImpl v,
int a,
int b,
IEnvironment environment,
PropagationEngine propagationEngine)
Constructs a new domain for the specified variable and bounds. |
Method Summary | |
---|---|
boolean |
contains(int x)
Checks if the value is present. |
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. |
IStateBitSet |
getContent()
|
int |
getInf()
Returns the minimal present value. |
DisposableIntIterator |
getIterator()
Retrieve an getIterator for traversing the sequence of values contained in the domain |
int |
getNextValue(int x)
Returns the value following x |
int |
getPrevValue(int x)
Returns the value preceding x |
int |
getRandomValue()
Returns a value randomly choosed in the domain. |
int |
getSize()
Returns the current size of the domain. |
int |
getSup()
Returns the maximal present value. |
boolean |
hasNextValue(int x)
Checks if the value has a following value. |
boolean |
hasPrevValue(int x)
Checks if the value has a preceding value. |
boolean |
isBoolean()
Is it a 0/1 domain ? |
boolean |
isEnumerated()
|
String |
pretty()
pretty printing of the object. |
boolean |
remove(int x)
Removes a value. |
void |
restrict(int x)
Removes all the value but the specified one. |
String |
toString()
|
int |
updateInf(int x)
Sets a new minimal value. |
int |
updateSup(int x)
Sets a new maximal value. |
Methods inherited from class choco.cp.solver.variables.integer.AbstractIntDomain |
---|
clearDeltaDomain, copyDelta, fastPrevValue, freezeDeltaDomain, getDeltaIterator, getReleasedDeltaDomain, instantiate, releaseDeltaDomain, removeInterval, removeVal, updateInf, updateSup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected BitSetIntDomainIterator _iterator
protected DisposableIntIterator _cachedDeltaIntDomainIterator
Constructor Detail |
---|
public BitSetIntDomain(IntDomainVarImpl v, int a, int b, IEnvironment environment, PropagationEngine propagationEngine)
v
- The involved variable.a
- Minimal value.b
- Maximal value.environment
- propagationEngine
- public BitSetIntDomain(IntDomainVarImpl v, int[] sortedValues, IEnvironment environment, PropagationEngine propagationEngine)
Method Detail |
---|
public IStateBitSet getContent()
getContent
in interface IBitSetIntDomain
public int getInf()
getInf
in interface IntDomain
public int getSup()
getSup
in interface IntDomain
public int updateInf(int x)
updateInf
in interface IntDomain
x
- New bound value.public int updateSup(int x)
updateSup
in interface IntDomain
x
- New bound value.public boolean contains(int x)
contains
in interface IntDomain
x
- The value to check.public boolean remove(int x)
remove
in interface IntDomain
public void restrict(int x)
restrict
in interface IntDomain
public int getSize()
getSize
in interface IntDomain
public DisposableIntIterator getIterator()
IntDomain
getIterator
in interface IntDomain
public final int getNextValue(int x)
x
getNextValue
in interface IntDomain
public final 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
fastNextValue
in class AbstractIntDomain
public int getPrevValue(int x)
x
getPrevValue
in interface IntDomain
public boolean hasNextValue(int x)
hasNextValue
in interface IntDomain
public boolean hasPrevValue(int x)
hasPrevValue
in interface IntDomain
public int getRandomValue()
getRandomValue
in interface IntDomain
public boolean isEnumerated()
isEnumerated
in interface IntDomain
public boolean isBoolean()
IntDomain
isBoolean
in interface IntDomain
public String toString()
toString
in class AbstractIntDomain
public String pretty()
IPretty
pretty
in interface IPretty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |