choco.set.constraint
Class MemberX

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.set.constraint.AbstractSetConstraint
              extended by choco.set.constraint.AbstractUnSetConstraint
                  extended by choco.set.constraint.MemberX
All Implemented Interfaces:
Constraint, Entity, VarEventListener, Propagator, SetConstraint, SetVarEventListener, java.lang.Cloneable, java.util.EventListener

public class MemberX
extends AbstractUnSetConstraint

Enforce a value to belong to a setVar


Field Summary
protected  int cste
           
 
Fields inherited from class choco.set.constraint.AbstractUnSetConstraint
cIdx0, v0
 
Fields inherited from class choco.set.constraint.AbstractSetConstraint
logger
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
MemberX(SetVar v, int val)
           
 
Method Summary
 void awake()
          Default initial propagation: full constraint re-propagation.
 void awakeOnEnv(int varIdx, int x)
          Default propagation on enveloppe modification: propagation on removing a value from the enveloppe.
 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.
 java.lang.Object clone()
          returns a copy of the constraint.
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 java.lang.Boolean isEntailed()
          Checks if the listeners must be checked or must fail.
 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.set.constraint.AbstractUnSetConstraint
assignIndices, getConstraintIdx, getNbVars, getSetVar, getVar, isCompletelyInstantiated, setConstraintIndex, setVar
 
Methods inherited from class choco.set.constraint.AbstractSetConstraint
awakeOnEnvRemovals, awakeOnkerAdditions, getSelfIndex
 
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 choco.AbstractEntity
pretty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.Propagator
awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

cste

protected int cste
Constructor Detail

MemberX

public MemberX(SetVar v,
               int val)
Method Detail

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 AbstractUnSetConstraint
Returns:
Throws:
java.lang.CloneNotSupportedException

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

propagate

public void propagate()
               throws ContradictionException
Description copied from interface: Propagator
Propagation: Propagating the constraint until local consistency is reached.

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

awakeOnEnv

public void awakeOnEnv(int varIdx,
                       int x)
                throws ContradictionException
Description copied from interface: SetVarEventListener
Default propagation on enveloppe modification: propagation on removing a value from the enveloppe.

Specified by:
awakeOnEnv in interface SetVarEventListener
Overrides:
awakeOnEnv in class AbstractSetConstraint
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

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()
Checks if the listeners must be checked or must fail.

Specified by:
isEntailed in interface Propagator
Overrides:
isEntailed in class AbstractConstraint