|
||||||||||
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.IntervalBTreeDomain
public final class IntervalBTreeDomain
Created by IntelliJ IDEA. User: julien Date: Apr 25, 2008 Time: 9:34:40 AM
A choco domain class represented by a binary tree of int interval
Field Summary | |
---|---|
protected IntDomainIterator |
_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 | |
---|---|
IntervalBTreeDomain(IntDomainVarImpl v,
int[] sortedValues,
IEnvironment environment,
PropagationEngine propagationEngine)
Construct a new domain represented by a Binary Tree of Interval |
|
IntervalBTreeDomain(IntDomainVarImpl v,
int a,
int b,
IEnvironment environment,
PropagationEngine propagationEngine)
Construct a new domain represented by a Binary Tree of Interval |
Method Summary | |
---|---|
boolean |
contains(int x)
Checks wether a value is in the domain |
int |
getInf()
Gets the lowest value of the domain |
DisposableIntIterator |
getIterator()
Retrieve an getIterator for traversing the sequence of values contained in the domain |
int |
getNextValue(int x)
gets the next value of x in this domain |
int |
getPrevValue(int x)
gets the previous value of x in this domain |
int |
getRandomValue()
Easy way to get a random value in the domain Definitely not selected through an uniform distribution TODO: Find a better way to select a value really at random |
int |
getSize()
Indicates the number of value in the domain |
int |
getSup()
Gets the greatest value of the domain |
boolean |
hasNextValue(int x)
Has this domain a value greater than the parameter TODO: getSup is to slow for that kind of operation |
boolean |
hasPrevValue(int x)
Has this domain a value lower than the parameter TODO: it is not efficient to call getInf |
boolean |
isBoolean()
Check if this domain is a 0-1 domain |
boolean |
isEnumerated()
Check wether this domain is Enumerated or not |
String |
pretty()
pretty print of the domain |
boolean |
remove(int x)
Removes a value from the domain |
void |
restrict(int x)
Restrict the domain to one value TODO: must existe a better way to remove all the other Node in the tree |
String |
toString()
|
int |
updateInf(int x)
Updates the inf bound of the domain to the given value TODO: Must exist a better way than removing all values until the new inf is reached |
int |
updateSup(int x)
Updates the sup of the domain to the given value TODO: Must exist a better way than removing all values (e.g. removing all the node but the one containing the sup) |
Methods inherited from class choco.cp.solver.variables.integer.AbstractIntDomain |
---|
clearDeltaDomain, copyDelta, fastNextValue, 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 IntDomainIterator _iterator
Constructor Detail |
---|
public IntervalBTreeDomain(IntDomainVarImpl v, int a, int b, IEnvironment environment, PropagationEngine propagationEngine)
v
- the associatede variablea
- the lower boundb
- the upper boundenvironment
- propagationEngine
- public IntervalBTreeDomain(IntDomainVarImpl v, int[] sortedValues, IEnvironment environment, PropagationEngine propagationEngine)
v
- the associatede variablesortedValues
- array of valuesenvironment
- propagationEngine
- Method Detail |
---|
public int getInf()
public int getSup()
public int updateInf(int x)
x
- integer value
public int updateSup(int x)
x
- integer value
public boolean contains(int x)
x
- the value to be checked
public boolean remove(int x)
x
- the value to be removed
public void restrict(int x)
x
- integer valuepublic int getSize()
public DisposableIntIterator getIterator()
IntDomain
public int getNextValue(int x)
x
- integer value
public int getPrevValue(int x)
x
- integer value
public boolean hasNextValue(int x)
x
- integer value
public boolean hasPrevValue(int x)
x
- integer value
public int getRandomValue()
public boolean isEnumerated()
public boolean isBoolean()
public String pretty()
public String toString()
toString
in class AbstractIntDomain
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |