choco.set.constraint
Class AbstractMixedConstraint
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.set.constraint.AbstractMixedConstraint
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, SetConstraint, SetVarEventListener, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- AbstractBinSetIntConstraint
public abstract class AbstractMixedConstraint
- extends AbstractConstraint
- implements SetConstraint, IntConstraint
A class for mixed set and int constraint. It refers to both interface
SetConstraint and IntConstraint and implements a default behaviour
for all events awakeOn...
Method Summary |
void |
awakeOnBounds(int varIndex)
|
void |
awakeOnEnv(int varIdx,
int x)
Default propagation on enveloppe modification: propagation on removing a value from the enveloppe. |
void |
awakeOnEnvRemovals(int idx,
IntIterator deltaDomain)
|
void |
awakeOnInf(int idx)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int varIdx)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnKer(int varIdx,
int x)
Default propagation on kernel modification: propagation on adding a value to the kernel. |
void |
awakeOnkerAdditions(int idx,
IntIterator deltaDomain)
|
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()
Utility:
Testing if all variables involved in the constraint are instantiated. |
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, isConsistent, isEntailed, propagate |
Methods inherited from interface choco.Propagator |
assignIndices, awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isConsistent, isEntailed, propagate |
AbstractMixedConstraint
public AbstractMixedConstraint()
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
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
awakeOnBounds
public void awakeOnBounds(int varIndex)
throws ContradictionException
- Specified by:
awakeOnBounds
in interface IntConstraint
- Throws:
ContradictionException
awakeOnKer
public void awakeOnKer(int varIdx,
int x)
throws ContradictionException
- Description copied from interface:
SetVarEventListener
- Default propagation on kernel modification: propagation on adding a value to the kernel.
- Specified by:
awakeOnKer
in interface SetVarEventListener
- Throws:
ContradictionException
awakeOnEnv
public void awakeOnEnv(int varIdx,
int x)
throws ContradictionException
- Description copied from interface:
SetVarEventListener
- Default propagation on enveloppe modification: propagation on removing a value from the enveloppe.
- Specified by:
awakeOnEnv
in interface SetVarEventListener
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int varIdx)
throws ContradictionException
- Description copied from interface:
IntVarEventListener
- Default propagation on instantiation: full constraint re-propagation.
- Specified by:
awakeOnInst
in interface IntVarEventListener
- Specified by:
awakeOnInst
in interface SetVarEventListener
- Throws:
ContradictionException
awakeOnEnvRemovals
public void awakeOnEnvRemovals(int idx,
IntIterator deltaDomain)
throws ContradictionException
- Specified by:
awakeOnEnvRemovals
in interface SetConstraint
- Throws:
ContradictionException
awakeOnkerAdditions
public void awakeOnkerAdditions(int idx,
IntIterator deltaDomain)
throws ContradictionException
- Specified by:
awakeOnkerAdditions
in interface SetConstraint
- Throws:
ContradictionException
isCompletelyInstantiated
public boolean isCompletelyInstantiated()
- Description copied from interface:
Propagator
- Utility:
Testing if all variables involved in the constraint are instantiated.
- Specified by:
isCompletelyInstantiated
in interface Propagator
getSelfIndex
public int getSelfIndex()
- returns the (global) index of the constraint among all constraints of the problem