|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntDomainVar
An interface for all implementations of search valued domain variables
Field Summary | |
---|---|
static int |
BOUNDS
Public user API: static constants associated to the encoding of the variable domain these constants are passed as parameters to the constructor of IntVars BOUNDS = an interval (keeping the lower and upper bounds) |
static int |
LIST
Public user API: static constants associated to the encoding of the variable domain these constants are passed as parameters to the constructor of IntVars LIST = a chained list of values |
Method Summary | |
---|---|
boolean |
canBeEqualTo(IntDomainVar x)
Public user API: Domains : testing whether two variables have intersecting domains. |
boolean |
canBeInstantiatedIn(int[] sortedValList,
int nVals)
Public user API: Domains : testing whether one value among a list is present in the domain. |
boolean |
canBeInstantiatedTo(int x)
Public user API: Domains : testing whether a value is in the domain. |
IntDomain |
getDomain()
Public user API: Domains : returns the object responsible for storing the enumeration of values in the domain |
int |
getDomainSize()
Public user API: Domains : retrieves the number of values in the domain. |
int |
getInf()
Returns the lower bound of the variable domain (e.g. the smallest value that the variable can be assigned). |
int |
getNextDomainValue(int i)
Public user API: Domains : retrieves the value immediately (but strictly) after i in the domain |
int |
getPrevDomainValue(int i)
Public user API: Domains : retrieves the value immediately (but strictly) before i in the domain. |
AbstractProblem |
getProblem()
Public user API: Util : retrieves the problem to which the variable belongs. |
int |
getRandomDomainValue()
Public user API: Domains : retrieves a value drawn at random (uniform distribution) from the domain. |
int |
getSup()
Returns the upper bound of the variable domain (e.g. the greatest value that the variable can be assigned). |
int |
getVal()
Returns the value of the variable if instantiated. |
int |
getValue()
Deprecated. replaced by getVal |
boolean |
hasEnumeratedDomain()
Public user API: Domains : whether an enumeration of values (in addition to the enclosing interval) is stored |
boolean |
instantiate(int x,
int idx)
Propagation events instantiating a variable (ie: removing all other values from the domain) |
boolean |
isInstantiatedTo(int x)
Public user API: Domains : testing whether the value of an instantiated variable is equal to a specific value. |
boolean |
removeInterval(int a,
int b,
int idx)
Propagation events updating the domain of a variable (by removing an interval, ie, a sequence of consecutive values) |
boolean |
removeVal(int x,
int idx)
Propagation events updating the domain of a variable (by removing a value) |
void |
remVal(int x)
Public user API: Propagation events removing a value from the domain of a variable. |
void |
setInf(int x)
Public user API: Propagation events updating the lower bound of a variable (ie: removing all value strictly below the new lower bound from the domain). |
void |
setMax(int x)
Deprecated. replaced by setMax |
void |
setMin(int x)
Deprecated. replaced by setInf |
void |
setSup(int x)
Public user API: Propagation events updating the upper bound of a variable (ie: removing all value strictly above the new upper bound from the domain). |
void |
setVal(int x)
Public user API: Propagation events assigning a value to a variable (ie: removing all other values from its domain). |
boolean |
updateInf(int x,
int idx)
Propagation events updating the lower bound of a variable (ie: removing all value strictly below the new lower bound from the domain). |
boolean |
updateSup(int x,
int idx)
Propagation events updating the upper bound of a variable (ie: removing all value strictly above the new upper bound from the domain). |
void |
wipeOut()
Public user API: Propagation events wiping out the domain of the variable (removing all values) and throwing a contradiction |
Methods inherited from interface choco.Var |
---|
addConstraint, fail, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getNbConstraints, getVarIndex, isInstantiated |
Methods inherited from interface choco.Entity |
---|
pretty |
Field Detail |
---|
static final int LIST
static final int BOUNDS
Method Detail |
---|
void setVal(int x) throws ContradictionException
x
- the value that is assigned to the variable
ContradictionException
void remVal(int x) throws ContradictionException
x
- the removed value
ContradictionException
void setInf(int x) throws ContradictionException
x
- the new lower bound
ContradictionException
void setMin(int x) throws ContradictionException
ContradictionException
void setSup(int x) throws ContradictionException
x
- the new upper bound
ContradictionException
void setMax(int x) throws ContradictionException
ContradictionException
void wipeOut() throws ContradictionException
ContradictionException
boolean hasEnumeratedDomain()
IntDomain getDomain()
boolean isInstantiatedTo(int x)
boolean canBeInstantiatedTo(int x)
x
- the tested valueboolean canBeEqualTo(IntDomainVar x)
x
- the other variableboolean canBeInstantiatedIn(int[] sortedValList, int nVals)
sortedValList
- the list of values. Must be sorted in increasing order.nVals
- the size of the list of valuesint getRandomDomainValue()
int getNextDomainValue(int i)
i
- the pivot value. May or may not be in the domainint getPrevDomainValue(int i)
i
- the pivot value. May or may not be in the domainint getDomainSize()
AbstractProblem getProblem()
getProblem
in interface Entity
int getInf()
int getSup()
int getVal()
int getValue()
boolean updateInf(int x, int idx) throws ContradictionException
x
- a lower bound of the domain (the new one, if better than the one currently stored)idx
- the index of the constraint that generated the var
ContradictionException
boolean updateSup(int x, int idx) throws ContradictionException
x
- an upper bound of the domain (the new one, if better than the one currently stored)idx
- the index of the constraint that generated the var
ContradictionException
boolean removeVal(int x, int idx) throws ContradictionException
x
- the value that is not in the domainidx
- the index of the constraint that generated the var
ContradictionException
boolean removeInterval(int a, int b, int idx) throws ContradictionException
a
- the lower bound of the forbidden intervalb
- the upper bound of the forbidden intervalidx
- the index of the constraint that generated the var
ContradictionException
boolean instantiate(int x, int idx) throws ContradictionException
x
- the value of the variableidx
- the index of the constraint that generated the var
ContradictionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |