|
||||||||||
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.BooleanDomain
public final class BooleanDomain
Field Summary | |
---|---|
protected BooleanDomainIterator |
_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 | |
---|---|
BooleanDomain(IntDomainVarImpl v,
IEnvironment environment,
PropagationEngine propagationEngine)
Constructs a new domain for the specified variable and bounds. |
Method Summary | |
---|---|
protected boolean |
_instantiate(int x,
SConstraint cause)
Instantiating a variable to an search value. |
protected boolean |
_removeVal(int x,
SConstraint cause)
Removing a value from the domain of a variable. |
protected boolean |
_updateInf(int x,
SConstraint cause)
Improving the lower bound. |
protected boolean |
_updateSup(int x,
SConstraint cause)
Improving the upper bound. |
boolean |
contains(int x)
Checks if the value is present. |
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 |
getOffset()
|
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. |
int |
getValueIfInst()
This method is not relevant if the variable is not instantiated. |
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 |
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 |
isBoolean()
Is it a 0/1 domain ? |
boolean |
isEnumerated()
|
boolean |
isInstantiated()
|
String |
pretty()
pretty printing of the object. |
boolean |
remove(int x)
Removes a value. |
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. |
void |
restrict(int x)
Removes all the value but the specified one. |
String |
toString()
|
int |
updateInf(int x)
Sets a new minimal value. |
boolean |
updateInf(int x,
SConstraint cause,
boolean forceAwake)
Internal var: update on the variable lower bound caused by its i-th constraint. |
int |
updateSup(int x)
Sets a new maximal value. |
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 choco.cp.solver.variables.integer.AbstractIntDomain |
---|
clearDeltaDomain, copyDelta, fastNextValue, fastPrevValue, freezeDeltaDomain, getDeltaIterator, getReleasedDeltaDomain, releaseDeltaDomain, removeInterval |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected BooleanDomainIterator _iterator
Constructor Detail |
---|
public BooleanDomain(IntDomainVarImpl v, IEnvironment environment, PropagationEngine propagationEngine)
v
- The involved variable.environment
- propagationEngine
- Method Detail |
---|
public final int getValueIfInst()
public final boolean isInstantiated()
public final int getInf()
public final int getSup()
public int updateInf(int x)
x
- New bound value.public int updateSup(int x)
x
- New bound value.public final boolean contains(int x)
x
- The value to check.public boolean remove(int x)
public final void restrict(int x)
public final int getSize()
public DisposableIntIterator getIterator()
IntDomain
public final int getNextValue(int x)
x
public final int getPrevValue(int x)
x
public final boolean hasNextValue(int x)
public final boolean hasPrevValue(int x)
public final int getRandomValue()
public boolean isEnumerated()
public boolean isBoolean()
IntDomain
public String toString()
toString
in class AbstractIntDomain
public String pretty()
IPretty
public boolean updateSup(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
updateSup
in class AbstractIntDomain
x
- The new upper boundcause
- forceAwake
-
ContradictionException
- contradiction exceptionpublic boolean updateInf(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
updateInf
in class AbstractIntDomain
x
- The new lower bound.cause
- forceAwake
-
ContradictionException
- contradiction exceptionpublic final boolean removeVal(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
removeVal
in class AbstractIntDomain
x
- The removed valuecause
- forceAwake
-
ContradictionException
- contradiction exceptionpublic final boolean instantiate(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
instantiate
in class AbstractIntDomain
x
- the new upper boundcause
- forceAwake
-
ContradictionException
- contradiction exceptionprotected final boolean _instantiate(int x, SConstraint cause) throws ContradictionException
x
- the new instantiate valuecause
-
ContradictionException
- contradiction exceptionprotected final boolean _updateInf(int x, SConstraint cause) throws ContradictionException
x
- the new lower boundcause
-
ContradictionException
- contradiction exceptionprotected final boolean _updateSup(int x, SConstraint cause) throws ContradictionException
x
- the new upper boundcause
-
ContradictionException
- contradiction exceptionprotected final boolean _removeVal(int x, SConstraint cause) throws ContradictionException
x
- the value to removecause
-
ContradictionException
- contradiction excpetionpublic final int getOffset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |