choco.real.constraint
Class Equation
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.real.constraint.AbstractLargeRealConstraint
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.
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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
Equation
public Equation(AbstractProblem pb,
RealVar[] collectedVars,
RealExp exp,
RealInterval cste)
Equation
public Equation(AbstractProblem pb,
RealVar[] collectedVars,
RealExp exp)
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