|
||||||||||
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<Var>
choco.kernel.solver.constraints.set.AbstractMixedSetIntSConstraint
choco.kernel.solver.constraints.set.AbstractLargeSetIntSConstraint
choco.cp.solver.constraints.set.AbstractBoundOfASet
public abstract class AbstractBoundOfASet
An abstract class used for MaxOfASet and MinOfaSet constraints
Nested Class Summary | |
---|---|
static class |
AbstractBoundOfASet.EmptySetPolicy
|
Field Summary | |
---|---|
static int |
BOUND_INDEX
Index of the maximum variable. |
static int |
SET_INDEX
Index of the set 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.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 | |
---|---|
AbstractBoundOfASet(IEnvironment environment,
IntDomainVar[] intvars,
SetVar setvar,
AbstractBoundOfASet.EmptySetPolicy emptySetPolicy)
|
Method Summary | |
---|---|
void |
awakeOnEnvRemovals(int idx,
DisposableIntIterator deltaDomain)
BEWARE: No need to dipose the iterator, this done in the calling methode |
void |
awakeOnInst(int idx)
Propagation when a variable is instantiated. |
protected abstract void |
awakeOnKer()
|
void |
awakeOnKer(int varIdx,
int x)
Default propagation on kernel modification: propagation on adding a value to the kernel. |
void |
awakeOnkerAdditions(int idx,
DisposableIntIterator deltaDomain)
BEWARE: No need to dipose the iterator, this done in the calling methode |
protected abstract void |
awakeOnRem()
|
void |
awakeOnRem(int varIdx,
int val)
Default propagation on one value removal: propagation on domain revision. |
protected abstract void |
filter()
|
int |
getFilteredEventMask(int idx)
|
protected abstract int |
getSatisfiedValue(DisposableIntIterator iter)
|
protected SetDomain |
getSetDomain()
|
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
protected boolean |
isEmptySet()
|
protected boolean |
isInEnveloppe(int idx)
|
protected boolean |
isInKernel(int idx)
|
protected boolean |
isNotEmptySet()
|
boolean |
isSatisfied()
Semantic: Testing if the constraint is satisfied. |
protected boolean |
isSetInstantiated()
|
protected void |
onlyOneCandidatePropagation()
If only one candidate to be the max of the list, some additionnal propagation can be performed (as in usual x == y constraint). |
protected String |
pretty(String name)
|
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
protected boolean |
remFromEnveloppe()
|
protected abstract boolean |
removeFromEnv(int idx)
|
protected boolean |
removeGreaterFromEnv(int idx,
int maxValue)
|
protected boolean |
removeLowerFromEnv(int idx,
int minValue)
|
protected boolean |
updateBoundInf(int val)
|
protected boolean |
updateBoundSup(int val)
|
protected abstract int |
updateIndexOfCandidateVariable()
|
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, awakeOnInf, awakeOnRemovals, awakeOnSup, 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, pretty, 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 SET_INDEX
public static final int BOUND_INDEX
public static final int VARS_OFFSET
Constructor Detail |
---|
public AbstractBoundOfASet(IEnvironment environment, IntDomainVar[] intvars, SetVar setvar, AbstractBoundOfASet.EmptySetPolicy emptySetPolicy)
Method Detail |
---|
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
protected final boolean isInKernel(int idx)
protected final boolean isInEnveloppe(int idx)
protected final SetDomain getSetDomain()
protected final boolean isEmptySet()
protected final boolean isNotEmptySet()
protected final boolean isSetInstantiated()
protected final boolean updateBoundInf(int val) throws ContradictionException
ContradictionException
protected final boolean updateBoundSup(int val) throws ContradictionException
ContradictionException
protected abstract boolean removeFromEnv(int idx) throws ContradictionException
ContradictionException
protected final boolean removeGreaterFromEnv(int idx, int maxValue) throws ContradictionException
ContradictionException
protected final boolean removeLowerFromEnv(int idx, int minValue) throws ContradictionException
ContradictionException
protected final boolean remFromEnveloppe() throws ContradictionException
ContradictionException
public final void awakeOnEnvRemovals(int idx, DisposableIntIterator deltaDomain) throws ContradictionException
SetPropagator
awakeOnEnvRemovals
in interface SetPropagator
awakeOnEnvRemovals
in class AbstractMixedSetIntSConstraint
ContradictionException
public final void awakeOnRem(int varIdx, int val) throws ContradictionException
AbstractMixedSetIntSConstraint
awakeOnRem
in interface IntPropagator
awakeOnRem
in class AbstractMixedSetIntSConstraint
ContradictionException
protected abstract void awakeOnRem() throws ContradictionException
ContradictionException
public final void awakeOnkerAdditions(int idx, DisposableIntIterator deltaDomain) throws ContradictionException
SetPropagator
awakeOnkerAdditions
in interface SetPropagator
awakeOnkerAdditions
in class AbstractMixedSetIntSConstraint
ContradictionException
public final void awakeOnKer(int varIdx, int x) throws ContradictionException
SetPropagator
awakeOnKer
in interface SetPropagator
awakeOnKer
in class AbstractMixedSetIntSConstraint
ContradictionException
protected abstract void awakeOnKer() throws ContradictionException
ContradictionException
public boolean isConsistent()
AbstractMixedSetIntSConstraint
isConsistent
in class AbstractMixedSetIntSConstraint
public final void propagate() throws ContradictionException
Propagator
propagate
in class Propagator
ContradictionException
- contradiction exceptionprotected abstract void filter() throws ContradictionException
ContradictionException
public final void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in interface SetPropagator
awakeOnInst
in class AbstractMixedSetIntSConstraint
idx
- the index of the modified variable.
ContradictionException
- if a domain becomes empty.protected abstract int updateIndexOfCandidateVariable()
protected void onlyOneCandidatePropagation() throws ContradictionException
ContradictionException
protected abstract int getSatisfiedValue(DisposableIntIterator iter)
public boolean isSatisfied()
SConstraint
protected String pretty(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |