|
||||||||||
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.SortingSConstraint
public final class SortingSConstraint
SortingConstraint
is a constraint that ensures
that a vector is the sorted version of a second one. The filtering
algorithm is the version of Kurt Mehlhorn and Sven Thiel, from
CP'00 (Faster algorithms for Bound-Consistency of the Sortedness
and the Alldifferent Constraint).
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 | |
---|---|
SortingSConstraint(IntDomainVar[] x,
IntDomainVar[] y)
Creates a new SortingConstraint instance. |
Method Summary | |
---|---|
void |
awake()
This method is invoked during the first propagation. |
void |
awakeOnInf(int idx)
This method is called when the minimal value of the domain of a variable has been updated. |
void |
awakeOnInst(int idx)
This method is called when a variable has been instanciated |
void |
awakeOnSup(int idx)
This method is called when the maximal value of the domain of a variable has been updated. |
void |
boundConsistency()
|
boolean |
isSatisfied(int[] tuple)
This method checks if the constraint is satisfied or not. |
String |
pretty()
pretty printing of the object. |
void |
printVectors()
|
void |
propagate()
This methode propagates the constraint events. |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRem, awakeOnRemovals, getConstraintType, isConsistent, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, 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 SortingSConstraint(IntDomainVar[] x, IntDomainVar[] y)
SortingConstraint
instance.
x
- the first array of integer variablesy
- the second array of integer variablesMethod Detail |
---|
public void boundConsistency() throws ContradictionException
ContradictionException
public void awake() throws ContradictionException
awake
in class Propagator
ContradictionException
- if a variable has an empty domain.public void propagate() throws ContradictionException
propagate
in class Propagator
ContradictionException
- if a variable has an empty domain.public void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
idx
- the index of the instanciated variable.
ContradictionException
public void awakeOnInf(int idx) throws ContradictionException
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
idx
- the index of the variable whose domain has been updated.
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
idx
- the index of the variable whose domain has been updated.
ContradictionException
public boolean isSatisfied(int[] tuple)
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
true
if and only if the constraint is satisfied.public final void printVectors()
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 |