choco.palm.integer
Class AbstractPalmTernIntConstraint

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.integer.constraints.AbstractIntConstraint
              extended by choco.integer.constraints.AbstractTernIntConstraint
                  extended by choco.palm.integer.AbstractPalmTernIntConstraint
All Implemented Interfaces:
Constraint, Entity, IntConstraint, IntVarEventListener, PalmIntVarListener, PalmConstraint, PalmVarListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
PalmElt2D

public abstract class AbstractPalmTernIntConstraint
extends AbstractTernIntConstraint
implements PalmIntVarListener, PalmConstraint

Created by IntelliJ IDEA. User: Administrateur Date: 30 janv. 2004 Time: 09:00:21 To change this template use Options | File Templates.


Field Summary
 
Fields inherited from class choco.integer.constraints.AbstractTernIntConstraint
cIdx0, cIdx1, cIdx2, v0, v1, v2
 
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
AbstractPalmTernIntConstraint(IntDomainVar x0, IntDomainVar x1, IntDomainVar x2)
           
 
Method Summary
 void awakeOnInst(int idx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRestoreInf(int index)
          Handles an inf bound restoration on the constraint idx
 void awakeOnRestoreSup(int index)
          Handles a sup bound restoration on the constraint idx
 void awakeOnRestoreVal(int idx, IntIterator repairDomain)
          Handles a val restoration on the constraint idx
 void takeIntoAccountStatusChange(int index)
          Informs constraints that one of their children has a modified status (due to value restoration).
 void updateDataStructuresOnConstraint(int idx, int select, int newValue, int oldValue)
          Method called when one of the variables is modified.
 void updateDataStructuresOnRestoreConstraint(int idx, int select, int newValue, int oldValue)
          Method called when one of the variables has a restored value.
 
Methods inherited from class choco.integer.constraints.AbstractTernIntConstraint
assignIndices, getConstraintIdx, getIntVar, getNbVars, getVar, isCompletelyInstantiated, propagate, setConstraintIndex, setVar
 
Methods inherited from class choco.integer.constraints.AbstractIntConstraint
awakeOnBounds, awakeOnInf, awakeOnRem, awakeOnRemovals, awakeOnSup, getSelfIndex, isConsistent
 
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.palm.integer.PalmIntVarListener
awakeOnRestoreVal, whyIsFalse, whyIsTrue
 
Methods inherited from interface choco.palm.PalmVarListener
getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.integer.var.IntVarEventListener
awakeOnInf, awakeOnRem, awakeOnSup, getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.Propagator
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated, isConsistent, isEntailed, propagate
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
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.palm.PalmVarListener
getConstraintIdx, setConstraintIndex
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Constructor Detail

AbstractPalmTernIntConstraint

public AbstractPalmTernIntConstraint(IntDomainVar x0,
                                     IntDomainVar x1,
                                     IntDomainVar x2)
Method Detail

takeIntoAccountStatusChange

public void takeIntoAccountStatusChange(int index)
Description copied from interface: PalmConstraint
Informs constraints that one of their children has a modified status (due to value restoration).

Specified by:
takeIntoAccountStatusChange in interface PalmConstraint

awakeOnRestoreInf

public void awakeOnRestoreInf(int index)
                       throws ContradictionException
Description copied from interface: PalmIntVarListener
Handles an inf bound restoration on the constraint idx

Specified by:
awakeOnRestoreInf in interface PalmIntVarListener
Parameters:
index - Variable involved.
Throws:
ContradictionException

awakeOnRestoreSup

public void awakeOnRestoreSup(int index)
                       throws ContradictionException
Description copied from interface: PalmIntVarListener
Handles a sup bound restoration on the constraint idx

Specified by:
awakeOnRestoreSup in interface PalmIntVarListener
Parameters:
index - Variable involved.
Throws:
ContradictionException

awakeOnInst

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

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

awakeOnRestoreVal

public void awakeOnRestoreVal(int idx,
                              IntIterator repairDomain)
                       throws ContradictionException
Description copied from interface: PalmIntVarListener
Handles a val restoration on the constraint idx

Specified by:
awakeOnRestoreVal in interface PalmIntVarListener
Parameters:
idx - Variable involved.
Throws:
ContradictionException

updateDataStructuresOnConstraint

public void updateDataStructuresOnConstraint(int idx,
                                             int select,
                                             int newValue,
                                             int oldValue)
Description copied from interface: PalmVarListener
Method called when one of the variables is modified.

Specified by:
updateDataStructuresOnConstraint in interface PalmVarListener
Parameters:
idx - Index of the variable.
select - Type of modification (PalmIntVar.INF, PalmIntVar.SUP, PalmIntVar.VAL).
newValue - New value (or modified value).
oldValue - Old value (or 0 if this a value removal).

updateDataStructuresOnRestoreConstraint

public void updateDataStructuresOnRestoreConstraint(int idx,
                                                    int select,
                                                    int newValue,
                                                    int oldValue)
Description copied from interface: PalmVarListener
Method called when one of the variables has a restored value.

Specified by:
updateDataStructuresOnRestoreConstraint in interface PalmVarListener
Parameters:
idx - Index of the variable.
select - Type of modification.
newValue - New value (or modified value).
oldValue - Old value (or 0 if this a value removal).