choco.cp.solver.constraints.integer
Class IncreasingSum

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
          extended by choco.kernel.solver.constraints.integer.AbstractIntSConstraint
              extended by choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
                  extended by choco.cp.solver.constraints.integer.IncreasingSum
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public class IncreasingSum
extends AbstractLargeIntSConstraint

A sum constraint with increasing variables s = x_0 + x_1 + ... + x_(n-1) and x_0 <= x_1 <= ... <= x_(n-1) Bounds-consistency algorithm linear in n (the number of variables)

See "A O(n) Bound-Consistency Algorithm for the Increasing Sum Constraint",
T. Petit, J.C. Regin and N. Beldiceanu User: tpetit thierry.petit(a)mines-nantes.fr


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
IncreasingSum(IntDomainVar[] dec, IntDomainVar s)
           
 
Method Summary
protected static IntDomainVar[] buildVars(IntDomainVar[] dec, IntDomainVar s)
           
 void filterMax()
           
 void filterMin()
           
 boolean isSatisfied()
          Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 void updateMax()
           
 void updateMin()
           
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, getConstraintType, isConsistent, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, 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, 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

IncreasingSum

public IncreasingSum(IntDomainVar[] dec,
                     IntDomainVar s)
Method Detail

buildVars

protected static IntDomainVar[] buildVars(IntDomainVar[] dec,
                                          IntDomainVar s)

updateMin

public void updateMin()
               throws ContradictionException
Throws:
ContradictionException

updateMax

public void updateMax()
               throws ContradictionException
Throws:
ContradictionException

filterMax

public void filterMax()
               throws ContradictionException
Throws:
ContradictionException

filterMin

public void filterMin()
               throws ContradictionException
Throws:
ContradictionException

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 class: AbstractIntSConstraint
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
Overrides:
isSatisfied in class AbstractIntSConstraint
Returns:
true if the constraint is satisfied


Copyright © 2012. All Rights Reserved.