choco.integer.constraints.extension
Class CspLargeConstraint
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractLargeIntConstraint
choco.integer.constraints.extension.CspLargeConstraint
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- GAC2001LargeConstraint
public class CspLargeConstraint
- extends AbstractLargeIntConstraint
Method Summary |
void |
awakeOnBounds(int varIndex)
|
void |
awakeOnInst(int idx)
Default propagation on instantiation: full constraint re-propagation. |
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. |
java.lang.Object |
clone()
returns a copy of the constraint. |
LargeRelation |
getRelation()
|
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. |
AbstractConstraint |
opposite()
computes the constraint modelling the counter-opposite condition of this |
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, isEquivalentTo, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
relation
protected LargeRelation relation
currentTuple
protected int[] currentTuple
CspLargeConstraint
public CspLargeConstraint(IntDomainVar[] vs,
LargeRelation relation)
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 AbstractLargeIntConstraint
- Returns:
-
- Throws:
java.lang.CloneNotSupportedException
getRelation
public LargeRelation getRelation()
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
awakeOnRemovals
public void awakeOnRemovals(int idx,
IntIterator deltaDomain)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- 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
- Overrides:
awakeOnRemovals
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnBounds
public void awakeOnBounds(int varIndex)
throws ContradictionException
- Specified by:
awakeOnBounds
in interface IntConstraint
- Overrides:
awakeOnBounds
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
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.
opposite
public AbstractConstraint opposite()
- Description copied from interface:
Constraint
- computes the constraint modelling the counter-opposite condition of this
- Specified by:
opposite
in interface Constraint
- Overrides:
opposite
in class AbstractConstraint
- Returns:
- a new constraint (modelling the opposite condition)
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