|
||||||||||
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
public abstract class AbstractBijectiveVar
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 | |
---|---|
AbstractBijectiveVar(Solver solver,
String name,
IntDomainVar variable)
Build a variable Y such as Y = X op c. |
Method Summary | |
---|---|
int |
addConstraint(SConstraint c,
int varIdx,
boolean dynamicAddition)
Adds a new constraints on the stack of constraints the addition can be dynamic (undone upon backtracking) or not. |
boolean |
canBeEqualTo(IntDomainVar x)
Public user API: Domains : testing whether two variables have intersecting domains. |
void |
eraseConstraint(SConstraint c)
Removes (permanently) a constraint from the list of constraints connected to the variable. |
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. |
SConstraint |
getConstraint(int i)
Retrieve the constraint i involving the variable. |
DisposableIterator<SConstraint> |
getConstraintsIterator()
This methods should be used if one want to access the different constraints currently posted on this variable. |
PartiallyStoredVector<? extends SConstraint> |
getConstraintVector()
Access the data structure storing constraints involving a given variable. |
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. |
VarEvent<? extends Var> |
getEvent()
Returns the variable event. |
PartiallyStoredIntVector |
getIndexVector()
Access the data structure storing indices associated to constraints involving a given variable. |
int |
getNbConstraints()
Returns the number of constraints involving the variable. |
int |
getVarIndex(int constraintIndex)
Returns the index of the variable in its constraint i. |
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 |
isInstantiated()
Public user API: Domains : testing whether a variable is instantiated or not. |
void |
wipeOut()
Public user API: Propagation events wiping out the domain of the variable (removing all values) and throwing a contradiction |
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.integer.IntDomainVar |
---|
canBeInstantiatedTo, fastCanBeInstantiatedTo, getInf, getNextDomainValue, getPrevDomainValue, getRandomDomainValue, getSup, getValue, instantiate, instantiate, removeInterval, removeInterval, removeVal, removeVal, remVal, setInf, setMax, setMin, setSup, updateInf, updateInf, updateSup, updateSup |
Methods inherited from interface choco.kernel.solver.variables.integer.IntVar |
---|
getVal, isInstantiatedTo, setVal |
Methods inherited from interface choco.kernel.solver.variables.Var |
---|
getName, getPriority |
Methods inherited from interface choco.IPretty |
---|
pretty |
Methods inherited from interface choco.kernel.common.IIndex |
---|
getIndex |
Methods inherited from interface choco.IExtensionnable |
---|
addExtension, getExtension |
Constructor Detail |
---|
public AbstractBijectiveVar(Solver solver, String name, IntDomainVar variable)
solver
- The model this variable belongs toname
- The name of the variablevariable
- constraints stored specific structureMethod Detail |
---|
public void wipeOut() throws ContradictionException
IntDomainVar
wipeOut
in interface IntDomainVar
ContradictionException
- contradiction exceptionpublic int fastNextDomainValue(int i)
IntDomainVar
fastNextDomainValue
in interface IntDomainVar
public int fastPrevDomainValue(int i)
IntDomainVar
fastPrevDomainValue
in interface IntDomainVar
public boolean hasEnumeratedDomain()
IntDomainVar
hasEnumeratedDomain
in interface IntDomainVar
public boolean hasBooleanDomain()
IntDomainVar
hasBooleanDomain
in interface IntDomainVar
public IntDomain getDomain()
IntDomainVar
getDomain
in interface IntDomainVar
public boolean canBeEqualTo(IntDomainVar x)
IntDomainVar
canBeEqualTo
in interface IntDomainVar
x
- the other variable
public int getDomainSize()
IntDomainVar
getDomainSize
in interface IntDomainVar
public boolean isInstantiated()
Var
isInstantiated
in interface Var
public VarEvent<? extends Var> getEvent()
AbstractVar
getEvent
in interface Var
getEvent
in class AbstractVar
public SConstraint getConstraint(int i)
AbstractVar
getConstraint
in interface Var
getConstraint
in class AbstractVar
i
- the number of the required constraint
public int getNbConstraints()
AbstractVar
getNbConstraints
in interface Var
getNbConstraints
in class AbstractVar
public PartiallyStoredVector<? extends SConstraint> getConstraintVector()
AbstractVar
getConstraintVector
in interface Var
getConstraintVector
in class AbstractVar
public PartiallyStoredIntVector getIndexVector()
AbstractVar
getIndexVector
in interface Var
getIndexVector
in class AbstractVar
public int getVarIndex(int constraintIndex)
AbstractVar
getVarIndex
in interface Var
getVarIndex
in class AbstractVar
constraintIndex
- the index of the constraint
(among all constraints linked to the variable)
public void eraseConstraint(SConstraint c)
AbstractVar
eraseConstraint
in class AbstractVar
c
- the constraint that should be removed from the list this variable
maintains.public int addConstraint(SConstraint c, int varIdx, boolean dynamicAddition)
AbstractVar
addConstraint
in interface Var
addConstraint
in class AbstractVar
c
- the constraint to addvarIdx
- the variable index accrding to the added constraintdynamicAddition
- states if the addition is definitic (cut) or
subject to backtracking (standard constraint)
public DisposableIterator<SConstraint> getConstraintsIterator()
AbstractVar
remove
method throws an
UnsupportedOperationException
.
getConstraintsIterator
in interface Var
getConstraintsIterator
in class AbstractVar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |