choco.cp.solver.propagation
Class AbstractPropagationEngine

java.lang.Object
  extended by choco.cp.solver.propagation.AbstractPropagationEngine
All Implemented Interfaces:
PropagationEngine
Direct Known Subclasses:
ChocoEngine

public abstract class AbstractPropagationEngine
extends Object
implements PropagationEngine

An abstract class for all implementations of propagation engines.


Field Summary
protected  FailMeasure failMeasure
           
protected  int pelIdx
           
protected  PropagationEngineListener[] propagationEngineListeners
          List of all listeners of events occuring in this engine.
protected  ContradictionException reuseException
          Storing the last contradiction (reusable).
 Solver solver
           
 
Fields inherited from interface choco.kernel.solver.propagation.PropagationEngine
LOGGER
 
Constructor Summary
AbstractPropagationEngine(Solver solver)
           
 
Method Summary
 void addPropagationEngineListener(PropagationEngineListener listener)
          Adds a new listener to some events occuring in the propagation engine.
 void clear()
           
 boolean containsPropagationListener(PropagationEngineListener listener)
          Check wether this contains listener in its list of listeners
 FailMeasure getFailMeasure()
          Returns the fails counter, FailMeasure
 Solver getSolver()
           
 void postAddKer(SetVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of kernel addition event
 void postInstInt(IntDomainVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post instantiation event
 void postInstSet(SetVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post instantiation event
 void postRemEnv(SetVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of envelope removal event
 void postRemoveVal(IntDomainVar v, int x, SConstraint constraint, boolean forceAwake)
          Specific method to post removal event
 void postUpdateInf(IntDomainVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of lower bound event
 void postUpdateInf(RealVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of lower bound event
 void postUpdateSup(IntDomainVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of upper bound event
 void postUpdateSup(RealVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of upper bound event
 void raiseContradiction(int cidx, Var variable, SConstraint cause)
          Deprecated. 
 void raiseContradiction(Object cause)
          Raising a contradiction with a cause.
 void raiseContradiction(Object cause, int move)
          Raising a contradiction with a cause and a movement
 void removePropagationEngineListener(PropagationEngineListener listener)
          Removes a old listener from the propagation engine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.kernel.solver.propagation.PropagationEngine
checkCleanState, decPendingInitConstAwakeEvent, desactivatePropagator, flushEvents, freeze, incPendingInitConstAwakeEvent, loadSettings, postConstAwake, postEvent, propagateEvents, registerPropagator, unfreeze
 

Field Detail

solver

public final Solver solver

failMeasure

protected final FailMeasure failMeasure

propagationEngineListeners

protected PropagationEngineListener[] propagationEngineListeners
List of all listeners of events occuring in this engine.


pelIdx

protected int pelIdx

reuseException

protected final ContradictionException reuseException
Storing the last contradiction (reusable).

Constructor Detail

AbstractPropagationEngine

public AbstractPropagationEngine(Solver solver)
Method Detail

getSolver

public final Solver getSolver()

getFailMeasure

public final FailMeasure getFailMeasure()
Description copied from interface: PropagationEngine
Returns the fails counter, FailMeasure

Specified by:
getFailMeasure in interface PropagationEngine
Returns:
fails counter

clear

public void clear()
Specified by:
clear in interface PropagationEngine

raiseContradiction

public final void raiseContradiction(Object cause)
                              throws ContradictionException
Raising a contradiction with a cause.

Specified by:
raiseContradiction in interface PropagationEngine
Parameters:
cause - contradiction cause
Throws:
ContradictionException

raiseContradiction

public final void raiseContradiction(Object cause,
                                     int move)
                              throws ContradictionException
Raising a contradiction with a cause and a movement

Specified by:
raiseContradiction in interface PropagationEngine
Parameters:
cause - contradiction cause
move - next move after throwing the contradiction
Throws:
ContradictionException

raiseContradiction

@Deprecated
public final void raiseContradiction(int cidx,
                                                Var variable,
                                                SConstraint cause)
                              throws ContradictionException
Deprecated. 

Raising a contradiction with a variable.

Specified by:
raiseContradiction in interface PropagationEngine
Parameters:
cidx - index of the constraint in the constraints network
variable - variable causing the contradiction
cause - constraint causing the contradiction
Throws:
ContradictionException

addPropagationEngineListener

public final void addPropagationEngineListener(PropagationEngineListener listener)
Adds a new listener to some events occuring in the propagation engine.

Specified by:
addPropagationEngineListener in interface PropagationEngine
Parameters:
listener - a new listener

removePropagationEngineListener

public final void removePropagationEngineListener(PropagationEngineListener listener)
Removes a old listener from the propagation engine

Specified by:
removePropagationEngineListener in interface PropagationEngine
Parameters:
listener - removal listener

containsPropagationListener

public boolean containsPropagationListener(PropagationEngineListener listener)
Check wether this contains listener in its list of listeners

Specified by:
containsPropagationListener in interface PropagationEngine
Returns:

postInstInt

public final void postInstInt(IntDomainVar v,
                              SConstraint constraint,
                              boolean forceAwake)
Specific method to post instantiation event

Specified by:
postInstInt in interface PropagationEngine
Parameters:
v - The modified integer variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postUpdateInf

public final void postUpdateInf(IntDomainVar v,
                                SConstraint constraint,
                                boolean forceAwake)
Specific method to post modification of lower bound event

Specified by:
postUpdateInf in interface PropagationEngine
Parameters:
v - The modified integer variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postUpdateSup

public final void postUpdateSup(IntDomainVar v,
                                SConstraint constraint,
                                boolean forceAwake)
Specific method to post modification of upper bound event

Specified by:
postUpdateSup in interface PropagationEngine
Parameters:
v - The modified integer variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postRemoveVal

public final void postRemoveVal(IntDomainVar v,
                                int x,
                                SConstraint constraint,
                                boolean forceAwake)
Specific method to post removal event

Specified by:
postRemoveVal in interface PropagationEngine
Parameters:
v - The modified integer variable.
x - the value removed
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postUpdateInf

public final void postUpdateInf(RealVar v,
                                SConstraint constraint,
                                boolean forceAwake)
Specific method to post modification of lower bound event

Specified by:
postUpdateInf in interface PropagationEngine
Parameters:
v - The modified real variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postUpdateSup

public final void postUpdateSup(RealVar v,
                                SConstraint constraint,
                                boolean forceAwake)
Specific method to post modification of upper bound event

Specified by:
postUpdateSup in interface PropagationEngine
Parameters:
v - The modified real variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postRemEnv

public final void postRemEnv(SetVar v,
                             SConstraint constraint,
                             boolean forceAwake)
Specific method to post modification of envelope removal event

Specified by:
postRemEnv in interface PropagationEngine
Parameters:
v - The modified set variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postAddKer

public final void postAddKer(SetVar v,
                             SConstraint constraint,
                             boolean forceAwake)
Specific method to post modification of kernel addition event

Specified by:
postAddKer in interface PropagationEngine
Parameters:
v - The modified set variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postInstSet

public final void postInstSet(SetVar v,
                              SConstraint constraint,
                              boolean forceAwake)
Specific method to post instantiation event

Specified by:
postInstSet in interface PropagationEngine
Parameters:
v - The modified set variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event


Copyright © 2012. All Rights Reserved.