choco.kernel.solver.variables.integer
Interface IntDomainVar

All Superinterfaces:
IExtensionnable, IIndex, IntExp, IntVar, IPretty, Var
All Known Implementing Classes:
AbstractBijectiveVar, BooleanVarImpl, BoolVarNot, IntDomainVarAddCste, IntDomainVarImpl, IntDomainVarTimePosCste, ViewIntDomainVarImpl

public interface IntDomainVar
extends IntVar

An interface for all implementations of search valued domain variables


Field Summary
static int BINARYTREE
          Static constant to create integer variables domain implemented with a binary tree
static int BIPARTITELIST
          Static constant to create integer variables domain implemented with a bipartite list of elements
static int BITSET
          Public user API: static constants associated to the encoding of the variable domain these constants are passed as parameters to the constructor of IntVars BITSET = a chained list of values
static int BOOLEAN
          Static constant to create integer variables domain implemented with a boolean domain
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 LINKEDLIST
          Static constant to create integer variables domain implemented with linked list of values in the domain
static int ONE_VALUE
           
 
Fields inherited from interface choco.kernel.solver.variables.Var
LOGGER
 
Method Summary
 boolean canBeEqualTo(IntDomainVar x)
          Public user API: Domains : testing whether two variables have intersecting domains.
 boolean canBeInstantiatedTo(int x)
          Public user API: Domains : testing whether a value is in the domain.
 boolean fastCanBeInstantiatedTo(int x)
          Checks if a value is still in the domain assuming the value is in the initial bound of the domain
 int fastNextDomainValue(int i)
          retrieves the value immediately (but strictly) after i in the domain, assuming the value is greater or equal to the lower bound.
 int fastPrevDomainValue(int i)
          retrieves the value immediately (but strictly) before i in the domain, assuming the value is less or equal to the upper bound.
 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.
 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 getValue()
          Deprecated. replaced by getVal
 boolean hasBooleanDomain()
          Public user API: Domains : whether the domain is a 0/1 domain
 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)
          Deprecated. 
 boolean instantiate(int x, SConstraint cause, boolean forceAwake)
          Propagation events instantiating a variable (ie: removing all other values from the domain)
 boolean removeInterval(int a, int b, int idx)
          Deprecated. 
 boolean removeInterval(int a, int b, SConstraint cause, boolean forceAwake)
          Propagation events updating the domain of a variable (by removing an interval, ie, a sequence of consecutive values)
 boolean removeVal(int x, int idx)
          Deprecated. 
 boolean removeVal(int x, SConstraint cause, boolean forceAwake)
          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).
 boolean updateInf(int x, int idx)
          Deprecated. 
 boolean updateInf(int x, SConstraint cause, boolean forceAwake)
          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)
          Deprecated. 
 boolean updateSup(int x, SConstraint cause, boolean forceAwake)
          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.kernel.solver.variables.integer.IntVar
getVal, isInstantiatedTo, setVal
 
Methods inherited from interface choco.kernel.solver.variables.Var
addConstraint, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getName, getNbConstraints, getPriority, getVarIndex, isInstantiated
 
Methods inherited from interface choco.IPretty
pretty
 
Methods inherited from interface choco.kernel.common.IIndex
getIndex
 
Methods inherited from interface choco.IExtensionnable
addExtension, getExtension
 

Field Detail

BITSET

static final int BITSET
Public user API: static constants associated to the encoding of the variable domain these constants are passed as parameters to the constructor of IntVars BITSET = a chained list of values

See Also:
Constant Field Values

BOUNDS

static final 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)

See Also:
Constant Field Values

LINKEDLIST

static final int LINKEDLIST
Static constant to create integer variables domain implemented with linked list of values in the domain

See Also:
Constant Field Values

BINARYTREE

static final int BINARYTREE
Static constant to create integer variables domain implemented with a binary tree

See Also:
Constant Field Values

BIPARTITELIST

static final int BIPARTITELIST
Static constant to create integer variables domain implemented with a bipartite list of elements

See Also:
Constant Field Values

BOOLEAN

static final int BOOLEAN
Static constant to create integer variables domain implemented with a boolean domain

See Also:
Constant Field Values

ONE_VALUE

static final int ONE_VALUE
See Also:
Constant Field Values
Method Detail

remVal

void remVal(int x)
            throws ContradictionException
Public user API: Propagation events removing a value from the domain of a variable.

Parameters:
x - the removed value
Throws:
ContradictionException - contradiction exception

setInf

void setInf(int x)
            throws ContradictionException
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).

Parameters:
x - the new lower bound
Throws:
ContradictionException - contradiction exception

setMin

void setMin(int x)
            throws ContradictionException
Deprecated. replaced by setInf

Parameters:
x - the new inf value
Throws:
ContradictionException - contradiction exception

setSup

void setSup(int x)
            throws ContradictionException
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).

Parameters:
x - the new upper bound
Throws:
ContradictionException - contradiction exception

setMax

void setMax(int x)
            throws ContradictionException
Deprecated. replaced by setMax

Parameters:
x - the new max value
Throws:
ContradictionException - contradiction exception

wipeOut

void wipeOut()
             throws ContradictionException
Public user API: Propagation events wiping out the domain of the variable (removing all values) and throwing a contradiction

Throws:
ContradictionException - contradiction exception

hasEnumeratedDomain

boolean hasEnumeratedDomain()
Public user API: Domains : whether an enumeration of values (in addition to the enclosing interval) is stored

Returns:
wether an enumeration of values is stored

hasBooleanDomain

boolean hasBooleanDomain()
Public user API: Domains : whether the domain is a 0/1 domain

Returns:
wether the domain is a 0/1 domain

getDomain

IntDomain getDomain()
Public user API: Domains : returns the object responsible for storing the enumeration of values in the domain

Returns:
the objects responsible for storing the enumeration of values in the domain

canBeInstantiatedTo

boolean canBeInstantiatedTo(int x)
Public user API: Domains : testing whether a value is in the domain.

Parameters:
x - the tested value
Returns:
wether a value is in the domain

fastCanBeInstantiatedTo

boolean fastCanBeInstantiatedTo(int x)
Checks if a value is still in the domain assuming the value is in the initial bound of the domain


canBeEqualTo

boolean canBeEqualTo(IntDomainVar x)
Public user API: Domains : testing whether two variables have intersecting domains.

Parameters:
x - the other variable
Returns:
wether two variables have intersecting domains

getRandomDomainValue

int getRandomDomainValue()
Public user API: Domains : retrieves a value drawn at random (uniform distribution) from the domain.

Returns:
a value drawn at random from the domain

getNextDomainValue

int getNextDomainValue(int i)
Public user API: Domains : retrieves the value immediately (but strictly) after i in the domain

Parameters:
i - the pivot value. May or may not be in the domain
Returns:
the value immediatly after the domain

fastNextDomainValue

int fastNextDomainValue(int i)
retrieves the value immediately (but strictly) after i in the domain, assuming the value is greater or equal to the lower bound.


getPrevDomainValue

int getPrevDomainValue(int i)
Public user API: Domains : retrieves the value immediately (but strictly) before i in the domain.

Parameters:
i - the pivot value. May or may not be in the domain
Returns:
the value immediatly before the domain

fastPrevDomainValue

int fastPrevDomainValue(int i)
retrieves the value immediately (but strictly) before i in the domain, assuming the value is less or equal to the upper bound.


getDomainSize

int getDomainSize()
Public user API: Domains : retrieves the number of values in the domain.

Returns:
the number of values in the domain

getInf

int getInf()
Returns the lower bound of the variable domain (e.g. the smallest value that the variable can be assigned).

Returns:
the domain lower bound

getSup

int getSup()
Returns the upper bound of the variable domain (e.g. the greatest value that the variable can be assigned).

Returns:
the domain upper bound

getValue

int getValue()
Deprecated. replaced by getVal

Returns:
the value of the variable if known

updateInf

boolean updateInf(int x,
                  SConstraint cause,
                  boolean forceAwake)
                  throws ContradictionException
Propagation events updating the lower bound of a variable (ie: removing all value strictly below the new lower bound from the domain).

Parameters:
x - a lower bound of the domain (the new one, if better than the one currently stored)
cause - constraint that modified the x
forceAwake -
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException - contradiction exception

updateInf

@Deprecated
boolean updateInf(int x,
                             int idx)
                  throws ContradictionException
Deprecated. 

Throws:
ContradictionException

updateSup

boolean updateSup(int x,
                  SConstraint cause,
                  boolean forceAwake)
                  throws ContradictionException
Propagation events updating the upper bound of a variable (ie: removing all value strictly above the new upper bound from the domain).

Parameters:
x - an upper bound of the domain (the new one, if better than the one currently stored)
cause -
forceAwake -
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException - contradiction exception

updateSup

@Deprecated
boolean updateSup(int x,
                             int idx)
                  throws ContradictionException
Deprecated. 

Throws:
ContradictionException

removeVal

boolean removeVal(int x,
                  SConstraint cause,
                  boolean forceAwake)
                  throws ContradictionException
Propagation events updating the domain of a variable (by removing a value)

Parameters:
x - the value that is not in the domain
cause -
forceAwake -
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException - contradiction exception

removeVal

@Deprecated
boolean removeVal(int x,
                             int idx)
                  throws ContradictionException
Deprecated. 

Throws:
ContradictionException

removeInterval

boolean removeInterval(int a,
                       int b,
                       SConstraint cause,
                       boolean forceAwake)
                       throws ContradictionException
Propagation events updating the domain of a variable (by removing an interval, ie, a sequence of consecutive values)

Parameters:
a - the lower bound of the forbidden interval
b - the upper bound of the forbidden interval
cause -
forceAwake -
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException - contradiction exception

removeInterval

@Deprecated
boolean removeInterval(int a,
                                  int b,
                                  int idx)
                       throws ContradictionException
Deprecated. 

Throws:
ContradictionException

instantiate

boolean instantiate(int x,
                    SConstraint cause,
                    boolean forceAwake)
                    throws ContradictionException
Propagation events instantiating a variable (ie: removing all other values from the domain)

Parameters:
x - the value of the variable
cause -
forceAwake -
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException - contradiction exception

instantiate

@Deprecated
boolean instantiate(int x,
                               int idx)
                    throws ContradictionException
Deprecated. 

Throws:
ContradictionException


Copyright © 2012. All Rights Reserved.