|
||||||||||
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.kernel.solver.constraints.global.matching.AbstractBipartiteGraph
choco.kernel.solver.constraints.global.matching.AbstractBipartiteFlow
choco.cp.solver.constraints.global.matching.GlobalCardinality
public class GlobalCardinality
very simple version of the cardinality constraint where the values the set of values whose occurrences are counted in the interval (minValue .. maxValue)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
AbstractBipartiteGraph.IntQueue |
Field Summary |
---|
Fields inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteFlow |
---|
compatibleFlow, compatibleSupport, flow, maxFlow, minFlow |
Fields inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
component, componentOrder, currentComponent, currentNode, finishDate, left2rightArc, matchingSize, maxValue, minValue, nbLeftVertices, nbRightVertices, nbVertices, queue, refMatch, right2leftArc, seen, source, time |
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 | |
---|---|
GlobalCardinality(IntDomainVar[] vars,
int[] low,
int[] up,
IEnvironment environment)
Constructor, Global cardinality constraint API, short cut when smallest value equals 0 note : maxVal - minVal + 1 = low.length = up.length |
|
GlobalCardinality(IntDomainVar[] vars,
int minValue,
int maxValue,
int[] low,
int[] up,
IEnvironment environment)
Constructor, Global cardinality constraint API note : maxVal - minVal + 1 = valueMinOccurence.length = valueMaxOccurence.length |
Method Summary | |
---|---|
void |
awake()
performing the initial propagation, reduce variables domain to the candidate assign values |
void |
awakeOnInf(int idx)
update the reference matching before redoing the strongly connected components analysis when removing value in the domain of variable idx |
void |
awakeOnInst(int idx)
update the reference matching before redoing the strongly connected components analysis when idx is instantiated |
void |
awakeOnRem(int idx,
int x)
Implement reaction to edge removal |
void |
awakeOnSup(int idx)
update the reference matching before redoing the strongly connected components analysis when removing value in the domain of variable idx |
Object |
clone()
Clone the constraint |
void |
deleteEdgeAndPublish(int i,
int j)
implement one of the two main events: when an edge is definitely removed from the bipartite assignment graph |
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()
Achieves generalized arc consistency in one call |
void |
setEdgeAndPublish(int i,
int j)
implement the other main event: when an edge is definitely set in the bipartite assignment graph |
Methods inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteFlow |
---|
augment, decreaseMatchingSize, deleteMatch, findAlternatingPath, getMaxFlow, getMinFlow, increaseMatchingSize, init, mayDiminishFlowFromSource, mayGrowFlowFromSource, mustGrowFlowFromSource, putRefMatch, removeUselessEdges, setMatch |
Methods inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteGraph |
---|
addComponentEdge, addComponentVertex, augmentFlow, firstDFSearch, firstPassDFS, getNbComponents, initSCCGraph, match, mayDiminishFlowBetween, mayGrowFlowBetween, mayGrowFlowToSink, mayInverseMatch, mayMatch, prettyPrintForDebug, refreshSCC, secondDFSearch, secondPassDFS |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRemovals, getConstraintType, isConsistent, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, 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, 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 GlobalCardinality(IntDomainVar[] vars, int minValue, int maxValue, int[] low, int[] up, IEnvironment environment)
vars
- the variable listminValue
- smallest value that could be assigned to variablemaxValue
- greatest value that could be assigned to variablelow
- minimum for each valueup
- maximum occurences for each valueenvironment
- public GlobalCardinality(IntDomainVar[] vars, int[] low, int[] up, IEnvironment environment)
vars
- the variable listlow
- minimum for each valueup
- maximum occurences for each valueenvironment
- Method Detail |
---|
public Object clone() throws CloneNotSupportedException
AbstractSConstraint
clone
in class AbstractSConstraint<IntDomainVar>
CloneNotSupportedException
- Clone not supported exceptionpublic void deleteEdgeAndPublish(int i, int j) throws ContradictionException
deleteEdgeAndPublish
in class AbstractBipartiteGraph
i
- the variable to unmatchj
- the value to remove
ContradictionException
- if the removal generates a contradictionpublic void setEdgeAndPublish(int i, int j) throws ContradictionException
i
- the variable to assignj
- the assignement value
ContradictionException
public void awakeOnRem(int idx, int x) throws ContradictionException
awakeOnRem
in interface IntPropagator
awakeOnRem
in class AbstractIntSConstraint
idx
- variable indexx
- value to remove
ContradictionException
public void awakeOnInf(int idx) throws ContradictionException
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
idx
- variable index
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
idx
- variable index
ContradictionException
public void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
idx
- variable index
ContradictionException
public void awake() throws ContradictionException
awake
in class Propagator
ContradictionException
public void propagate() throws ContradictionException
AbstractBipartiteGraph
propagate
in class AbstractBipartiteGraph
ContradictionException
- contradiction exceptionpublic 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 |