choco.palm.real.constraints
Class PalmMixedEqXY
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.real.constraint.AbstractBinRealIntConstraint
choco.real.constraint.MixedEqXY
choco.palm.real.constraints.PalmMixedEqXY
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, PalmIntVarListener, PalmVarListener, PalmMixedConstraint, PalmRealVarListener, VarEventListener, Propagator, MixedConstraint, RealListener, java.lang.Cloneable, java.util.EventListener
public class PalmMixedEqXY
- extends MixedEqXY
- implements PalmMixedConstraint
Method Summary |
void |
awakeOnRemovals(int varIdx,
IntIterator deltaDomain)
|
void |
awakeOnRestoreInf(int idx)
Handles an inf bound restoration on the constraint idx |
void |
awakeOnRestoreSup(int idx)
Handles a sup bound restoration on the constraint idx |
void |
awakeOnRestoreVal(int idx,
int val)
Handles a val restoration on the constraint idx |
void |
awakeOnRestoreVal(int idx,
IntIterator it)
Handles a val restoration on the constraint idx |
java.lang.Object |
clone()
returns a copy of the constraint. |
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. |
protected void |
updateIInf()
|
protected void |
updateISup()
|
protected void |
updateReal()
|
java.util.Set |
whyIsFalse()
When all variables are instantiated, explains why the wonstraint is false. |
java.util.Set |
whyIsTrue()
When all variables are instantiated, explains why the wonstraint is true. |
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 |
PalmMixedEqXY
public PalmMixedEqXY(RealVar v0,
IntDomainVar v1)
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 MixedEqXY
- Returns:
-
- Throws:
java.lang.CloneNotSupportedException
updateIInf
protected void updateIInf()
throws ContradictionException
- Overrides:
updateIInf
in class MixedEqXY
- Throws:
ContradictionException
updateISup
protected void updateISup()
throws ContradictionException
- Overrides:
updateISup
in class MixedEqXY
- Throws:
ContradictionException
updateReal
protected void updateReal()
throws ContradictionException
- Overrides:
updateReal
in class MixedEqXY
- Throws:
ContradictionException
awakeOnRemovals
public void awakeOnRemovals(int varIdx,
IntIterator deltaDomain)
throws ContradictionException
- Specified by:
awakeOnRemovals
in interface IntConstraint
- Overrides:
awakeOnRemovals
in class MixedEqXY
- Throws:
ContradictionException
awakeOnRestoreInf
public void awakeOnRestoreInf(int idx)
throws ContradictionException
- Description copied from interface:
PalmIntVarListener
- Handles an inf bound restoration on the constraint
idx
- Specified by:
awakeOnRestoreInf
in interface PalmIntVarListener
- Specified by:
awakeOnRestoreInf
in interface PalmRealVarListener
- Parameters:
idx
- Variable involved.
- Throws:
ContradictionException
- if a contradiction occurs
awakeOnRestoreSup
public void awakeOnRestoreSup(int idx)
throws ContradictionException
- Description copied from interface:
PalmIntVarListener
- Handles a sup bound restoration on the constraint
idx
- Specified by:
awakeOnRestoreSup
in interface PalmIntVarListener
- Specified by:
awakeOnRestoreSup
in interface PalmRealVarListener
- Parameters:
idx
- Variable involved.
- Throws:
ContradictionException
- if a contradiction occurs
awakeOnRestoreVal
public void awakeOnRestoreVal(int idx,
int val)
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
awakeOnRestoreVal
public void awakeOnRestoreVal(int idx,
IntIterator it)
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
whyIsTrue
public java.util.Set whyIsTrue()
- Description copied from interface:
PalmIntVarListener
- When all variables are instantiated, explains why the wonstraint is true.
- Specified by:
whyIsTrue
in interface PalmIntVarListener
- Returns:
- A set of constraint justifying that the constraint is satisfied.
whyIsFalse
public java.util.Set whyIsFalse()
- Description copied from interface:
PalmIntVarListener
- When all variables are instantiated, explains why the wonstraint is false.
- Specified by:
whyIsFalse
in interface PalmIntVarListener
- Returns:
- A set of constraint justifying that the constraint is not satisfied.
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).