choco.kernel.solver.propagation
Interface PropagationEngine

All Known Implementing Classes:
AbstractPropagationEngine, ChocoEngine

public interface PropagationEngine

An interface for all implementations of propagation engines.


Field Summary
static Logger LOGGER
           
 
Method Summary
 void addPropagationEngineListener(PropagationEngineListener listener)
          Adds a new listener to some events occuring in the propagation engine.
 boolean checkCleanState()
          checking that the propagation engine remains in a proper state
 void clear()
           
 boolean containsPropagationListener(PropagationEngineListener listener)
          Check wether this contains listener in its list of listeners
 void decPendingInitConstAwakeEvent()
          Decrements the number of init constraint awake events.
 void desactivatePropagator(Propagator propagator)
          Desactivate a constraint.
 void flushEvents()
          Removes all pending events (used when interrupting a propagation because a contradiction has been raised)
 void freeze()
          Freeze the current events contained in this.
 FailMeasure getFailMeasure()
          Returns the fails counter, FailMeasure
 void incPendingInitConstAwakeEvent()
          Increments the number of init constraint awake events.
 void loadSettings(Configuration configuration)
           
 void postAddKer(SetVar v, SConstraint constraint, boolean forceAwake)
          Specific method to post modification of kernel addition event
 boolean postConstAwake(Propagator constraint, boolean init)
          Post a constraint event.
 void postEvent(Var v, int basicEvt, SConstraint constraint, boolean forceAwake)
          Generic method to post events.
 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 propagateEvents()
          Propagate one by one events registered
 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 registerPropagator(Propagator propagator)
          Register a constraint.
 void removePropagationEngineListener(PropagationEngineListener listener)
          Removes a old listener from the propagation engine
 void unfreeze()
          Unfreeze the previously frozen events contained in this.
 

Field Detail

LOGGER

static final Logger LOGGER
Method Detail

getFailMeasure

FailMeasure getFailMeasure()
Returns the fails counter, FailMeasure

Returns:
fails counter

clear

void clear()

loadSettings

void loadSettings(Configuration configuration)

raiseContradiction

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

Parameters:
cause - contradiction cause
Throws:
ContradictionException

raiseContradiction

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

Parameters:
cause - contradiction cause
move - next move after throwing the contradiction
Throws:
ContradictionException

raiseContradiction

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

Raising a contradiction with a variable.

Parameters:
cidx - index of the constraint in the constraints network
variable - variable causing the contradiction
cause - constraint causing the contradiction
Throws:
ContradictionException

flushEvents

void flushEvents()
Removes all pending events (used when interrupting a propagation because a contradiction has been raised)


checkCleanState

boolean checkCleanState()
checking that the propagation engine remains in a proper state

Returns:
return true if the state is proper, false otherwise

postEvent

void postEvent(Var v,
               int basicEvt,
               SConstraint constraint,
               boolean forceAwake)
Generic method to post events. The caller is reponsible of basic event type field: it should be meaningful for the the associate kind of event.

Parameters:
v - The modified variable.
basicEvt - integer specifying mdofication kind for the attached
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postUpdateInf

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

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

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

Parameters:
v - The modified integer variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postInstInt

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

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

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

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

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

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

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

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

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

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

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

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

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

Parameters:
v - The modified set variable.
constraint - constraint at the origin of the modification
forceAwake - should the constraint be informed of the current event

postConstAwake

boolean postConstAwake(Propagator constraint,
                       boolean init)
Post a constraint event.

Parameters:
constraint - constraint to call
init - indicates wether this call should be a call to Propagator.awake() (true) or to Propagator.Propagator() (false).
Returns:
true if the event has been added, false if it was already present

registerPropagator

void registerPropagator(Propagator propagator)
Register a constraint. Any constraint declared in the Solver should be present in this.

Parameters:
propagator - element to declare to this

desactivatePropagator

void desactivatePropagator(Propagator propagator)
Desactivate a constraint. This constraint won't be informed of any new events occuring on its variable.

Parameters:
propagator - element to desactivate

propagateEvents

void propagateEvents()
                     throws ContradictionException
Propagate one by one events registered

Throws:
ContradictionException - if an event propagation creates a contradiction

decPendingInitConstAwakeEvent

void decPendingInitConstAwakeEvent()
Decrements the number of init constraint awake events.


incPendingInitConstAwakeEvent

void incPendingInitConstAwakeEvent()
Increments the number of init constraint awake events.


freeze

void freeze()
Freeze the current events contained in this. The behaviour of the engine is still the same, but those events won't be treated in next calls to propagateEvents()


unfreeze

void unfreeze()
Unfreeze the previously frozen events contained in this. See freeze().


addPropagationEngineListener

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

Parameters:
listener - a new listener

removePropagationEngineListener

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

Parameters:
listener - removal listener

containsPropagationListener

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

Parameters:
listener -
Returns:


Copyright © 2012. All Rights Reserved.