choco.kernel.solver.constraints.integer
Class AbstractIntSConstraint

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
All Implemented Interfaces:
IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener
Direct Known Subclasses:
AbstractBinIntSConstraint, AbstractLargeIntSConstraint, AbstractTernIntSConstraint, Adapter, ConstantSConstraint

public abstract class AbstractIntSConstraint
extends AbstractSConstraint<IntDomainVar>
implements IntPropagator

An abstract class for all implementations of listeners over search variables.


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
protected AbstractIntSConstraint(int priority, IntDomainVar[] vars)
          Constructs a constraint with the specified priority.
 
Method Summary
 void awakeOnBounds(int varIndex)
           
 void awakeOnInf(int varIdx)
          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 varIdx, int val)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnRemovals(int idx, DisposableIntIterator deltaDomain)
          The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.
 void awakeOnSup(int varIdx)
          Default propagation on improved upper bound: propagation on domain revision.
 SConstraintType getConstraintType()
          Return the type of constraint, ie the type of variable involved in the constraint
 boolean isConsistent()
          tests if the constraint is consistent with respect to the current state of domains
 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 !
 
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, propagate, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractIntSConstraint

protected AbstractIntSConstraint(int priority,
                                 IntDomainVar[] vars)
Constructs a constraint with the specified priority.

Parameters:
priority - The wished priority.
Method Detail

awakeOnInst

public void awakeOnInst(int idx)
                 throws ContradictionException
Default propagation on instantiation: full constraint re-propagation.

Specified by:
awakeOnInst in interface IntPropagator
Throws:
ContradictionException

awakeOnRemovals

public void awakeOnRemovals(int idx,
                            DisposableIntIterator deltaDomain)
                     throws ContradictionException
The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally.

Specified by:
awakeOnRemovals in interface IntPropagator
Parameters:
idx -
Throws:
ContradictionException

awakeOnBounds

public void awakeOnBounds(int varIndex)
                   throws ContradictionException
Specified by:
awakeOnBounds in interface IntPropagator
Throws:
ContradictionException

isConsistent

public boolean isConsistent()
tests if the constraint is consistent with respect to the current state of domains

Specified by:
isConsistent in class Propagator
Returns:
true if the constraint is entailed (default approximate definition)

isSatisfied

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

Specified by:
isSatisfied in interface SConstraint<IntDomainVar>
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
Parameters:
tuple -
Returns:

awakeOnInf

public void awakeOnInf(int varIdx)
                throws ContradictionException
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntPropagator
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int varIdx)
                throws ContradictionException
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntPropagator
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int varIdx,
                       int val)
                throws ContradictionException
Default propagation on one value removal: propagation on domain revision.

Specified by:
awakeOnRem in interface IntPropagator
Throws:
ContradictionException

getConstraintType

public SConstraintType getConstraintType()
Description copied from interface: SConstraint
Return the type of constraint, ie the type of variable involved in the constraint

Specified by:
getConstraintType in interface SConstraint<IntDomainVar>
Returns:


Copyright © 2012. All Rights Reserved.