|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.variables.AbstractVar
choco.cp.solver.variables.integer.AbstractBijectiveVar
choco.cp.solver.variables.integer.IntDomainVarAddCste
public class IntDomainVarAddCste
Declare a variable Y, based on a variable X and a constante c,
such as Y = X + c
Field Summary |
---|
Fields inherited from class choco.kernel.solver.variables.AbstractVar |
---|
constraints, event, extensions, name, propagationEngine |
Fields inherited from interface choco.kernel.solver.variables.integer.IntDomainVar |
---|
BINARYTREE, BIPARTITELIST, BITSET, BOOLEAN, BOUNDS, LINKEDLIST, ONE_VALUE |
Fields inherited from interface choco.kernel.solver.variables.Var |
---|
LOGGER |
Constructor Summary | |
---|---|
IntDomainVarAddCste(Solver solver,
String name,
IntDomainVar variable,
int constante)
Build a variable Y such as Y = X + c. |
Method Summary | |
---|---|
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 |
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 |
getVal()
Returns the value of the variable if instantiated. |
int |
getValue()
|
boolean |
instantiate(int x,
int idx)
|
boolean |
instantiate(int x,
SConstraint cause,
boolean forceAwake)
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. |
String |
pretty()
pretty printing of the object. |
boolean |
removeInterval(int a,
int b,
int idx)
|
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)
|
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. |
void |
setMin(int x)
Deprecated. |
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)
|
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)
|
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). |
Methods inherited from class choco.cp.solver.variables.integer.AbstractBijectiveVar |
---|
addConstraint, canBeEqualTo, eraseConstraint, fastNextDomainValue, fastPrevDomainValue, getConstraint, getConstraintsIterator, getConstraintVector, getDomain, getDomainSize, getEvent, getIndexVector, getNbConstraints, getVarIndex, hasBooleanDomain, hasEnumeratedDomain, isInstantiated, wipeOut |
Methods inherited from class choco.kernel.solver.variables.AbstractVar |
---|
addExtension, getAbstractVarExtensionNumber, getExtension, getIndex, getName, getPriority, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface choco.kernel.solver.variables.Var |
---|
getName, getPriority |
Methods inherited from interface choco.kernel.common.IIndex |
---|
getIndex |
Methods inherited from interface choco.IExtensionnable |
---|
addExtension, getExtension |
Constructor Detail |
---|
public IntDomainVarAddCste(Solver solver, String name, IntDomainVar variable, int constante)
solver
- The model this variable belongs toname
- The name of the variablevariable
- constraints stored specific structureMethod Detail |
---|
public void remVal(int x) throws ContradictionException
IntDomainVar
x
- the removed value
ContradictionException
- contradiction exceptionpublic void setInf(int x) throws ContradictionException
IntDomainVar
x
- the new lower bound
ContradictionException
- contradiction exception@Deprecated public void setMin(int x) throws ContradictionException
x
- the new inf value
ContradictionException
- contradiction exceptionpublic void setSup(int x) throws ContradictionException
IntDomainVar
x
- the new upper bound
ContradictionException
- contradiction exception@Deprecated public void setMax(int x) throws ContradictionException
x
- the new max value
ContradictionException
- contradiction exceptionpublic boolean canBeInstantiatedTo(int x)
IntDomainVar
x
- the tested value
public boolean fastCanBeInstantiatedTo(int x)
IntDomainVar
public int getRandomDomainValue()
IntDomainVar
public int getNextDomainValue(int i)
IntDomainVar
i
- the pivot value. May or may not be in the domain
public int getPrevDomainValue(int i)
IntDomainVar
i
- the pivot value. May or may not be in the domain
public int getInf()
IntDomainVar
public int getSup()
IntDomainVar
public int getValue()
public boolean updateInf(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
IntDomainVar
x
- a lower bound of the domain (the new one, if better than the one currently stored)cause
- constraint that modified the x
ContradictionException
- contradiction exceptionpublic boolean updateInf(int x, int idx) throws ContradictionException
ContradictionException
public boolean updateSup(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
IntDomainVar
x
- an upper bound of the domain (the new one, if better than the one currently stored)
ContradictionException
- contradiction exceptionpublic boolean updateSup(int x, int idx) throws ContradictionException
ContradictionException
public boolean removeVal(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
IntDomainVar
x
- the value that is not in the domain
ContradictionException
- contradiction exceptionpublic boolean removeVal(int x, int idx) throws ContradictionException
ContradictionException
public boolean removeInterval(int a, int b, SConstraint cause, boolean forceAwake) throws ContradictionException
IntDomainVar
a
- the lower bound of the forbidden intervalb
- the upper bound of the forbidden interval
ContradictionException
- contradiction exceptionpublic boolean removeInterval(int a, int b, int idx) throws ContradictionException
ContradictionException
public boolean instantiate(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
IntDomainVar
x
- the value of the variable
ContradictionException
- contradiction exceptionpublic boolean instantiate(int x, int idx) throws ContradictionException
ContradictionException
public void setVal(int x) throws ContradictionException
IntVar
x
- the value that is assigned to the variable
ContradictionException
- contradiction exceptionpublic int getVal()
IntVar
public boolean isInstantiatedTo(int x)
IntVar
x
- the tested value
public String pretty()
IPretty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |