|
||||||||||
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.set.SetVarImpl<C>
public final class SetVarImpl<C extends AbstractSConstraint & SetPropagator>
History: 2007-12-07 : FR_1873619 CPRU: DomOverDeg+DomOverWDeg
Field Summary | |
---|---|
protected IntDomainVar |
card
|
protected SetDomain |
domain
|
Fields inherited from class choco.kernel.solver.variables.AbstractVar |
---|
constraints, event, extensions, name, propagationEngine |
Fields inherited from interface choco.kernel.solver.variables.set.SetVar |
---|
BOUNDSET_BOUNDCARD, BOUNDSET_CONSTANT, BOUNDSET_ENUMCARD |
Fields inherited from interface choco.kernel.solver.variables.Var |
---|
LOGGER |
Constructor Summary | |
---|---|
SetVarImpl(Solver solver,
String name,
int[] sortedValues,
IntDomainVar card)
|
|
SetVarImpl(Solver solver,
String name,
int[] sortedValues,
IntDomainVar card,
int type)
Constructor of a SetVar |
|
SetVarImpl(Solver solver,
String name,
int a,
int b,
IntDomainVar card)
|
|
SetVarImpl(Solver solver,
String name,
int a,
int b,
IntDomainVar card,
int type)
Constructor of SetVar |
Method Summary | |
---|---|
boolean |
addToKernel(int x,
int idx)
Deprecated. |
boolean |
addToKernel(int x,
SConstraint cause,
boolean forceAwake)
Propagation events updating the kernel of a variable (i.e adding a value) |
boolean |
canBeEqualTo(SetVar x)
Check if the both domain intersects |
DisposableIterator<Couple<C>> |
getActiveConstraints(C cstrCause)
|
IntDomainVar |
getCard()
|
SetDomain |
getDomain()
Public user API: Domains : returns the object responsible for storing the enumeration of values in the domain |
int |
getEnveloppeDomainSize()
Public user API: Domains : retrieves the number of values in the enveloppe domain. |
int |
getEnveloppeInf()
Returns the lower bound of the enveloppe variable domain. |
int |
getEnveloppeSup()
|
int |
getKernelDomainSize()
Public user API: Domains : retrieves the number of values in the kernel domain. |
int |
getKernelInf()
|
int |
getKernelSup()
|
int[] |
getValue()
Returns the value of the variable if instantiated. |
boolean |
instantiate(int[] x,
int idx)
Deprecated. |
boolean |
instantiate(int[] x,
SConstraint cause,
boolean forceAwake)
Propagation events instantiated a set var to a specific set of values |
boolean |
isInDomainEnveloppe(int x)
Public user API: Domains : testing whether a value is in the enveloppe domain. |
boolean |
isInDomainKernel(int x)
Public user API: Domains : testing whether a value is in the kernel domain |
boolean |
isInstantiated()
Public user API: Domains : testing whether a variable is instantiated or not. |
String |
pretty()
pretty printing |
boolean |
remFromEnveloppe(int x,
int idx)
Deprecated. |
boolean |
remFromEnveloppe(int x,
SConstraint cause,
boolean forceAwake)
Propagation events updating the enveloppe of a variable (i.e removing a value) |
void |
setVal(int[] val)
set the value of the variable to the set val. |
void |
setValIn(int x)
Public user API: setting a value to the kernel of a set variable |
void |
setValOut(int x)
Public user API: removing a value from the Enveloppe of a set variable. |
String |
toString()
Useful for debugging. |
Methods inherited from class choco.kernel.solver.variables.AbstractVar |
---|
addConstraint, addExtension, eraseConstraint, getAbstractVarExtensionNumber, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getExtension, getIndex, getIndexVector, getName, getNbConstraints, getPriority, getVarIndex, hashCode |
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 |
---|
addConstraint, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getName, getNbConstraints, getPriority, getVarIndex |
Methods inherited from interface choco.kernel.common.IIndex |
---|
getIndex |
Methods inherited from interface choco.IExtensionnable |
---|
addExtension, getExtension |
Field Detail |
---|
protected SetDomain domain
protected IntDomainVar card
Constructor Detail |
---|
public SetVarImpl(Solver solver, String name, int a, int b, IntDomainVar card)
public SetVarImpl(Solver solver, String name, int a, int b, IntDomainVar card, int type)
solver
- name
- a
- b
- card
- IntDomainvar representing the cardinality, CAN BE NULLtype
- public SetVarImpl(Solver solver, String name, int[] sortedValues, IntDomainVar card)
public SetVarImpl(Solver solver, String name, int[] sortedValues, IntDomainVar card, int type)
solver
- name
- sortedValues
- card
- IntDomainvar representing the cardinality, CAN BE NULLtype
- Method Detail |
---|
public final DisposableIterator<Couple<C>> getActiveConstraints(C cstrCause)
public IntDomainVar getCard()
getCard
in interface SetVar
public boolean isInstantiated()
Var
isInstantiated
in interface Var
public final void setValIn(int x) throws ContradictionException
SetVar
setValIn
in interface SetVar
x
- the value that is set to the variable
ContradictionException
public final void setValOut(int x) throws ContradictionException
SetVar
setValOut
in interface SetVar
x
- the removed value
ContradictionException
public boolean isInDomainKernel(int x)
SetVar
isInDomainKernel
in interface SetVar
x
- the tested valuepublic boolean isInDomainEnveloppe(int x)
SetVar
isInDomainEnveloppe
in interface SetVar
x
- the tested valuepublic SetDomain getDomain()
SetVar
getDomain
in interface SetVar
public boolean canBeEqualTo(SetVar x)
canBeEqualTo
in interface SetVar
x
- SetVar to be checked with
public int getKernelDomainSize()
SetVar
getKernelDomainSize
in interface SetVar
public int getEnveloppeDomainSize()
SetVar
getEnveloppeDomainSize
in interface SetVar
public int getEnveloppeInf()
SetVar
getEnveloppeInf
in interface SetVar
public int getEnveloppeSup()
getEnveloppeSup
in interface SetVar
public int getKernelInf()
getKernelInf
in interface SetVar
public int getKernelSup()
getKernelSup
in interface SetVar
public int[] getValue()
SetVar
getValue
in interface SetVar
public final void setVal(int[] val) throws ContradictionException
SetVar
setVal
in interface SetVar
val
- the value to be set
ContradictionException
public boolean addToKernel(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
SetVar
addToKernel
in interface SetVar
x
- a value of the enveloppe domain to be added to the kernel
ContradictionException
public boolean remFromEnveloppe(int x, SConstraint cause, boolean forceAwake) throws ContradictionException
SetVar
remFromEnveloppe
in interface SetVar
x
- a value of the enveloppe domain to be removed
ContradictionException
public boolean instantiate(int[] x, SConstraint cause, boolean forceAwake) throws ContradictionException
SetVar
instantiate
in interface SetVar
x
- a set of values describing the final instantiated kernel
ContradictionException
@Deprecated public boolean addToKernel(int x, int idx) throws ContradictionException
addToKernel
in interface SetVar
ContradictionException
@Deprecated public boolean remFromEnveloppe(int x, int idx) throws ContradictionException
remFromEnveloppe
in interface SetVar
ContradictionException
@Deprecated public boolean instantiate(int[] x, int idx) throws ContradictionException
instantiate
in interface SetVar
ContradictionException
public String pretty()
pretty
in interface IPretty
public String toString()
AbstractVar
toString
in class AbstractVar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |