choco.palm.integer
Class AbstractPalmBinIntConstraint
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractBinIntConstraint
choco.palm.integer.AbstractPalmBinIntConstraint
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, PalmIntVarListener, PalmConstraint, PalmVarListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- PalmElt, PalmEqualXYC, PalmGreaterOrEqualXYC, PalmNotEqualXYC
public abstract class AbstractPalmBinIntConstraint
- extends AbstractBinIntConstraint
- implements PalmIntVarListener, PalmConstraint
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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface choco.Propagator |
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated, isConsistent, isEntailed, propagate |
AbstractPalmBinIntConstraint
public AbstractPalmBinIntConstraint(IntDomainVar x0,
IntDomainVar x1)
getIntVar
public IntDomainVar getIntVar(int i)
- Description copied from class:
AbstractBinIntConstraint
- Gets the
i
th search valued variable.
- Specified by:
getIntVar
in interface IntConstraint
- Overrides:
getIntVar
in class AbstractBinIntConstraint
- 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).