|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
choco.cp.solver.constraints.integer.MaxOfAList
public final class MaxOfAList
Implements a constraint X = max(Y_0, Y_1...Y_n).
Field Summary | |
---|---|
protected IStateInt |
indexOfMaximumVariable
Index of the maximum variable. |
static int |
MAX_INDEX
Index of the maximum variable. |
static int |
VARS_OFFSET
First index of the variables among which the maximum should be chosen. |
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 | |
---|---|
MaxOfAList(IEnvironment environment,
IntDomainVar[] vars)
|
Method Summary | |
---|---|
void |
awakeOnInf(int idx)
Propagation when lower bound is increased. |
void |
awakeOnInst(int idx)
Propagation when a variable is instantiated. |
void |
awakeOnSup(int idx)
Propagation when upper bound is decreased. |
int |
getFilteredEventMask(int idx)
|
Boolean |
isEntailed()
Indicates if the constraint is entailed, from now on will be always satisfied |
boolean |
isSatisfied(int[] tuple)
TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet ! |
protected int |
maxInf()
|
protected int |
maxSup()
|
protected void |
onlyOneMaxCandidatePropagation()
If only one candidate to be the max of the list, some additionnal propagation can be performed (as in usual x == y constraint). |
String |
pretty()
pretty printing of the object. |
void |
propagate()
Propagation of the constraint. |
protected boolean |
testIfOneCandidateToTakeMaxValue()
Checks if one of the variables in the list is instantiated to the max. |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRem, awakeOnRemovals, getConstraintType, isConsistent, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, 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 |
---|
public static final int MAX_INDEX
public static final int VARS_OFFSET
protected final IStateInt indexOfMaximumVariable
Constructor Detail |
---|
public MaxOfAList(IEnvironment environment, IntDomainVar[] vars)
Method Detail |
---|
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
protected void onlyOneMaxCandidatePropagation() throws ContradictionException
ContradictionException
protected boolean testIfOneCandidateToTakeMaxValue()
protected final int maxInf()
protected final int maxSup()
public void propagate() throws ContradictionException
propagate
in class Propagator
ContradictionException
- if a domain becomes empty.public void awakeOnInf(int idx) throws ContradictionException
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
idx
- the index of the modified variable.
ContradictionException
- if a domain becomes empty.public void awakeOnSup(int idx) throws ContradictionException
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
idx
- the index of the modified variable.
ContradictionException
- if a domain becomes empty.public void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
idx
- the index of the modified variable.
ContradictionException
- if a domain becomes empty.public Boolean isEntailed()
AbstractSConstraint
isEntailed
in class AbstractSConstraint<IntDomainVar>
public boolean isSatisfied(int[] tuple)
AbstractIntSConstraint
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
public String pretty()
IPretty
pretty
in interface IPretty
pretty
in class AbstractSConstraint<IntDomainVar>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |