choco.real.constraint
Class AbstractLargeRealConstraint

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.real.constraint.AbstractLargeRealConstraint
All Implemented Interfaces:
Constraint, Entity, VarEventListener, Propagator, RealConstraint, RealListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
Equation

public abstract class AbstractLargeRealConstraint
extends AbstractConstraint
implements RealConstraint

Created by IntelliJ IDEA. User: FLABURTHE Date: 19 août 2005 Time: 10:06:22 To change this template use File | Settings | File Templates.


Field Summary
 int[] cIndices
           
protected  RealVar[] vars
           
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
AbstractLargeRealConstraint(RealVar[] vars)
           
 
Method Summary
 int assignIndices(AbstractCompositeConstraint root, int i, boolean dynamicAddition)
          performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i
 java.lang.Object clone()
          returns a copy of the constraint.
 int getConstraintIdx(int i)
          Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.
 int getNbVars()
          Network management: Get the number of variables involved in the constraint.
 RealVar getRealVar(int i)
           
 int getRealVarNb()
           
 int getSelfIndex()
           
 Var getVar(int i)
          Network management: Accessing the ith variable of a constraint.
 boolean isCompletelyInstantiated()
          Utility: Testing if all variables involved in the constraint are instantiated.
 void setConstraintIndex(int i, int idx)
          Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.
 void setVar(int i, Var v)
          Network management: Setting (or overwriting) the ith variable of a constraint.
 
Methods inherited from class choco.AbstractConstraint
addListener, awake, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEntailed, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar
 
Methods inherited from class choco.AbstractEntity
pretty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.Propagator
awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isConsistent, isEntailed, propagate
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.real.constraint.RealListener
awakeOnInf, awakeOnSup
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

vars

protected RealVar[] vars

cIndices

public int[] cIndices
Constructor Detail

AbstractLargeRealConstraint

public AbstractLargeRealConstraint(RealVar[] vars)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Constraint
returns a copy of the constraint. This copy is a new object, may be a recursive copy in case of composite constraints. The original and the copy share the same variables & plugins

Specified by:
clone in interface Constraint
Overrides:
clone in class AbstractConstraint
Returns:
Throws:
java.lang.CloneNotSupportedException

setConstraintIndex

public void setConstraintIndex(int i,
                               int idx)
Description copied from interface: Constraint
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.

Specified by:
setConstraintIndex in interface Constraint
Specified by:
setConstraintIndex in interface RealListener
Parameters:
i - index of the variable in the constraint
idx - index of the constraint in the among all listeners linked to that variable

getConstraintIdx

public int getConstraintIdx(int i)
Description copied from interface: Constraint
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.

Specified by:
getConstraintIdx in interface Constraint
Specified by:
getConstraintIdx in interface RealListener
Parameters:
i - index of the variable in the constraint

getNbVars

public int getNbVars()
Description copied from interface: Constraint
Network management: Get the number of variables involved in the constraint.

Specified by:
getNbVars in interface Constraint

getVar

public Var getVar(int i)
Description copied from interface: Constraint
Network management: Accessing the ith variable of a constraint.

Specified by:
getVar in interface Constraint
Parameters:
i - index of the variable in the constraint

setVar

public void setVar(int i,
                   Var v)
Description copied from interface: Constraint
Network management: Setting (or overwriting) the ith variable of a constraint.

Specified by:
setVar in interface Constraint
Parameters:
i - index of the variable in the constraint
v - the variable (may be an IntDomainVar, SetVar, RealVar, ...

getRealVar

public RealVar getRealVar(int i)
Specified by:
getRealVar in interface RealConstraint

getRealVarNb

public int getRealVarNb()
Specified by:
getRealVarNb in interface RealConstraint

assignIndices

public int assignIndices(AbstractCompositeConstraint root,
                         int i,
                         boolean dynamicAddition)
Description copied from interface: Propagator
performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i

Specified by:
assignIndices in interface Propagator
Parameters:
root - the overall root constraint, for which the variables are numbered
i - the index that will assigned to the first variable in the subtree this (originally 0)
dynamicAddition - whether the addition is undone automatically on backtracking
Returns:
the index of the last variable in the subtree

isCompletelyInstantiated

public boolean isCompletelyInstantiated()
Description copied from interface: Propagator
Utility: Testing if all variables involved in the constraint are instantiated.

Specified by:
isCompletelyInstantiated in interface Propagator

getSelfIndex

public int getSelfIndex()