choco.bool
Class AbstractCompositeConstraint

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.bool.AbstractCompositeConstraint
All Implemented Interfaces:
CompositeConstraint, Constraint, Entity, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
AbstractBinCompositeConstraint, AbstractLargeCompositeConstraint

public abstract class AbstractCompositeConstraint
extends AbstractConstraint
implements CompositeConstraint

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


Field Summary
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
AbstractCompositeConstraint()
           
 
Method Summary
 void addListener(boolean dynamicAddition)
          This function connects a constraint with its variables in several ways.
 void awakeOnBounds(int varIndex)
           
 void awakeOnRemovals(int idx, IntIterator deltaDomain)
           
 int getGlobalVarIndex(Constraint subConstraint, int localVarIdx)
          returns the global index of a variable within a constraint
 
Methods inherited from class choco.AbstractConstraint
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.bool.CompositeConstraint
getNbSubConstraints, getSubConstraint, getSubConstraintIdx
 
Methods inherited from interface choco.Constraint
clone, getConstraintIdx, getNbVars, getVar, getVarIdxInOpposite, isEquivalentTo, isSatisfied, opposite, setConstraintIndex, setVar
 
Methods inherited from interface choco.Entity
getProblem, pretty
 
Methods inherited from interface choco.integer.var.IntVarEventListener
awakeOnInf, awakeOnInst, awakeOnRem, awakeOnSup, getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
awakeOnVar, isActive, setActive, setPassive
 
Methods inherited from interface choco.Propagator
assignIndices, isCompletelyInstantiated, isConsistent, propagate
 

Constructor Detail

AbstractCompositeConstraint

public AbstractCompositeConstraint()
Method Detail

awakeOnBounds

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

awakeOnRemovals

public void awakeOnRemovals(int idx,
                            IntIterator deltaDomain)
                     throws ContradictionException
Throws:
ContradictionException

getGlobalVarIndex

public int getGlobalVarIndex(Constraint subConstraint,
                             int localVarIdx)
Description copied from interface: CompositeConstraint
returns the global index of a variable within a constraint

Specified by:
getGlobalVarIndex in interface CompositeConstraint
Parameters:
subConstraint - the subconstraint (a node in the composition tree)
localVarIdx - the index of the variable, local to the subconstraint
Returns:
the index of the variable in the global numbering associated to the composition (this)

addListener

public void addListener(boolean dynamicAddition)
Description copied from class: AbstractConstraint
This function connects a constraint with its variables in several ways. Note that it may only be called once the constraint has been fully created and is being posted to a problem. Note that it should be called only once per constraint. This can be a dynamic addition (undone upon backtracking) or not

Specified by:
addListener in interface VarEventListener
Overrides:
addListener in class AbstractConstraint