choco.cp.solver.constraints.global
Class IncreasingNValue

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.IncreasingNValue
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public final class IncreasingNValue
extends AbstractLargeIntSConstraint

User : xlorca Mail : xlorca(a)emn.fr Date : 29 janv. 2010 Since : Choco 2.1.1


Nested Class Summary
static class IncreasingNValue.Mode
           
 
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
IncreasingNValue(IntDomainVar occ, IntDomainVar[] x, IncreasingNValue.Mode m)
           
 
Method Summary
 void adjustMax(int idx, int val)
           
 void adjustMin(int idx, int val)
           
 void buildPrefix()
           
 void buildSuffix()
           
static IntDomainVar[] concat(IntDomainVar occ, IntDomainVar[] vars)
           
static int getNext(IntDomainVar v, int val)
           
static int getPrev(IntDomainVar v, int val)
           
 boolean isSatisfied()
          Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)
 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 !
 int maxSupSuffix(int k)
           
 int minInfSuffix(int k)
           
 String printer()
           
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 boolean test(int min, int max)
           
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, 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, pretty, setConstraintIndex, setExtension, setVar, toString
 
Methods inherited from class choco.kernel.solver.propagation.Propagator
activate, awake, 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

IncreasingNValue

public IncreasingNValue(IntDomainVar occ,
                        IntDomainVar[] x,
                        IncreasingNValue.Mode m)
Method Detail

concat

public static IntDomainVar[] concat(IntDomainVar occ,
                                    IntDomainVar[] vars)

getPrev

public static int getPrev(IntDomainVar v,
                          int val)

getNext

public static int getNext(IntDomainVar v,
                          int val)

buildSuffix

public final void buildSuffix()

buildPrefix

public final void buildPrefix()

adjustMin

public final void adjustMin(int idx,
                            int val)
                     throws ContradictionException
Throws:
ContradictionException

adjustMax

public final void adjustMax(int idx,
                            int val)
                     throws ContradictionException
Throws:
ContradictionException

minInfSuffix

public final int minInfSuffix(int k)

maxSupSuffix

public final int maxSupSuffix(int k)

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

test

public final boolean test(int min,
                          int max)

printer

public String printer()

isSatisfied

public boolean isSatisfied()
Default implementation of the isSatisfied by delegating to the isSatisfied(int[] tuple)

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
Overrides:
isSatisfied in class AbstractIntSConstraint
Returns:

isSatisfied

public 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 !

Specified by:
isSatisfied in interface IntPropagator
Overrides:
isSatisfied in class AbstractIntSConstraint
Parameters:
tuple -
Returns:


Copyright © 2012. All Rights Reserved.