choco.cp.solver.constraints.strong
Class Adapter

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.cp.solver.constraints.strong.Adapter
All Implemented Interfaces:
ISpecializedConstraint, IExtensionnable, IPretty, SConstraint<IntDomainVar>, IntPropagator, Cloneable, EventListener

public class Adapter
extends AbstractIntSConstraint
implements ISpecializedConstraint


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
Adapter(AbstractIntSConstraint sConstraint)
           
 
Method Summary
 boolean check(int[] tuple)
           
 Object clone()
          Clone the constraint
 int firstSupport(int position, int value)
           
 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)
 int nextSupport(int position, int value, int lastSupport)
           
 String pretty()
          pretty printing of the object.
 void propagate()
          Propagation: Propagating the constraint until local consistency is reached.
 String toString()
           
 
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, getConstraintType, isSatisfied
 
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint
addExtension, addListener, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, opposite, setConstraintIndex, setExtension, setVar
 
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
 
Methods inherited from interface choco.kernel.solver.propagation.listener.IntPropagator
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, isSatisfied
 
Methods inherited from interface choco.kernel.solver.constraints.SConstraint
getConstraintIdx, getConstraintType, getFineDegree, getNbVars, getVar, getVarQuick, opposite, setConstraintIndex, setVar
 
Methods inherited from interface choco.IExtensionnable
addExtension, getExtension
 

Constructor Detail

Adapter

public Adapter(AbstractIntSConstraint sConstraint)
Method Detail

firstSupport

public int firstSupport(int position,
                        int value)
Specified by:
firstSupport in interface ISpecializedConstraint

nextSupport

public int nextSupport(int position,
                       int value,
                       int lastSupport)
Specified by:
nextSupport in interface ISpecializedConstraint

toString

public String toString()
Overrides:
toString in class AbstractSConstraint<IntDomainVar>

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Overrides:
pretty in class AbstractSConstraint<IntDomainVar>
Returns:
a readable string representation of the object

isSatisfied

public boolean isSatisfied()
Description copied from class: AbstractIntSConstraint
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:
true if the constraint is satisfied

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: AbstractSConstraint
Clone the constraint

Overrides:
clone in class AbstractSConstraint<IntDomainVar>
Returns:
the clone of the constraint
Throws:
CloneNotSupportedException - Clone not supported exception

check

public boolean check(int[] tuple)
Specified by:
check in interface ISpecializedConstraint

isConsistent

public boolean isConsistent()
Description copied from class: AbstractIntSConstraint
tests if the constraint is consistent with respect to the current state of domains

Overrides:
isConsistent in class AbstractIntSConstraint
Returns:
true if the constraint is entailed (default approximate definition)

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


Copyright © 2012. All Rights Reserved.