|
|||||||||
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 Var
ContradictionException
public boolean isInstantiated()
Var
isInstantiated
in interface Var
public void setValIn(int x) throws ContradictionException
SetVar
setValIn
in interface SetVar
x
- the value that is set to the variable
ContradictionException
public 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
-
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 void setVal(int[] val) throws ContradictionException
SetVar
setVal
in interface SetVar
val
- the value to be set
ContradictionException
public boolean addToKernel(int x, int idx) throws ContradictionException
SetVar
addToKernel
in interface SetVar
x
- 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 SetVar
x
- 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 SetVar
x
- a set of values describing the final instantiated kernelidx
- the index of the constraint that generated the var
ContradictionException
public java.lang.String pretty()
pretty
in interface Entity
pretty
in class AbstractEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |