choco.integer.constraints
Class AbstractIntConstraint

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.integer.constraints.AbstractIntConstraint
All Implemented Interfaces:
Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
AbstractBinIntConstraint, AbstractLargeIntConstraint, AbstractTernIntConstraint, AbstractUnIntConstraint

public abstract class AbstractIntConstraint
extends AbstractConstraint
implements IntConstraint

An abstract class for all implementations of listeners over search variables.


Field Summary
protected static java.util.logging.Logger logger
          Reference to an object for logging trace statements related to constraints over integers (using the java.util.logging package)
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
AbstractIntConstraint()
           
 
Method Summary
 void awakeOnBounds(int varIndex)
           
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int idx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int idx, int x)
          Default propagation on one value removal: propagation on domain revision.
 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 idx)
          Default propagation on improved upper bound: propagation on domain revision.
 int getSelfIndex()
          returns the (global) index of the constraint among all constraints of the problem
 boolean isCompletelyInstantiated()
          Checks if all the variables are instantiated.
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 
Methods inherited from class choco.AbstractConstraint
addListener, awake, awakeOnVar, clone, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEntailed, 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.integer.IntConstraint
getIntVar
 
Methods inherited from interface choco.Propagator
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isEntailed, propagate
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.var.IntVarEventListener
getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

logger

protected static java.util.logging.Logger logger
Reference to an object for logging trace statements related to constraints over integers (using the java.util.logging package)

Constructor Detail

AbstractIntConstraint

public AbstractIntConstraint()
Method Detail

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntVarEventListener
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntVarEventListener
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int idx)
                 throws ContradictionException
Default propagation on instantiation: full constraint re-propagation.

Specified by:
awakeOnInst in interface IntVarEventListener
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int idx,
                       int x)
                throws ContradictionException
Default propagation on one value removal: propagation on domain revision.

Specified by:
awakeOnRem in interface IntVarEventListener
Throws:
ContradictionException

awakeOnRemovals

public void awakeOnRemovals(int idx,
                            IntIterator deltaDomain)
                     throws ContradictionException
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
Parameters:
idx -
Throws:
ContradictionException

isCompletelyInstantiated

public boolean isCompletelyInstantiated()
Checks if all the variables are instantiated.

Specified by:
isCompletelyInstantiated in interface Propagator

awakeOnBounds

public void awakeOnBounds(int varIndex)
                   throws ContradictionException
Specified by:
awakeOnBounds in interface IntConstraint
Throws:
ContradictionException

isConsistent

public boolean isConsistent()
tests if the constraint is consistent with respect to the current state of domains

Specified by:
isConsistent in interface Propagator
Returns:
true if the constraint is entailed (default approximate definition)

getSelfIndex

public int getSelfIndex()
returns the (global) index of the constraint among all constraints of the problem