choco.cp.solver.constraints.integer
Class ModuloXYC2

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.AbstractBinIntSConstraint
                  extended by choco.cp.solver.constraints.integer.ModuloXYC2
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public final class ModuloXYC2
extends AbstractBinIntSConstraint

Created by IntelliJ IDEA. User: Richaud Date: 9 janv. 2007 Time: 16:58:01 To change this template use File | Settings | File Templates.


Field Summary
protected  int m
          The search constant of the constraint
 
Fields inherited from class choco.kernel.solver.constraints.integer.AbstractBinIntSConstraint
v0, v1
 
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
ModuloXYC2(IntDomainVar x0, IntDomainVar x1, int c)
          Constructs the constraint with the specified variables and constant.
 
Method Summary
 void awake()
          Propagation: Propagating the constraint for the very first time until local consistency is reached.
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int idx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int idx, int valeur)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
 int getFilteredEventMask(int idx)
           
 boolean isSatisfied()
          Checks if the constraint is satisfied when the variables are instantiated.
 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 !
 String pretty()
          tests if the constraint is consistent with respect to the current state of domains
 void propagate()
          The one and only propagation method, using foward checking
 void reviseV0OnInf(BitSet supports)
           
 void reviseV0OnInst(int inst)
           
 void reviseV0OnRem(BitSet supports, int valeur)
           
 void reviseV0OnSup(BitSet supports)
           
 void reviseV1OnInf()
           
 void reviseV1OnInst(int inst)
           
 void reviseV1OnRem(int valeur)
           
 void reviseV1OnSup()
           
 int searchInfV1()
           
 BitSet searchSupports()
           
 BitSet searchSupportsP()
           
 int searchSupV1()
           
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnBounds, awakeOnRemovals, getConstraintType, isConsistent
 
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, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m

protected final int m
The search constant of the constraint

Constructor Detail

ModuloXYC2

public ModuloXYC2(IntDomainVar x0,
                  IntDomainVar x1,
                  int c)
Constructs the constraint with the specified variables and constant.

Parameters:
x0 - first IntDomainVar
x1 - second IntDomainVar
c - The search constant used in the disequality.
Method Detail

getFilteredEventMask

public int getFilteredEventMask(int idx)
Overrides:
getFilteredEventMask in class Propagator

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

propagate

public void propagate()
               throws ContradictionException
The one and only propagation method, using foward checking

Specified by:
propagate in class Propagator
Throws:
ContradictionException - contradiction exception

searchSupportsP

public BitSet searchSupportsP()

searchSupports

public BitSet searchSupports()

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

reviseV0OnInf

public void reviseV0OnInf(BitSet supports)
                   throws ContradictionException
Throws:
ContradictionException

reviseV1OnInf

public void reviseV1OnInf()
                   throws ContradictionException
Throws:
ContradictionException

searchInfV1

public int searchInfV1()

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

reviseV0OnSup

public void reviseV0OnSup(BitSet supports)
                   throws ContradictionException
Throws:
ContradictionException

reviseV1OnSup

public void reviseV1OnSup()
                   throws ContradictionException
Throws:
ContradictionException

searchSupV1

public int searchSupV1()

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

reviseV0OnInst

public void reviseV0OnInst(int inst)
                    throws ContradictionException
Throws:
ContradictionException

reviseV1OnInst

public void reviseV1OnInst(int inst)
                    throws ContradictionException
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int idx,
                       int valeur)
                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

reviseV0OnRem

public void reviseV0OnRem(BitSet supports,
                          int valeur)
                   throws ContradictionException
Throws:
ContradictionException

reviseV1OnRem

public void reviseV1OnRem(int valeur)
                   throws ContradictionException
Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
Checks if the constraint is satisfied when the variables are instantiated.

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

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()
tests if the constraint is consistent with respect to the current state of domains

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<IntDomainVar>
Returns:
true iff the constraint is bound consistent (weaker than arc consistent)


Copyright © 2012. All Rights Reserved.