choco.global
Class Lex
java.lang.Object
choco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractLargeIntConstraint
choco.global.Lex
- All Implemented Interfaces:
- Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener
public class Lex
- extends AbstractLargeIntConstraint
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.AbstractConstraint |
addListener, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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:
AbstractIntConstraint
- Default propagation on improved lower bound: propagation on domain revision.
- Specified by:
awakeOnInf
in interface IntVarEventListener
- Overrides:
awakeOnInf
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnSup
public void awakeOnSup(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on improved upper bound: propagation on domain revision.
- Specified by:
awakeOnSup
in interface IntVarEventListener
- Overrides:
awakeOnSup
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnRem
public void awakeOnRem(int idx,
int x)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on one value removal: propagation on domain revision.
- Specified by:
awakeOnRem
in interface IntVarEventListener
- Overrides:
awakeOnRem
in class AbstractIntConstraint
- Throws:
ContradictionException
awakeOnInst
public void awakeOnInst(int idx)
throws ContradictionException
- Description copied from class:
AbstractIntConstraint
- Default propagation on instantiation: full constraint re-propagation.
- Specified by:
awakeOnInst
in interface IntVarEventListener
- Overrides:
awakeOnInst
in class AbstractIntConstraint
- Throws:
ContradictionException
propagate
public void propagate()
throws ContradictionException
- Description copied from class:
AbstractLargeIntConstraint
- Propagates the constraint awake events.
- Specified by:
propagate
in interface Propagator
- Overrides:
propagate
in class AbstractLargeIntConstraint
- Throws:
ContradictionException
awake
public void awake()
throws ContradictionException
- Description copied from class:
AbstractConstraint
- Default initial propagation: full constraint re-propagation.
- Specified by:
awake
in interface Propagator
- Overrides:
awake
in class AbstractConstraint
- Throws:
ContradictionException
isSatisfied
public boolean isSatisfied()
- Description copied from interface:
Constraint
- Semantic:
Testing if the constraint is satisfied.
Note that all variables involved in the constraint must be
instantiated when this method is called.
isEntailed
public java.lang.Boolean isEntailed()
- Description copied from interface:
Propagator
- Checks whether the constraint is definitely satisfied, no matter what further restrictions
occur to the domain of its variables.
- Specified by:
isEntailed
in interface Propagator
- Overrides:
isEntailed
in class AbstractConstraint