choco.cp.solver.constraints.set
Class NotMemberX

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<SetVar>
          extended by choco.kernel.solver.constraints.set.AbstractSetSConstraint
              extended by choco.kernel.solver.constraints.set.AbstractLargeSetSConstraint
                  extended by choco.kernel.solver.constraints.set.AbstractUnSetSConstraint
                      extended by choco.cp.solver.constraints.set.NotMemberX
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<SetVar>, SetPropagator, Cloneable, EventListener

public final class NotMemberX
extends AbstractUnSetSConstraint

Ensure that a value will not belong to a setVar


Field Summary
protected  int cste
           
 
Fields inherited from class choco.kernel.solver.constraints.set.AbstractUnSetSConstraint
v0
 
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint
cIndices, constraintType, extensions, vars
 
Fields inherited from class choco.kernel.solver.propagation.Propagator
active, constAwakeEvent, priority, propagationEngine
 
Fields inherited from interface choco.kernel.solver.constraints.SConstraint
LOGGER
 
Constructor Summary
NotMemberX(SetVar v, int val)
           
 
Method Summary
 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.
 Object clone()
          Clone the constraint
 int getFilteredEventMask(int idx)
           
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 Boolean isEntailed()
          Checks if the listeners must be checked or must fail.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 AbstractSConstraint<SetVar> opposite(Solver solver)
          Get the opposite constraint
 String pretty()
          pretty printing of the object.
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 String toString()
           
 
Methods inherited from class choco.kernel.solver.constraints.set.AbstractSetSConstraint
awakeOnEnvRemovals, awakeOnkerAdditions, getConstraintType
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, setConstraintIndex, setExtension, setVar
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, awake, constAwake, fail, getEvent, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cste

protected int cste
Constructor Detail

NotMemberX

public NotMemberX(SetVar v,
                  int val)
Method Detail

getFilteredEventMask

public int getFilteredEventMask(int idx)
Overrides:
getFilteredEventMask in class Propagator

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: AbstractSConstraint
Clone the constraint

Overrides:
clone in class AbstractSConstraint<SetVar>
Returns:
the clone of the constraint
Throws:
CloneNotSupportedException - Clone not supported exception

propagate

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

Specified by:
propagate in class Propagator
Throws:
ContradictionException - contradiction exception

awakeOnInst

public void awakeOnInst(int varIdx)
                 throws ContradictionException
Description copied from interface: SetPropagator
Default propagation on instantiation.

Specified by:
awakeOnInst in interface SetPropagator
Overrides:
awakeOnInst in class AbstractSetSConstraint
Throws:
ContradictionException

awakeOnEnv

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

Specified by:
awakeOnEnv in interface SetPropagator
Overrides:
awakeOnEnv in class AbstractSetSConstraint
Throws:
ContradictionException

awakeOnKer

public void awakeOnKer(int varIdx,
                       int x)
                throws ContradictionException
Description copied from interface: SetPropagator
Default propagation on kernel modification: propagation on adding a value to the kernel.

Specified by:
awakeOnKer in interface SetPropagator
Overrides:
awakeOnKer in class AbstractSetSConstraint
Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
Description copied from interface: SConstraint
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.

Returns:
true if the constraint is satisfied

isConsistent

public boolean isConsistent()
Description copied from class: Propagator
tests if the constraint is consistent with respect to the current state of domains

Specified by:
isConsistent in class Propagator
Returns:
wether the constraint is consistent

toString

public String toString()
Overrides:
toString in class AbstractSConstraint<SetVar>

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<SetVar>
Returns:
a readable string representation of the object

isEntailed

public Boolean isEntailed()
Checks if the listeners must be checked or must fail.

Overrides:
isEntailed in class AbstractSConstraint<SetVar>
Returns:
wether the constraint is entailed

opposite

public AbstractSConstraint<SetVar> opposite(Solver solver)
Description copied from class: AbstractSConstraint
Get the opposite constraint

Specified by:
opposite in interface SConstraint<SetVar>
Overrides:
opposite in class AbstractSConstraint<SetVar>
Parameters:
solver - the current solver
Returns:
the opposite constraint @param solver


Copyright © 2012. All Rights Reserved.