|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.AbstractEntity
choco.AbstractVar
choco.set.var.SetVarImpl
public class SetVarImpl
Created by IntelliJ IDEA. User: Hadrien Date: 6 juin 2004 Time: 14:22:32 To change this template use File | Settings | File Templates.
| Field Summary | |
|---|---|
protected SetDomainImpl |
domain
|
| Fields inherited from class choco.AbstractVar |
|---|
constraints, event, indices, name |
| Fields inherited from class choco.AbstractEntity |
|---|
hook, problem |
| Constructor Summary | |
|---|---|
SetVarImpl(AbstractProblem pb,
java.lang.String name,
int a,
int b)
|
|
| Method Summary | |
|---|---|
boolean |
addToKernel(int x,
int idx)
Propagation events updating the kernel of a variable (i.e adding a value) |
boolean |
canBeEqualTo(SetVar x)
Check if the both domain intersects |
void |
fail()
a constraint may fail during propagation, raising a contradiction |
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)
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. |
java.lang.String |
pretty()
pretty printing |
boolean |
remFromEnveloppe(int x,
int idx)
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. |
| Methods inherited from class choco.AbstractVar |
|---|
addConstraint, eraseConstraint, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getNbConstraints, getVarIndex, toString |
| Methods inherited from class choco.AbstractEntity |
|---|
getProblem |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface choco.Var |
|---|
addConstraint, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getNbConstraints, getVarIndex |
| Methods inherited from interface choco.Entity |
|---|
getProblem |
| Field Detail |
|---|
protected SetDomainImpl domain
| Constructor Detail |
|---|
public SetVarImpl(AbstractProblem pb,
java.lang.String name,
int a,
int b)
| Method Detail |
|---|
public void fail()
throws ContradictionException
Var
fail in interface VarContradictionExceptionpublic boolean isInstantiated()
Var
isInstantiated in interface Var
public void setValIn(int x)
throws ContradictionException
SetVar
setValIn in interface SetVarx - the value that is set to the variable
ContradictionException
public void setValOut(int x)
throws ContradictionException
SetVar
setValOut in interface SetVarx - the removed value
ContradictionExceptionpublic boolean isInDomainKernel(int x)
SetVar
isInDomainKernel in interface SetVarx - the tested valuepublic boolean isInDomainEnveloppe(int x)
SetVar
isInDomainEnveloppe in interface SetVarx - the tested valuepublic SetDomain getDomain()
SetVar
getDomain in interface SetVarpublic boolean canBeEqualTo(SetVar x)
canBeEqualTo in interface SetVarx -
public int getKernelDomainSize()
SetVar
getKernelDomainSize in interface SetVarpublic int getEnveloppeDomainSize()
SetVar
getEnveloppeDomainSize in interface SetVarpublic int getEnveloppeInf()
SetVar
getEnveloppeInf in interface SetVarpublic int getEnveloppeSup()
getEnveloppeSup in interface SetVarpublic int getKernelInf()
getKernelInf in interface SetVarpublic int getKernelSup()
getKernelSup in interface SetVarpublic int[] getValue()
SetVar
getValue in interface SetVar
public void setVal(int[] val)
throws ContradictionException
SetVar
setVal in interface SetVarval - the value to be set
ContradictionException
public boolean addToKernel(int x,
int idx)
throws ContradictionException
SetVar
addToKernel in interface SetVarx - a value of the enveloppe domain to be added to the kernelidx - the index of the constraint that generated the var
ContradictionException
public boolean remFromEnveloppe(int x,
int idx)
throws ContradictionException
SetVar
remFromEnveloppe in interface SetVarx - a value of the enveloppe domain to be removedidx - the index of the constraint that generated the var
ContradictionException
public boolean instantiate(int[] x,
int idx)
throws ContradictionException
SetVar
instantiate in interface SetVarx - a set of values describing the final instantiated kernelidx - the index of the constraint that generated the var
ContradictionExceptionpublic java.lang.String pretty()
pretty in interface Entitypretty in class AbstractEntity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||