choco.integer.constraints
Class InverseChanneling
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractLargeIntConstraint
choco.integer.constraints.InverseChanneling
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
public class InverseChanneling
- extends AbstractLargeIntConstraint
Field Summary |
protected int |
n
|
Constructor Summary |
InverseChanneling(IntDomainVar[] allVars,
int n)
link x and y so that x[i] = j <=> y[j] = i
It is used to maintain both model on permutation problems |
Method Summary |
void |
awakeOnInf(int idx)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int idx)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRem(int idx,
int x)
Default propagation on one value removal: propagation on domain revision. |
void |
awakeOnSup(int idx)
Default propagation on improved upper bound: propagation on domain revision. |
boolean |
isSatisfied()
Semantic:
Testing if the constraint is satisfied. |
void |
propagate()
Propagates the constraint awake events. |
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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
n
protected int n
InverseChanneling
public InverseChanneling(IntDomainVar[] allVars,
int n)
- link x and y so that x[i] = j <=> y[j] = i
It is used to maintain both model on permutation problems
propagate
public void propagate()
throws ContradictionException
- Description copied from class:
AbstractLargeIntConstraint
- Propagates the constraint awake events.
- Specified by:
propagate
in interface Propagator
- Overrides:
propagate
in class AbstractLargeIntConstraint
- Throws:
ContradictionException
awakeOnInf
public void awakeOnInf(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on improved lower bound: propagation on domain revision.
- Specified by:
awakeOnInf
in interface IntVarEventListener
- Overrides:
awakeOnInf
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnSup
public void awakeOnSup(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on improved upper bound: propagation on domain revision.
- Specified by:
awakeOnSup
in interface IntVarEventListener
- Overrides:
awakeOnSup
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on instantiation: full constraint re-propagation.
- Specified by:
awakeOnInst
in interface IntVarEventListener
- Overrides:
awakeOnInst
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnRem
public void awakeOnRem(int idx,
int x)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on one value removal: propagation on domain revision.
- Specified by:
awakeOnRem
in interface IntVarEventListener
- Overrides:
awakeOnRem
in class AbstractIntConstraint
- 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.