|
||||||||||
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.global.Occurrence
public final class Occurrence
Field Summary | |
---|---|
boolean |
constrainOnInfNumber
|
boolean |
constrainOnSupNumber
|
int |
nbListVars
|
IStateInt |
nbPossible
Store the number of variables which can still take the occurence value |
IStateInt |
nbSure
Store the number of variables which are instantiated to the occurence value |
IntDomainVar[] |
relevantVar
|
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 | |
---|---|
Occurrence(IntDomainVar[] vars,
int occval,
boolean onInf,
boolean onSup,
IEnvironment environment)
Constructor, API: should be used through the Model.createOccurrence API Define an occurence constraint setting size{forall v in lvars | v = occval} <= or >= or = occVar assumes the occVar variable to be the last of the variables of the constraint: vars = [lvars | occVar] with lvars = list of variables for which the occurence of occval in their domain is constrained |
Method Summary | |
---|---|
void |
awake()
Propagation: Propagating the constraint for the very first time until local consistency is reached. |
void |
awakeOnInf(int idx)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int idx)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRemovals(int idx,
DisposableIntIterator deltaDomain)
The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally. |
void |
awakeOnSup(int idx)
Default propagation on improved upper bound: propagation on domain revision. |
void |
checkNbPossible()
|
void |
checkNbSure()
|
void |
filter()
|
int |
getFilteredEventMask(int idx)
|
void |
init(int occval,
boolean onInf,
boolean onSup,
IEnvironment environment)
|
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 ! |
String |
pretty()
pretty printing of the object. |
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRem, 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, 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 IStateInt nbPossible
public IStateInt nbSure
public boolean constrainOnInfNumber
public boolean constrainOnSupNumber
public IntDomainVar[] relevantVar
public int nbListVars
Constructor Detail |
---|
public Occurrence(IntDomainVar[] vars, int occval, boolean onInf, boolean onSup, IEnvironment environment)
vars
- variablesoccval
- checking valueonInf
- if true, constraint insures size{forall v in lvars | v = occval} >= occVaronSup
- if true, constraint insure size{forall v in lvars | v = occval} <= occVarenvironment
- Method Detail |
---|
public void init(int occval, boolean onInf, boolean onSup, IEnvironment environment)
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
public void awakeOnInf(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
ContradictionException
public void awakeOnInst(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
ContradictionException
public void awakeOnRemovals(int idx, DisposableIntIterator deltaDomain) throws ContradictionException
AbstractIntSConstraint
awakeOnRemovals
in interface IntPropagator
awakeOnRemovals
in class AbstractIntSConstraint
ContradictionException
public boolean isSatisfied(int[] tuple)
AbstractIntSConstraint
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
public void checkNbPossible() throws ContradictionException
ContradictionException
public void checkNbSure() throws ContradictionException
ContradictionException
public void filter() throws ContradictionException
ContradictionException
public void propagate() throws ContradictionException
Propagator
propagate
in class Propagator
ContradictionException
- contradiction exceptionpublic void awake() throws ContradictionException
Propagator
awake
in class Propagator
ContradictionException
- contradiction exceptionpublic Boolean isEntailed()
AbstractSConstraint
isEntailed
in class AbstractSConstraint<IntDomainVar>
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 |