choco.real.constraint
Class Equation

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

public class Equation
extends AbstractLargeRealConstraint

A basic constraint using HC4 algorithm for filtering values with respect to a mathematical equation.


Field Summary
protected  int boxConsistencyDepth
           
protected  RealVar[] boxedVars
           
protected  RealInterval cste
           
protected  RealExp exp
           
protected  int nbBoxedVars
           
protected  RealExp[] subExps
           
protected  RealExp[][] subExpsWOX
           
protected  RealExp[][] subExpsWX
           
 
Fields inherited from class choco.real.constraint.AbstractLargeRealConstraint
cIndices, vars
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
Equation(AbstractProblem pb, RealVar[] collectedVars, RealExp exp)
           
Equation(AbstractProblem pb, RealVar[] collectedVars, RealExp exp, RealInterval cste)
           
 
Method Summary
 void addBoxedVar(RealVar var)
           
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
protected  void bc(RealVar var, RealExp[] wx, RealExp[] wox)
           
 void boxAllVars()
           
 java.lang.Object clone()
          Makes a copy of this constraint.
 void initEquation(AbstractProblem pb, RealExp exp, RealInterval cste)
           
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 void proj()
           
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 void tighten(RealExp[] exps)
           
 
Methods inherited from class choco.real.constraint.AbstractLargeRealConstraint
assignIndices, getConstraintIdx, getNbVars, getRealVar, getRealVarNb, getSelfIndex, getVar, isCompletelyInstantiated, setConstraintIndex, setVar
 
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, isEntailed
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

cste

protected RealInterval cste

exp

protected RealExp exp

subExps

protected RealExp[] subExps

nbBoxedVars

protected int nbBoxedVars

boxedVars

protected RealVar[] boxedVars

subExpsWX

protected RealExp[][] subExpsWX

subExpsWOX

protected RealExp[][] subExpsWOX

boxConsistencyDepth

protected int boxConsistencyDepth
Constructor Detail

Equation

public Equation(AbstractProblem pb,
                RealVar[] collectedVars,
                RealExp exp,
                RealInterval cste)

Equation

public Equation(AbstractProblem pb,
                RealVar[] collectedVars,
                RealExp exp)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: AbstractLargeRealConstraint
Makes a copy of this constraint.

Specified by:
clone in interface Constraint
Overrides:
clone in class AbstractLargeRealConstraint
Returns:
a copy of this constraint
Throws:
java.lang.CloneNotSupportedException - thrown if this constraint cannot be cloned.

initEquation

public void initEquation(AbstractProblem pb,
                         RealExp exp,
                         RealInterval cste)

addBoxedVar

public void addBoxedVar(RealVar var)

boxAllVars

public void boxAllVars()

propagate

public void propagate()
               throws ContradictionException
Description copied from interface: Propagator
Propagation: Propagating the constraint until local consistency is reached.

Throws:
ContradictionException

bc

protected void bc(RealVar var,
                  RealExp[] wx,
                  RealExp[] wox)
           throws ContradictionException
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Description copied from interface: RealListener
Default propagation on improved lower bound: propagation on domain revision.

Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Description copied from interface: RealListener
Default propagation on improved upper bound: propagation on domain revision.

Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
Description copied from interface: Constraint
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.


isConsistent

public boolean isConsistent()
Description copied from interface: Propagator
tests if the constraint is consistent with respect to the current state of domains


tighten

public void tighten(RealExp[] exps)
             throws ContradictionException
Throws:
ContradictionException

proj

public void proj()
          throws ContradictionException
Throws:
ContradictionException