choco.cp.solver.constraints.set
Class MaxOfASet
java.lang.Object
choco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<Var>
choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
choco.kernel.solver.constraints.set.AbstractLargeSetIntSConstraint
choco.cp.solver.constraints.set.AbstractBoundOfASet
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
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.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 |
MaxOfASet
public MaxOfASet(IEnvironment environment,
IntDomainVar[] intvars,
SetVar setvar,
AbstractBoundOfASet.EmptySetPolicy emptySetPolicy)
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.