|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractLargeIntConstraint
choco.global.matching.AbstractBipartiteGraph
choco.global.matching.AbstractBipartiteFlow
choco.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.global.matching.AbstractBipartiteGraph |
---|
AbstractBipartiteGraph.IntQueue |
Field Summary |
---|
Fields inherited from class choco.global.matching.AbstractBipartiteFlow |
---|
compatibleFlow, flow, maxFlow, minFlow |
Fields inherited from class choco.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.integer.constraints.AbstractLargeIntConstraint |
---|
cIndices, cste, vars |
Fields inherited from class choco.AbstractConstraint |
---|
active, constAwakeEvent, hook, priority |
Fields inherited from class choco.AbstractEntity |
---|
problem |
Constructor Summary | |
---|---|
GlobalCardinality(IntDomainVar[] vars,
int[] low,
int[] up)
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)
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 |
void |
awakeOnVar(int idx)
Needs to be defined to update the reference matching before redoing the strongly connected components analysis. |
java.lang.Object |
clone()
returns a copy of 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()
TODO : not implemented |
java.lang.String |
pretty()
pretty printing of the object. |
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.global.matching.AbstractBipartiteFlow |
---|
augment, decreaseMatchingSize, deleteMatch, findAlternatingPath, increaseMatchingSize, initAbstractBipartiteFlow, mayDiminishFlowFromSource, mayGrowFlowFromSource, mustGrowFlowFromSource, putRefMatch, setMatch |
Methods inherited from class choco.global.matching.AbstractBipartiteGraph |
---|
addComponentEdge, addComponentVertex, augmentFlow, firstDFSearch, firstPassDFS, getPriority, init, initSCCGraph, match, mayDiminishFlowBetween, mayGrowFlowBetween, mayGrowFlowToSink, mayInverseMatch, mayMatch, propagate, removeUselessEdges, secondDFSearch, secondPassDFS |
Methods inherited from class choco.integer.constraints.AbstractLargeIntConstraint |
---|
assignIndices, getConstraintIdx, getIntVar, getNbVars, getVar, isCompletelyInstantiated, setConstraintIndex, setVar |
Methods inherited from class choco.integer.constraints.AbstractIntConstraint |
---|
awakeOnBounds, awakeOnRemovals, getSelfIndex, isConsistent |
Methods inherited from class choco.AbstractConstraint |
---|
addListener, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getProblem, getVarIdxInOpposite, isActive, isEntailed, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface choco.integer.IntConstraint |
---|
awakeOnBounds, awakeOnRemovals, getIntVar |
Methods inherited from interface choco.Propagator |
---|
assignIndices, constAwake, delete, getEvent, getPlugIn, getPriority, isCompletelyInstantiated, isConsistent, isEntailed, propagate |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Methods inherited from interface choco.integer.var.IntVarEventListener |
---|
getConstraintIdx, setConstraintIndex |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Constructor Detail |
---|
public GlobalCardinality(IntDomainVar[] vars, int minValue, int maxValue, int[] low, int[] up)
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 valuepublic GlobalCardinality(IntDomainVar[] vars, int[] low, int[] up)
vars
- the variable listlow
- minimum for each valueup
- maximum occurences for each valueMethod Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Constraint
clone
in interface Constraint
clone
in class AbstractBipartiteFlow
java.lang.CloneNotSupportedException
public 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 IntVarEventListener
awakeOnRem
in class AbstractIntConstraint
idx
- variable indexx
- value to remove
ContradictionException
public void awakeOnVar(int idx)
awakeOnVar
in interface VarEventListener
awakeOnVar
in interface Propagator
awakeOnVar
in class AbstractConstraint
idx
- variable indexpublic void awakeOnInf(int idx) throws ContradictionException
awakeOnInf
in interface IntVarEventListener
awakeOnInf
in class AbstractIntConstraint
idx
- variable index
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
awakeOnSup
in interface IntVarEventListener
awakeOnSup
in class AbstractIntConstraint
idx
- variable index
ContradictionException
public void awakeOnInst(int idx)
awakeOnInst
in interface IntVarEventListener
awakeOnInst
in class AbstractIntConstraint
idx
- variable indexpublic void awake() throws ContradictionException
awake
in interface Propagator
awake
in class AbstractConstraint
ContradictionException
public boolean isSatisfied()
isSatisfied
in interface Constraint
public java.lang.String pretty()
Entity
pretty
in interface Entity
pretty
in class AbstractEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |