choco.integer.constraints
Class Element
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractBinIntConstraint
choco.integer.constraints.Element
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
public class Element
- extends AbstractBinIntConstraint
Method Summary |
void |
awake()
Default initial propagation: full constraint re-propagation. |
void |
awakeOnInf(int i)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int i)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRem(int i,
int x)
Default propagation on one value removal: propagation on domain revision. |
void |
awakeOnSup(int i)
Default propagation on improved upper bound: propagation on domain revision. |
java.lang.Object |
clone()
returns a copy of the constraint. |
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. |
java.lang.String |
pretty()
pretty printing of the object. |
java.lang.String |
toString()
|
protected void |
updateIndexFromValue()
|
protected void |
updateValueFromIndex()
|
Methods inherited from class choco.AbstractConstraint |
addListener, awakeOnVar, 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, wait, wait, wait |
Element
public Element(IntDomainVar index,
int[] values,
IntDomainVar var,
int offset)
Element
public Element(IntDomainVar index,
int[] values,
IntDomainVar var)
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 AbstractConstraint
- Returns:
-
- Throws:
java.lang.CloneNotSupportedException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
pretty
public java.lang.String pretty()
- Description copied from interface:
Entity
- pretty printing of the object. This String is not constant and may depend on the context.
- Specified by:
pretty
in interface Entity
- Overrides:
pretty
in class AbstractEntity
- Returns:
- a readable string representation of the object
updateValueFromIndex
protected void updateValueFromIndex()
throws ContradictionException
- Throws:
ContradictionException
updateIndexFromValue
protected void updateIndexFromValue()
throws ContradictionException
- Throws:
ContradictionException
awake
public void awake()
throws ContradictionException
- Description copied from class:
AbstractConstraint
- Default initial propagation: full constraint re-propagation.
- Specified by:
awake
in interface Propagator
- Overrides:
awake
in class AbstractConstraint
- Throws:
ContradictionException
awakeOnInf
public void awakeOnInf(int i)
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 i)
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 i)
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 i,
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
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
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.