|
||||||||||
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.BoundGccVar
choco.cp.solver.constraints.global.BoundGcc
public final class BoundGcc
A constraint to enforce BoundConsistency on a global cardinality based on the implementation of : C.-G. Quimper, P. van Beek, A. Lopez-Ortiz, A. Golynski, and S.B. Sadjad. An efficient bounds consistency algorithm for the global cardinality constraint. CP-2003.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class choco.cp.solver.constraints.global.BoundGccVar |
---|
BoundGccVar.Interval |
Field Summary |
---|
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 | |
---|---|
BoundGcc(IntDomainVar[] vars,
int firstDomainValue,
int lastDomainValue,
int[] minOccurrences,
int[] maxOccurrences,
IEnvironment environment)
Bound Global cardinality : Given an array of variables vars, min the minimal value over all variables, and max the maximal value over all variables, the constraint ensures that the number of occurences of the value i among the variables is between low[i - min] and up[i - min]. |
Method Summary | |
---|---|
void |
awake()
Propagation: Propagating the constraint for the very first time until local consistency is reached. |
void |
awakeOnInf(int i)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int i)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRem(int idx,
int val)
Only maintain the data structure and update upperbounds of card |
void |
awakeOnSup(int i)
Default propagation on improved upper bound: propagation on domain revision. |
boolean |
directInconsistentCount()
|
int |
getMaxOcc(int i)
|
int |
getMinOcc(int i)
|
protected void |
init()
|
Boolean |
isEntailed()
Indicates if the constraint is entailed, from now on will be always satisfied |
boolean |
isSatisfied()
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple) |
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.cp.solver.constraints.global.BoundGccVar |
---|
dynamicInitOfPartialSum, filterBCOnInf, filterBCOnInst, filterBCOnRem, filterBCOnSup, filterLowerMax, filterLowerMin, filterUpperMax, filterUpperMin, initBackDataStruct, makeVarTable, pathmax, pathmin, pathset, propagateSumCard, sortIt |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRemovals, getConstraintType, isConsistent |
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, getFilteredEventMask, 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 |
---|
public BoundGcc(IntDomainVar[] vars, int firstDomainValue, int lastDomainValue, int[] minOccurrences, int[] maxOccurrences, IEnvironment environment)
Method Detail |
---|
public int getMaxOcc(int i)
getMaxOcc
in class BoundGccVar
public int getMinOcc(int i)
getMinOcc
in class BoundGccVar
protected void init()
init
in class BoundGccVar
public void awake() throws ContradictionException
Propagator
awake
in class BoundGccVar
ContradictionException
- contradiction exceptionpublic boolean directInconsistentCount()
directInconsistentCount
in class BoundGccVar
public void propagate() throws ContradictionException
Propagator
propagate
in class BoundGccVar
ContradictionException
- contradiction exceptionpublic void awakeOnInf(int i) throws ContradictionException
AbstractIntSConstraint
awakeOnInf
in interface IntPropagator
awakeOnInf
in class BoundGccVar
ContradictionException
public void awakeOnSup(int i) throws ContradictionException
AbstractIntSConstraint
awakeOnSup
in interface IntPropagator
awakeOnSup
in class BoundGccVar
ContradictionException
public void awakeOnInst(int i) throws ContradictionException
AbstractIntSConstraint
awakeOnInst
in interface IntPropagator
awakeOnInst
in class BoundGccVar
ContradictionException
public void awakeOnRem(int idx, int val) throws ContradictionException
BoundGccVar
awakeOnRem
in interface IntPropagator
awakeOnRem
in class BoundGccVar
ContradictionException
public boolean isSatisfied()
AbstractIntSConstraint
isSatisfied
in interface SConstraint<IntDomainVar>
isSatisfied
in class AbstractIntSConstraint
public boolean isSatisfied(int[] tuple)
AbstractIntSConstraint
isSatisfied
in interface IntPropagator
isSatisfied
in class BoundGccVar
public String pretty()
IPretty
pretty
in interface IPretty
pretty
in class BoundGccVar
public Boolean isEntailed()
AbstractSConstraint
isEntailed
in class BoundGccVar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |