choco.set
Interface SetVar

All Superinterfaces:
Entity, Var
All Known Implementing Classes:
SetVarImpl

public interface SetVar
extends Var

Created by IntelliJ IDEA. User: Hadrien Date: 6 juin 2004 Time: 09:51:52 To change this template use File | Settings | File Templates.


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)
          Public user API: Domains : testing whether two variables have intersecting domains.
 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 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 interface choco.Var
addConstraint, fail, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getNbConstraints, getVarIndex, isInstantiated
 
Methods inherited from interface choco.Entity
getProblem, pretty
 

Method Detail

setValIn

void setValIn(int x)
              throws ContradictionException
Public user API: setting a value to the kernel of a set variable

Parameters:
x - the value that is set to the variable
Throws:
ContradictionException

setValOut

void setValOut(int x)
               throws ContradictionException
Public user API: removing a value from the Enveloppe of a set variable.

Parameters:
x - the removed value
Throws:
ContradictionException

getDomain

SetDomain getDomain()
Public user API: Domains : returns the object responsible for storing the enumeration of values in the domain


isInDomainKernel

boolean isInDomainKernel(int x)
Public user API: Domains : testing whether a value is in the kernel domain

Parameters:
x - the tested value

isInDomainEnveloppe

boolean isInDomainEnveloppe(int x)
Public user API: Domains : testing whether a value is in the enveloppe domain.

Parameters:
x - the tested value

canBeEqualTo

boolean canBeEqualTo(SetVar x)
Public user API: Domains : testing whether two variables have intersecting domains.

Parameters:
x - the other variable

getKernelDomainSize

int getKernelDomainSize()
Public user API: Domains : retrieves the number of values in the kernel domain.


getEnveloppeDomainSize

int getEnveloppeDomainSize()
Public user API: Domains : retrieves the number of values in the enveloppe domain.


getEnveloppeInf

int getEnveloppeInf()
Returns the lower bound of the enveloppe variable domain. (i.e the smallest value contained in the enveloppe)

Returns:
the enveloppe domain lower bound

getEnveloppeSup

int getEnveloppeSup()

getKernelInf

int getKernelInf()

getKernelSup

int getKernelSup()

getValue

int[] getValue()
Returns the value of the variable if instantiated.

Returns:
the value of the variable

setVal

void setVal(int[] val)
            throws ContradictionException
set the value of the variable to the set val.

Parameters:
val - the value to be set
Throws:
ContradictionException

addToKernel

boolean addToKernel(int x,
                    int idx)
                    throws ContradictionException
Propagation events updating the kernel of a variable (i.e adding a value)

Parameters:
x - a value of the enveloppe domain to be added to the kernel
idx - the index of the constraint that generated the var
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException

remFromEnveloppe

boolean remFromEnveloppe(int x,
                         int idx)
                         throws ContradictionException
Propagation events updating the enveloppe of a variable (i.e removing a value)

Parameters:
x - a value of the enveloppe domain to be removed
idx - the index of the constraint that generated the var
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException

instantiate

boolean instantiate(int[] x,
                    int idx)
                    throws ContradictionException
Propagation events instantiated a set var to a specific set of values

Parameters:
x - a set of values describing the final instantiated kernel
idx - the index of the constraint that generated the var
Returns:
a boolean indicating whether this method call added new information or not
Throws:
ContradictionException