choco.cp.solver.constraints.global.matching
Class GlobalCardinalityVar
java.lang.Object
choco.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
choco.cp.solver.constraints.global.matching.GlobalCardinalityVar
- All Implemented Interfaces:
- IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
public final class GlobalCardinalityVar
- extends GlobalCardinality
Simple implementation of global cardinality constraint with occurrence constrained by
variables and not only integer bounds.
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 |
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 |
deleteSupport()
|
protected int |
getMaxFlow(int j)
|
protected int |
getMinFlow(int j)
|
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 ! |
Methods inherited from class choco.kernel.solver.constraints.global.matching.AbstractBipartiteFlow |
augment, decreaseMatchingSize, deleteMatch, findAlternatingPath, 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.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 |
GlobalCardinalityVar
public GlobalCardinalityVar(IntDomainVar[] values,
IntDomainVar[] occurences,
IEnvironment environment)
GlobalCardinalityVar
public GlobalCardinalityVar(IntDomainVar[] values,
int minValue,
int maxValue,
IntDomainVar[] occurences,
IEnvironment environment)
awakeOnInf
public void awakeOnInf(int idx)
throws ContradictionException
- Description copied from class:
GlobalCardinality
- update the reference matching before redoing the strongly connected components analysis
when removing value in the domain of variable idx
- Specified by:
awakeOnInf
in interface IntPropagator
- Overrides:
awakeOnInf
in class GlobalCardinality
- Parameters:
idx
- variable index
- Throws:
ContradictionException
awakeOnRem
public void awakeOnRem(int idx,
int x)
throws ContradictionException
- Description copied from class:
GlobalCardinality
- Implement reaction to edge removal
- Specified by:
awakeOnRem
in interface IntPropagator
- Overrides:
awakeOnRem
in class GlobalCardinality
- Parameters:
idx
- variable indexx
- value to remove
- Throws:
ContradictionException
awakeOnSup
public void awakeOnSup(int idx)
throws ContradictionException
- Description copied from class:
GlobalCardinality
- update the reference matching before redoing the strongly connected components analysis
when removing value in the domain of variable idx
- Specified by:
awakeOnSup
in interface IntPropagator
- Overrides:
awakeOnSup
in class GlobalCardinality
- Parameters:
idx
- variable index
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int idx)
throws ContradictionException
- Description copied from class:
GlobalCardinality
- update the reference matching before redoing the strongly connected components analysis
when idx is instantiated
- Specified by:
awakeOnInst
in interface IntPropagator
- Overrides:
awakeOnInst
in class GlobalCardinality
- Parameters:
idx
- variable index
- Throws:
ContradictionException
awake
public void awake()
throws ContradictionException
- Description copied from class:
GlobalCardinality
- performing the initial propagation, reduce variables domain to the candidate assign values
- Overrides:
awake
in class GlobalCardinality
- Throws:
ContradictionException
- contradiction exception
deleteSupport
public void deleteSupport()
getMinFlow
protected int getMinFlow(int j)
- Overrides:
getMinFlow
in class AbstractBipartiteFlow
getMaxFlow
protected int getMaxFlow(int j)
- Overrides:
getMaxFlow
in class AbstractBipartiteFlow
isSatisfied
public boolean isSatisfied(int[] tuple)
- Description copied from class:
AbstractIntSConstraint
- 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 !
- Specified by:
isSatisfied
in interface IntPropagator
- Overrides:
isSatisfied
in class GlobalCardinality
Copyright © 2012. All Rights Reserved.