choco.cp.solver.constraints.real
Class MixedCstElt

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<Var>
          extended by choco.kernel.solver.constraints.real.AbstractMixedSRealIntSConstraint
              extended by choco.kernel.solver.constraints.real.AbstractBinRealIntSConstraint
                  extended by choco.cp.solver.constraints.real.MixedCstElt
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<Var>, IntPropagator, RealPropagator, Cloneable, EventListener

public final class MixedCstElt
extends AbstractBinRealIntSConstraint

Let x be an integer variable with n values and v be a real variable. Given n constant values a1 to an, this constraint ensures that:

x = i iff v = ai

a1... an sequence is supposed to be ordered (a1<a2<... an)


Field Summary
protected  double[] values
           
 
Fields inherited from class choco.kernel.solver.constraints.real.AbstractBinRealIntSConstraint
v0, v1
 
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
MixedCstElt(RealVar v0, IntDomainVar v1, double[] values)
           
 
Method Summary
 void awake()
          Propagation: Propagating the constraint for the very first time until local consistency is reached.
 void awakeOnBounds(int idx)
           
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int varIdx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int varIdx, int val)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnRemovals(int varIdx, DisposableIntIterator deltaDomain)
           
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
 Object clone()
          Clone the constraint
 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 propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 void updateIInf()
           
 void updateISup()
           
 void updateReal()
           
 
Methods inherited from class choco.kernel.solver.constraints.real.AbstractBinRealIntSConstraint
getConstraintType, getIntVar, getIntVarNb, getRealVar, getRealVarNb, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, pretty, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, 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
 

Field Detail

values

protected double[] values
Constructor Detail

MixedCstElt

public MixedCstElt(RealVar v0,
                   IntDomainVar v1,
                   double[] values)
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: AbstractSConstraint
Clone the constraint

Overrides:
clone in class AbstractBinRealIntSConstraint
Returns:
the clone of the constraint
Throws:
CloneNotSupportedException - Clone not supported exception

awake

public void awake()
           throws ContradictionException
Description copied from class: Propagator
Propagation: Propagating the constraint for the very first time until local consistency is reached.

Overrides:
awake in class Propagator
Throws:
ContradictionException - contradiction exception

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

awakeOnInf

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

Throws:
ContradictionException

awakeOnSup

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

Throws:
ContradictionException

awakeOnBounds

public void awakeOnBounds(int idx)
                   throws ContradictionException
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int varIdx)
                 throws ContradictionException
Description copied from interface: IntPropagator
Default propagation on instantiation: full constraint re-propagation.

Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int varIdx,
                       int val)
                throws ContradictionException
Description copied from interface: IntPropagator
Default propagation on one value removal: propagation on domain revision.

Throws:
ContradictionException

awakeOnRemovals

public void awakeOnRemovals(int varIdx,
                            DisposableIntIterator deltaDomain)
                     throws ContradictionException
Throws:
ContradictionException

updateIInf

public void updateIInf()
                throws ContradictionException
Throws:
ContradictionException

updateISup

public void updateISup()
                throws ContradictionException
Throws:
ContradictionException

updateReal

public void updateReal()
                throws ContradictionException
Throws:
ContradictionException

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

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


Copyright © 2012. All Rights Reserved.