|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.solver.propagation.AbstractPropagationEngine
choco.cp.solver.propagation.ChocoEngine
public class ChocoEngine
Implementation of an AbstractPropagationEngine
for Choco.
Field Summary | |
---|---|
protected ConstraintEventQueue[] |
constEventQueues
The different queues for the constraint awake events. |
protected int |
nbPendingInitConstAwakeEvent
Number of pending init constraint awake events. |
protected VariableEventQueue[] |
varEventQueue
The queue with all the variable events. |
Fields inherited from class choco.cp.solver.propagation.AbstractPropagationEngine |
---|
failMeasure, pelIdx, propagationEngineListeners, reuseException, solver |
Fields inherited from interface choco.kernel.solver.propagation.PropagationEngine |
---|
LOGGER |
Constructor Summary | |
---|---|
ChocoEngine(Solver solver)
Constructs a new engine by initializing the var queues. |
Method Summary | |
---|---|
boolean |
checkCleanState()
checking that the propagation engine remains in a proper state |
void |
clear()
Clear datastructures for safe reuses |
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 . |
int |
getNbPendingEvents()
Return the number of pending events. |
PropagationEvent |
getPendingEvent(int idx)
getter without side effect: returns the i-ht pending event (without popping any event from the queues) |
void |
incPendingInitConstAwakeEvent()
Increments the number of init constraint awake events. |
void |
loadSettings(Configuration configuration)
|
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 |
propagateEvents()
Propagate one by one events registered |
void |
registerPropagator(Propagator c)
Register a constraint. |
void |
unfreeze()
Unfreeze the previously frozen events contained in this . |
Methods inherited from class choco.cp.solver.propagation.AbstractPropagationEngine |
---|
addPropagationEngineListener, containsPropagationListener, getFailMeasure, getSolver, postAddKer, postInstInt, postInstSet, postRemEnv, postRemoveVal, postUpdateInf, postUpdateInf, postUpdateSup, postUpdateSup, raiseContradiction, raiseContradiction, raiseContradiction, removePropagationEngineListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConstraintEventQueue[] constEventQueues
protected int nbPendingInitConstAwakeEvent
protected VariableEventQueue[] varEventQueue
Constructor Detail |
---|
public ChocoEngine(Solver solver)
solver
- Solver masterMethod Detail |
---|
public void loadSettings(Configuration configuration)
public void clear()
clear
in interface PropagationEngine
clear
in class AbstractPropagationEngine
public void postEvent(Var v, int basicEvt, SConstraint constraint, boolean forceAwake)
v
- The modified variable.basicEvt
- integer specifying mdofication kind for the attachedconstraint
- constraint at the origin of the modificationforceAwake
- should the constraint be informed of the current eventpublic boolean postConstAwake(Propagator constraint, boolean init)
constraint
- constraint to callinit
- indicates wether this call should be a call to Propagator.awake()
(true
)
or to Propagator.Propagator()
(false
).
true
if the event has been added, false
if it was already presentpublic void registerPropagator(Propagator c)
Solver
should be present in this
.
It should be called before call to Propagator.propagate()
.
c
- element to declare to this
public void propagateEvents() throws ContradictionException
ContradictionException
- if an event propagation creates a contradictionpublic void desactivatePropagator(Propagator propagator)
propagator
- element to desactivatepublic void decPendingInitConstAwakeEvent()
public void incPendingInitConstAwakeEvent()
public int getNbPendingEvents()
public PropagationEvent getPendingEvent(int idx)
idx
- indice of the event
public void flushEvents()
public boolean checkCleanState()
true
if the state is proper, false
otherwisepublic void freeze()
this
.
The behaviour of the engine is still the same, but those events won't be treated in next calls to PropagationEngine.propagateEvents()
public void unfreeze()
this
. See PropagationEngine.freeze()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |