choco.cp.solver.constraints.set
Class NotMemberXY

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<Var>
          extended by choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
              extended by choco.kernel.solver.constraints.set.AbstractBinSetIntSConstraint
                  extended by choco.cp.solver.constraints.set.NotMemberXY
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<Var>, IntPropagator, SetPropagator, Cloneable, EventListener

public final class NotMemberXY
extends AbstractBinSetIntSConstraint

Ensure that an int variable does not belong to a set variable


Field Summary
 
Fields inherited from class choco.kernel.solver.constraints.set.AbstractBinSetIntSConstraint
v0, v1
 
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
NotMemberXY(SetVar set, IntDomainVar iv)
           
 
Method Summary
 void awakeOnEnv(int varIdx, int x)
          Default propagation on enveloppe modification: propagation on removing a value from the enveloppe.
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 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.
 void awakeOnRem(int idx, int x)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
 void filter()
          if only one value out of the kernel, then this value can be removed from the enveloppe
 int getFilteredEventMask(int idx)
           
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 Boolean isEntailed()
          Indicates if the constraint is entailed, from now on will be always satisfied
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 AbstractSConstraint<Var> 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.AbstractBinSetIntSConstraint
getIntVar, getSetVar
 
Methods inherited from class choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
awakeOnBounds, awakeOnEnvRemovals, awakeOnkerAdditions, awakeOnRemovals, getConstraintType, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, 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
 

Constructor Detail

NotMemberXY

public NotMemberXY(SetVar set,
                   IntDomainVar iv)
Method Detail

getFilteredEventMask

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

filter

public void filter()
            throws ContradictionException
if only one value out of the kernel, then this value can be removed from the enveloppe

Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Description copied from class: AbstractMixedSetIntSConstraint
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntPropagator
Overrides:
awakeOnInf in class AbstractMixedSetIntSConstraint
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Description copied from class: AbstractMixedSetIntSConstraint
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntPropagator
Overrides:
awakeOnSup in class AbstractMixedSetIntSConstraint
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int idx,
                       int x)
                throws ContradictionException
Description copied from class: AbstractMixedSetIntSConstraint
Default propagation on one value removal: propagation on domain revision.

Specified by:
awakeOnRem in interface IntPropagator
Overrides:
awakeOnRem in class AbstractMixedSetIntSConstraint
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 AbstractMixedSetIntSConstraint
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 AbstractMixedSetIntSConstraint
Throws:
ContradictionException

awakeOnInst

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

Specified by:
awakeOnInst in interface IntPropagator
Specified by:
awakeOnInst in interface SetPropagator
Overrides:
awakeOnInst in class AbstractMixedSetIntSConstraint
Throws:
ContradictionException

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

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: AbstractMixedSetIntSConstraint
tests if the constraint is consistent with respect to the current state of domains

Overrides:
isConsistent in class AbstractMixedSetIntSConstraint
Returns:
wether the constraint is consistent

toString

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

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<Var>
Returns:
a readable string representation of the object

isEntailed

public Boolean isEntailed()
Description copied from class: AbstractSConstraint
Indicates if the constraint is entailed, from now on will be always satisfied

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

opposite

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

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


Copyright © 2012. All Rights Reserved.