choco.cp.solver.constraints.set
Class MaxOfASet

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.MaxOfASet
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<Var>, IntPropagator, SetPropagator, Cloneable, EventListener

public final class MaxOfASet
extends AbstractBoundOfASet

Implements a constraint X = max(Y_i | i \in S). I only modified the maxOfAList constraint

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
 
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
MaxOfASet(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 maxInf()
           
protected  int maxSup()
           
 String pretty()
          pretty printing of the object.
protected  boolean removeFromEnv(int idx)
           
protected  int updateIndexOfCandidateVariable()
           
protected  void updateKernelSup()
           
 
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
 

Constructor Detail

MaxOfASet

public MaxOfASet(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

maxInf

protected final int maxInf()

maxSup

protected final int maxSup()

updateKernelSup

protected final void updateKernelSup()
                              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.