choco.cp.solver.constraints.global
Class SemiLeximinSConstraint

java.lang.Object
  extended by choco.kernel.solver.propagation.Propagator
      extended by choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
          extended by choco.kernel.solver.constraints.integer.AbstractIntSConstraint
              extended by choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
                  extended by choco.cp.solver.constraints.global.SemiLeximinSConstraint
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public final class SemiLeximinSConstraint
extends AbstractLargeIntSConstraint

SemiLeximinConstraint is a constraint that ensures the leximin ordering between one vector of variables and one of integers.

Version:
1.0
Author:
Sylvain Bouveret

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
SemiLeximinSConstraint(int[] x, IntDomainVar[] y, IEnvironment environment)
          Creates a new LeximinConstraint instance.
 
Method Summary
 void awake()
          This method is invoked during the first propagation.
 void awakeOnInf(int idx)
          Cette m�thode r�agit si une variable a vu sa borne inf�rieure augmenter.
 void awakeOnInst(int idx)
          This method is called when a variable has been instanciated
 void awakeOnSup(int idx)
          Cette m�thode r�agit si une variable a vu sa borne sup�rieure diminuer.
 boolean isSatisfied()
          This method checks if the constraint is satisfied, once the variables have all been satisfied.
 String pretty()
          Prints details about the constraint and its variables.
 void printOccVectors()
          Prints some of the useful private fields that are used by the gac algorithm.
 void propagate()
          This methode propagates the constraint events.
 void setPointersAndFlags()
          The setPointersAndFlags method sets the values α, β, γ and δ, used by the algorithm.
 void setX(int[] x)
           
 String toString()
          The rather classical toString method...
 void updatePointersAndFlags(int idx, boolean inf)
          The setPointersAndFlags method updates the values α, β, γ and δ, used by the algorithm, when the domain of a variable has changed.
 void updateVectors(int idx)
          This methods updates the vectors used by the gac algorithm.
 
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
 
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

SemiLeximinSConstraint

public SemiLeximinSConstraint(int[] x,
                              IntDomainVar[] y,
                              IEnvironment environment)
Creates a new LeximinConstraint instance.

Parameters:
x - the first array of integers
y - the second array of integer variables
environment -
Method Detail

updateVectors

public void updateVectors(int idx)
This methods updates the vectors used by the gac algorithm.

Parameters:
idx - indice

setPointersAndFlags

public void setPointersAndFlags()
                         throws ContradictionException
The setPointersAndFlags method sets the values α, β, γ and δ, used by the algorithm.

Throws:
ContradictionException - if the model instance is inconsistant

updatePointersAndFlags

public void updatePointersAndFlags(int idx,
                                   boolean inf)
                            throws ContradictionException
The setPointersAndFlags method updates the values α, β, γ and δ, used by the algorithm, when the domain of a variable has changed.

Parameters:
idx - the index of the variable whose domain has changed
inf - a boolean value indicating whether the change occured with the lower bound (true) or with thee upper bound (false).
Throws:
ContradictionException - if the model instance is inconsistant

awake

public void awake()
           throws ContradictionException
This method is invoked during the first propagation.

Overrides:
awake in class Propagator
Throws:
ContradictionException - if a variable has an empty domain.

propagate

public void propagate()
               throws ContradictionException
This methode propagates the constraint events.

Specified by:
propagate in class Propagator
Throws:
ContradictionException - if a variable has an empty domain.

awakeOnInst

public void awakeOnInst(int idx)
                 throws ContradictionException
This method is called when a variable has been instanciated

Specified by:
awakeOnInst in interface IntPropagator
Overrides:
awakeOnInst in class AbstractIntSConstraint
Parameters:
idx - the index of the instanciated variable.
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Cette m�thode r�agit si une variable a vu sa borne inf�rieure augmenter.

Specified by:
awakeOnInf in interface IntPropagator
Overrides:
awakeOnInf in class AbstractIntSConstraint
Parameters:
idx - l'indice de la variable qui a �t� instanci�e.
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Cette m�thode r�agit si une variable a vu sa borne sup�rieure diminuer.

Specified by:
awakeOnSup in interface IntPropagator
Overrides:
awakeOnSup in class AbstractIntSConstraint
Parameters:
idx - l'indice de la variable qui a �t� instanci�e.
Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
This method checks if the constraint is satisfied, once the variables have all been satisfied.

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
Overrides:
isSatisfied in class AbstractIntSConstraint
Returns:
true iff the constraint is satisfied.

pretty

public String pretty()
Prints details about the constraint and its variables.

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<IntDomainVar>
Returns:
The details in a string.

toString

public String toString()
The rather classical toString method...

Overrides:
toString in class AbstractSConstraint<IntDomainVar>
Returns:
a String representing the object.

printOccVectors

public void printOccVectors()
Prints some of the useful private fields that are used by the gac algorithm.


setX

public void setX(int[] x)


Copyright © 2012. All Rights Reserved.