choco.set.constraint
Class Disjoint
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.set.constraint.AbstractSetConstraint
choco.set.constraint.AbstractBinSetConstraint
choco.set.constraint.Disjoint
- All Implemented Interfaces:
- Constraint, Entity, VarEventListener, Propagator, SetConstraint, SetVarEventListener, java.lang.Cloneable, java.util.EventListener
public class Disjoint
- extends AbstractBinSetConstraint
A constraint stating that two sets have to be disjoint :
It is based on two propagation rules :
Env(v1) disjoint Ker(v2)
Env(v2) disjoint Ker(v1)
Method Summary |
void |
awakeOnEnvRemovals(int idx,
IntIterator deltaDomain)
|
void |
awakeOnInst(int varIdx)
Default propagation on instantiation. |
void |
awakeOnKer(int varIdx,
int x)
Default propagation on kernel modification: propagation on adding a value to the kernel. |
void |
filter(int idx)
|
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
java.lang.Boolean |
isEntailed()
Checks whether the constraint is definitely satisfied, no matter what further restrictions
occur to the domain of its variables. |
boolean |
isSatisfied()
Semantic:
Testing if the constraint is satisfied. |
void |
propagate()
Propagation:
Propagating the constraint until local consistency is reached. |
Methods inherited from class choco.AbstractConstraint |
addListener, awake, awakeOnVar, clone, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Disjoint
public Disjoint(SetVar sv1,
SetVar sv2)
filter
public void filter(int idx)
throws ContradictionException
- 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
- Overrides:
awakeOnKer
in class AbstractSetConstraint
- Throws:
ContradictionException
awakeOnEnvRemovals
public void awakeOnEnvRemovals(int idx,
IntIterator deltaDomain)
throws ContradictionException
- Specified by:
awakeOnEnvRemovals
in interface SetConstraint
- Overrides:
awakeOnEnvRemovals
in class AbstractSetConstraint
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int varIdx)
throws ContradictionException
- Description copied from interface:
SetVarEventListener
- Default propagation on instantiation.
- Specified by:
awakeOnInst
in interface SetVarEventListener
- Overrides:
awakeOnInst
in class AbstractSetConstraint
- Throws:
ContradictionException
propagate
public void propagate()
throws ContradictionException
- Description copied from interface:
Propagator
- Propagation:
Propagating the constraint until local consistency is reached.
- Throws:
ContradictionException
isSatisfied
public boolean isSatisfied()
- Description copied from interface:
Constraint
- Semantic:
Testing if the constraint is satisfied.
Note that all variables involved in the constraint must be
instantiated when this method is called.
isConsistent
public boolean isConsistent()
- Description copied from interface:
Propagator
- tests if the constraint is consistent with respect to the current state of domains
isEntailed
public java.lang.Boolean isEntailed()
- Description copied from interface:
Propagator
- Checks whether the constraint is definitely satisfied, no matter what further restrictions
occur to the domain of its variables.
- Specified by:
isEntailed
in interface Propagator
- Overrides:
isEntailed
in class AbstractConstraint