choco.cp.solver.constraints.real
Class Equation

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<RealVar>
          extended by choco.kernel.solver.constraints.real.AbstractRealSConstraint
              extended by choco.kernel.solver.constraints.real.AbstractLargeRealSConstraint
                  extended by choco.cp.solver.constraints.real.Equation
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<RealVar>, RealPropagator, Cloneable, EventListener

public final class Equation
extends AbstractLargeRealSConstraint

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


Field Summary
 
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint
cIndices, constraintType, extensions, vars
 
Fields inherited from class choco.kernel.solver.propagation.Propagator
active, constAwakeEvent, priority, propagationEngine
 
Fields inherited from interface choco.kernel.solver.constraints.SConstraint
LOGGER
 
Constructor Summary
Equation(Solver solver, RealVar[] collectedVars, RealExp exp)
           
Equation(Solver solver, RealVar[] collectedVars, RealExp exp, RealInterval cste)
           
 
Method Summary
 void addBoxedVar(RealVar var)
           
 void boxAllVars()
           
 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.
 String pretty()
          pretty printing of the object.
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 
Methods inherited from class choco.kernel.solver.constraints.real.AbstractLargeRealSConstraint
clone
 
Methods inherited from class choco.kernel.solver.constraints.real.AbstractRealSConstraint
awakeOnInf, awakeOnSup, getConstraintType
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, awake, constAwake, fail, getEvent, getFilteredEventMask, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Equation

public Equation(Solver solver,
                RealVar[] collectedVars,
                RealExp exp,
                RealInterval cste)

Equation

public Equation(Solver solver,
                RealVar[] collectedVars,
                RealExp exp)
Method Detail

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<RealVar>
Returns:
a readable string representation of the object

addBoxedVar

public void addBoxedVar(RealVar var)

boxAllVars

public void boxAllVars()

propagate

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

Specified by:
propagate in class Propagator
Throws:
ContradictionException - contradiction exception

isSatisfied

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

Returns:
true if the constraint is satisfied

isConsistent

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

Specified by:
isConsistent in class Propagator
Returns:
wether the constraint is consistent


Copyright © 2012. All Rights Reserved.