choco.cp.solver.constraints.set
Class AmongSet

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.cp.solver.constraints.set.AmongSet
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<Var>, IntPropagator, SetPropagator, Cloneable, EventListener

public final class AmongSet
extends AbstractMixedSetIntSConstraint

User : cprudhom Mail : cprudhom(a)emn.fr Date : 23 f�vr. 2010 Since : Choco 2.1.1

NVAR is the number of variables of the collection VARIABLES that take their value in SVAR.

Propagator : C. Bessi�re, E. Hebrard, B. Hnich, Z. Kiziltan, T. Walsh, Among, common and disjoint Constraints CP-2005


Field Summary
 
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
AmongSet(Var[] vars, IEnvironment environment)
          Constructs a constraint with the specified priority.
 
Method Summary
 void awake()
          Propagation: Propagating the constraint for the very first time until local consistency is reached.
 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.
 void awakeOnRem(int varIdx, int val)
          Default propagation on one value removal: propagation on domain revision.
 int getFilteredEventMask(int idx)
           
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 String pretty()
          pretty printing of the object.
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 
Methods inherited from class choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
awakeOnBounds, awakeOnEnvRemovals, awakeOnInf, awakeOnkerAdditions, awakeOnRemovals, awakeOnSup, getConstraintType, isConsistent, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, 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

AmongSet

public AmongSet(Var[] vars,
                IEnvironment environment)
Constructs a constraint with the specified priority.

Method Detail

getFilteredEventMask

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

awake

public void awake()
           throws ContradictionException
Propagation: Propagating the constraint for the very first time until local consistency is reached.

Overrides:
awake in class Propagator
Throws:
ContradictionException - contradiction exception

propagate

public void propagate()
               throws ContradictionException
Propagation: Propagating the constraint until local consistency is reached.

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

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

awakeOnRem

public void awakeOnRem(int varIdx,
                       int val)
                throws ContradictionException
Default propagation on one value removal: propagation on domain revision.

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

isSatisfied

public boolean isSatisfied()
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

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


Copyright © 2012. All Rights Reserved.