choco.cp.solver.constraints.set
Class MinOfASet

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.AbstractLargeSetIntSConstraint
                  extended by choco.cp.solver.constraints.set.AbstractBoundOfASet
                      extended by choco.cp.solver.constraints.set.MinOfASet
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<Var>, IntPropagator, SetPropagator, Cloneable, EventListener

public final class MinOfASet
extends AbstractBoundOfASet

Since:
8 déc. 2008 version 2.0.1
Version:
2.0.1
Author:
Arnaud Malapert

Nested Class Summary
 
Nested classes/interfaces inherited from class choco.cp.solver.constraints.set.AbstractBoundOfASet
AbstractBoundOfASet.EmptySetPolicy
 
Field Summary
protected  IStateInt indexOfMinimumVariable
          Index of the minimum variable.
 
Fields inherited from class choco.cp.solver.constraints.set.AbstractBoundOfASet
BOUND_INDEX, SET_INDEX, VARS_OFFSET
 
Fields inherited from class choco.kernel.solver.constraints.set.AbstractLargeSetIntSConstraint
ivars, svars
 
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
MinOfASet(IEnvironment environment, IntDomainVar[] intvars, SetVar setvar, AbstractBoundOfASet.EmptySetPolicy emptySetPolicy)
           
 
Method Summary
 void awakeOnInf(int idx)
          Propagation when lower bound is increased.
 void awakeOnKer()
           
 void awakeOnRem()
           
 void awakeOnSup(int idx)
          Propagation when upper bound is decreased.
 void filter()
          Propagation of the constraint.
protected  int getSatisfiedValue(DisposableIntIterator iter)
           
protected  int minInf()
           
protected  int minSup()
           
 String pretty()
          pretty printing of the object.
protected  boolean removeFromEnv(int idx)
           
protected  int updateIndexOfCandidateVariable()
           
protected  void updateKernelInf()
           
 
Methods inherited from class choco.cp.solver.constraints.set.AbstractBoundOfASet
awakeOnEnvRemovals, awakeOnInst, awakeOnKer, awakeOnkerAdditions, awakeOnRem, getFilteredEventMask, getSetDomain, isConsistent, isEmptySet, isInEnveloppe, isInKernel, isNotEmptySet, isSatisfied, isSetInstantiated, onlyOneCandidatePropagation, pretty, propagate, remFromEnveloppe, removeGreaterFromEnv, removeLowerFromEnv, updateBoundInf, updateBoundSup
 
Methods inherited from class choco.kernel.solver.constraints.set.AbstractLargeSetIntSConstraint
getIntVarIndex, getNbIntVars, getNbSetVars, isIntVarIndex, isSetVarIndex
 
Methods inherited from class choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
awakeOnBounds, awakeOnEnv, awakeOnRemovals, getConstraintType, 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, 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

indexOfMinimumVariable

protected final IStateInt indexOfMinimumVariable
Index of the minimum variable.

Constructor Detail

MinOfASet

public MinOfASet(IEnvironment environment,
                 IntDomainVar[] intvars,
                 SetVar setvar,
                 AbstractBoundOfASet.EmptySetPolicy emptySetPolicy)
Method Detail

removeFromEnv

protected boolean removeFromEnv(int idx)
                         throws ContradictionException
Specified by:
removeFromEnv in class AbstractBoundOfASet
Throws:
ContradictionException

updateIndexOfCandidateVariable

protected int updateIndexOfCandidateVariable()
Specified by:
updateIndexOfCandidateVariable in class AbstractBoundOfASet

minInf

protected final int minInf()

minSup

protected final int minSup()

updateKernelInf

protected final void updateKernelInf()
                              throws ContradictionException
Throws:
ContradictionException

filter

public void filter()
            throws ContradictionException
Propagation of the constraint.

Specified by:
filter in class AbstractBoundOfASet
Throws:
ContradictionException - if a domain becomes empty.

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Propagation when lower bound is increased.

Specified by:
awakeOnInf in interface IntPropagator
Overrides:
awakeOnInf in class AbstractMixedSetIntSConstraint
Parameters:
idx - the index of the modified variable.
Throws:
ContradictionException - if a domain becomes empty.

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Propagation when upper bound is decreased.

Specified by:
awakeOnSup in interface IntPropagator
Overrides:
awakeOnSup in class AbstractMixedSetIntSConstraint
Parameters:
idx - the index of the modified variable.
Throws:
ContradictionException - if a domain becomes empty.

awakeOnRem

public void awakeOnRem()
                throws ContradictionException
Specified by:
awakeOnRem in class AbstractBoundOfASet
Throws:
ContradictionException

awakeOnKer

public void awakeOnKer()
                throws ContradictionException
Specified by:
awakeOnKer in class AbstractBoundOfASet
Throws:
ContradictionException

getSatisfiedValue

protected int getSatisfiedValue(DisposableIntIterator iter)
Specified by:
getSatisfiedValue in class AbstractBoundOfASet

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.