|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.integer.var.AbstractIntDomain
choco.integer.var.BitSetIntDomain
public class BitSetIntDomain
Nested Class Summary | |
---|---|
protected class |
BitSetIntDomain.DeltaIntDomainIterator
|
Nested classes/interfaces inherited from class choco.integer.var.AbstractIntDomain |
---|
AbstractIntDomain.IntDomainIterator |
Field Summary | |
---|---|
protected int |
capacity
the initial size of the domain (never increases) |
protected int[] |
chain
A chained list implementing two subsets of values: - the removed values waiting to be propagated - the removed values being propagated (each element points to the index of the enxt element) -1 for the last element |
protected StoredBitSet |
contents
A bit set indicating for each value whether it is present or not |
protected int |
firstIndexBeingPropagated
start of the chain for the values being propagated -1 for empty chains |
protected int |
firstIndexToBePropagated
start of the chain for the values waiting to be propagated -1 for empty chains |
protected int |
offset
The offset, that is the minimal value of the domain (stored at index 0). |
protected static java.util.Random |
random
A random generator for random value from the domain |
protected StoredInt |
size
Number of present values. |
Fields inherited from class choco.integer.var.AbstractIntDomain |
---|
currentInfPropagated, currentSupPropagated, logger, variable |
Fields inherited from class choco.AbstractEntity |
---|
hook, problem |
Constructor Summary | |
---|---|
BitSetIntDomain(IntDomainVarImpl v,
int[] sortedValues)
|
|
BitSetIntDomain(IntDomainVarImpl v,
int a,
int b)
Constructs a new domain for the specified variable and bounds. |
Method Summary | |
---|---|
void |
clearDeltaDomain()
cleans the data structure implementing the delta domain |
boolean |
contains(int x)
Checks if the value is present. |
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 |
IntIterator |
getDeltaIterator()
Returns an getIterator over the set of values that have been removed from the domain since the last propagation |
int |
getInf()
Returns the minimal present value. |
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. |
boolean |
getReleasedDeltaDomain()
checks whether the delta domain has indeed been released (ie: chechks that no domain updates are pending) |
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 |
isEnumerated()
|
java.lang.String |
pretty()
pretty printing of the object. |
boolean |
releaseDeltaDomain()
after an iteration over the delta domain, the delta domain is reopened again. |
boolean |
remove(int x)
Removes a value. |
void |
restrict(int x)
Removes all the value but the specified one. |
java.lang.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.integer.var.AbstractIntDomain |
---|
_instantiate, _removeVal, _updateInf, _updateSup, getIterator, instantiate, removeInterval, removeVal, updateInf, updateSup |
Methods inherited from class choco.AbstractEntity |
---|
getProblem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.Entity |
---|
getProblem |
Field Detail |
---|
protected static java.util.Random random
protected final int offset
protected StoredInt size
protected StoredBitSet contents
protected int capacity
protected int[] chain
protected int firstIndexToBePropagated
protected int firstIndexBeingPropagated
Constructor Detail |
---|
public BitSetIntDomain(IntDomainVarImpl v, int a, int b)
v
- The involved variable.a
- Minimal value.b
- Maximal value.public BitSetIntDomain(IntDomainVarImpl v, int[] sortedValues)
Method Detail |
---|
public int getInf()
public int getSup()
public int updateInf(int x)
x
- New bound value.public int updateSup(int x)
x
- New bound value.public boolean contains(int x)
x
- The value to check.public boolean remove(int x)
public void restrict(int x)
public int getSize()
public int getNextValue(int x)
x
public int getPrevValue(int x)
x
public boolean hasNextValue(int x)
public boolean hasPrevValue(int x)
public int getRandomValue()
public boolean isEnumerated()
public IntIterator getDeltaIterator()
IntDomain
public void freezeDeltaDomain()
freezeDeltaDomain
in interface IntDomain
freezeDeltaDomain
in class AbstractIntDomain
public boolean releaseDeltaDomain()
releaseDeltaDomain
in interface IntDomain
releaseDeltaDomain
in class AbstractIntDomain
public boolean getReleasedDeltaDomain()
IntDomain
getReleasedDeltaDomain
in interface IntDomain
getReleasedDeltaDomain
in class AbstractIntDomain
public void clearDeltaDomain()
clearDeltaDomain
in interface IntDomain
clearDeltaDomain
in class AbstractIntDomain
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String pretty()
Entity
pretty
in interface Entity
pretty
in class AbstractEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |