choco.palm.integer
Class AbstractPalmLargeIntConstraint

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.palm.integer.AbstractPalmLargeIntConstraint
All Implemented Interfaces:
Constraint, Entity, IntConstraint, IntVarEventListener, PalmIntVarListener, PalmConstraint, PalmVarListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
NogoodConstraint

public abstract class AbstractPalmLargeIntConstraint
extends AbstractLargeIntConstraint
implements PalmIntVarListener, PalmConstraint

Created by IntelliJ IDEA. User: Administrateur Date: 27 janv. 2004 Time: 15:26:56 To change this template use Options | File Templates.


Field Summary
 
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
AbstractPalmLargeIntConstraint(IntDomainVar[] vars)
           
 
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
 java.lang.Object clone()
          returns a copy of the constraint.
 IntDomainVar getIntVar(int i)
          Gets the ith search valued variable.
 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.AbstractLargeIntConstraint
assignIndices, getConstraintIdx, 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, 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
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

AbstractPalmLargeIntConstraint

public AbstractPalmLargeIntConstraint(IntDomainVar[] vars)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Constraint
returns a copy of the constraint. This copy is a new object, may be a recursive copy in case of composite constraints. The original and the copy share the same variables & plugins

Specified by:
clone in interface Constraint
Overrides:
clone in class AbstractLargeIntConstraint
Returns:
Throws:
java.lang.CloneNotSupportedException

getIntVar

public IntDomainVar getIntVar(int i)
Description copied from class: AbstractLargeIntConstraint
Gets the ith search valued variable.

Specified by:
getIntVar in interface IntConstraint
Overrides:
getIntVar in class AbstractLargeIntConstraint
Parameters:
i - index of the variable among all search variables in the constraint. Numbering start from 0 on.
Returns:
the variable, or null when no such variable is found

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).