choco.cp.solver.constraints.global
Class Lex
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.cp.solver.constraints.global.Lex
- All Implemented Interfaces:
- IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
public final class Lex
- extends AbstractLargeIntSConstraint
Enforce a lexicographic ordering on two vectors of integer
variables x <_lex y with x = , and y = .
ref : Global Constraints for Lexicographic Orderings (Frisch and al)
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, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
n
public int n
alpha
public IStateInt alpha
beta
public IStateInt beta
entailed
public IStateBool entailed
x
public IntDomainVar[] x
y
public IntDomainVar[] y
strict
public boolean strict
Lex
public Lex(IntDomainVar[] vars,
int n,
boolean strict,
IEnvironment environment)
getFilteredEventMask
public int getFilteredEventMask(int idx)
- Overrides:
getFilteredEventMask
in class Propagator
groundEq
public boolean groundEq(IntDomainVar x1,
IntDomainVar y1)
leq
public boolean leq(IntDomainVar x1,
IntDomainVar y1)
less
public boolean less(IntDomainVar x1,
IntDomainVar y1)
greater
public boolean greater(IntDomainVar x1,
IntDomainVar y1)
checkLex
public boolean checkLex(int i)
ACleq
public void ACleq(int i)
throws ContradictionException
- Throws:
ContradictionException
ACless
public void ACless(int i)
throws ContradictionException
- Throws:
ContradictionException
updateAlpha
public void updateAlpha(int i)
throws ContradictionException
- Throws:
ContradictionException
updateBeta
public void updateBeta(int i)
throws ContradictionException
- Throws:
ContradictionException
initialize
public void initialize()
throws ContradictionException
- Throws:
ContradictionException
filter
public void filter(int i)
throws ContradictionException
- Throws:
ContradictionException
awakeOnInf
public void awakeOnInf(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- Default propagation on improved lower bound: propagation on domain revision.
- Specified by:
awakeOnInf
in interface IntPropagator
- Overrides:
awakeOnInf
in class AbstractIntSConstraint
- Throws:
ContradictionException
awakeOnSup
public void awakeOnSup(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- Default propagation on improved upper bound: propagation on domain revision.
- Specified by:
awakeOnSup
in interface IntPropagator
- Overrides:
awakeOnSup
in class AbstractIntSConstraint
- Throws:
ContradictionException
awakeOnRem
public void awakeOnRem(int idx,
int x)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- Default propagation on one value removal: propagation on domain revision.
- Specified by:
awakeOnRem
in interface IntPropagator
- Overrides:
awakeOnRem
in class AbstractIntSConstraint
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntSConstraint
- Default propagation on instantiation: full constraint re-propagation.
- Specified by:
awakeOnInst
in interface IntPropagator
- Overrides:
awakeOnInst
in class AbstractIntSConstraint
- Throws:
ContradictionException
propagate
public void propagate()
throws ContradictionException
- Description copied from class:
Propagator
- Propagation:
Propagating the constraint until local consistency is reached.
- Specified by:
propagate
in class Propagator
- Throws:
ContradictionException
- contradiction exception
awake
public void awake()
throws ContradictionException
- Description copied from class:
Propagator
- Propagation:
Propagating the constraint for the very first time until local
consistency is reached.
- Overrides:
awake
in class Propagator
- Throws:
ContradictionException
- contradiction exception
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 AbstractIntSConstraint
pretty
public String pretty()
- Description copied from interface:
IPretty
- pretty printing of the object. This String is not constant and may depend on the context.
- Specified by:
pretty
in interface IPretty
- Overrides:
pretty
in class AbstractSConstraint<IntDomainVar>
- Returns:
- a readable string representation of the object
isEntailed
public Boolean isEntailed()
- Description copied from class:
AbstractSConstraint
- Indicates if the constraint is entailed, from now on will be always satisfied
- Overrides:
isEntailed
in class AbstractSConstraint<IntDomainVar>
- Returns:
- wether the constraint is entailed
Copyright © 2012. All Rights Reserved.