choco.global
Class BoundAllDiff

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.integer.constraints.AbstractIntConstraint
              extended by choco.integer.constraints.AbstractLargeIntConstraint
                  extended by choco.global.BoundAllDiff
All Implemented Interfaces:
Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener

public class BoundAllDiff
extends AbstractLargeIntConstraint


Field Summary
 boolean PROPAGATE_ON_BOUNDS
           
 boolean PROPAGATE_ON_INSTANTIATIONS
           
 
Fields inherited from class choco.integer.constraints.AbstractLargeIntConstraint
cIndices, cste, vars
 
Fields inherited from class choco.integer.constraints.AbstractIntConstraint
logger
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
BoundAllDiff(IntDomainVar[] vars, boolean global)
           
 
Method Summary
 void awakeOnInf(int i)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int i)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRemovals(int idx, IntIterator deltaDomain)
          The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.
 void awakeOnSup(int i)
          Default propagation on improved upper bound: propagation on domain revision.
protected  void filterLower()
           
protected  void filterUpper()
           
 java.lang.Boolean isEntailed()
          Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
protected  int pathmax(int[] tab, int i)
           
protected  int pathmin(int[] tab, int i)
           
protected  void pathset(int[] tab, int start, int end, int to)
           
 void propagate()
          Propagates the constraint awake events.
protected  void sortIt()
           
protected  void sortmax()
           
protected  void sortmin()
           
 
Methods inherited from class choco.integer.constraints.AbstractLargeIntConstraint
assignIndices, clone, getConstraintIdx, getIntVar, getNbVars, getVar, isCompletelyInstantiated, setConstraintIndex, setVar
 
Methods inherited from class choco.integer.constraints.AbstractIntConstraint
awakeOnBounds, awakeOnRem, getSelfIndex, isConsistent
 
Methods inherited from class choco.AbstractConstraint
addListener, awake, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, 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
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

PROPAGATE_ON_INSTANTIATIONS

public boolean PROPAGATE_ON_INSTANTIATIONS

PROPAGATE_ON_BOUNDS

public boolean PROPAGATE_ON_BOUNDS
Constructor Detail

BoundAllDiff

public BoundAllDiff(IntDomainVar[] vars,
                    boolean global)
Method Detail

sortmin

protected void sortmin()

sortmax

protected void sortmax()

sortIt

protected void sortIt()

pathset

protected void pathset(int[] tab,
                       int start,
                       int end,
                       int to)

pathmin

protected int pathmin(int[] tab,
                      int i)

pathmax

protected int pathmax(int[] tab,
                      int i)

filterLower

protected void filterLower()
                    throws ContradictionException
Throws:
ContradictionException

filterUpper

protected void filterUpper()
                    throws ContradictionException
Throws:
ContradictionException

propagate

public void propagate()
               throws ContradictionException
Description copied from class: AbstractLargeIntConstraint
Propagates the constraint awake events.

Specified by:
propagate in interface Propagator
Overrides:
propagate in class AbstractLargeIntConstraint
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int i)
                throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntVarEventListener
Overrides:
awakeOnInf in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int i)
                throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntVarEventListener
Overrides:
awakeOnSup in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int i)
                 throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on instantiation: full constraint re-propagation.

Specified by:
awakeOnInst in interface IntVarEventListener
Overrides:
awakeOnInst in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnRemovals

public void awakeOnRemovals(int idx,
                            IntIterator deltaDomain)
                     throws ContradictionException
Description copied from class: AbstractIntConstraint
The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.

Specified by:
awakeOnRemovals in interface IntConstraint
Overrides:
awakeOnRemovals in class AbstractIntConstraint
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.


isEntailed

public java.lang.Boolean isEntailed()
Description copied from interface: Propagator
Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.

Specified by:
isEntailed in interface Propagator
Overrides:
isEntailed in class AbstractConstraint