public class SevenQueuesPropagatorEngine extends Object implements IPropagationEngine
onVariableUpdate
, it stores the event generated and schedules the propagator in
one of the 7 queues wrt to its priority for future revision.
IPropagationEngine.Trace
Constructor and Description |
---|
SevenQueuesPropagatorEngine(Model model)
A seven-queue propagation engine.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear internal structures
|
void |
delayedPropagation(Propagator propagator,
PropagatorEventType type)
Exeucte a delayed propagator
|
void |
desactivatePropagator(Propagator propagator)
Set the propagator as inactivated within the propagation engine
|
void |
dynamicAddition(boolean permanent,
Propagator... ps)
Add a constraint to the propagation engine
|
void |
dynamicDeletion(Propagator... ps)
Delete the list of propagators in input from the engine
|
void |
flush()
Flush
this , ie. remove every pending events |
void |
initialize()
Build up internal structure, if not yet done, in order to allow propagation.
|
boolean |
isInitialized()
Is the engine initialized?
|
void |
onPropagatorExecution(Propagator propagator)
Action to do when a propagator is executed
|
void |
onVariableUpdate(Variable variable,
IEventType type,
ICause cause)
Take into account the modification of a variable
|
void |
propagate()
Launch the proapagation, ie, active propagators if necessary, then reach a fix point
|
void |
propagateOnBacktrack(Propagator p)
State that the propagator needs to be propagated (coarse event) on backtrack.
|
void |
updateInvolvedVariables(Propagator p)
Update the scope of variable of a propagator (addition or deletion are allowed -- p.vars are scanned)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fails, getContradictionException
public SevenQueuesPropagatorEngine(Model model)
model
- the declaring modelpublic void initialize() throws SolverException
IPropagationEngine
initialize
in interface IPropagationEngine
SolverException
- if a constraint is declared more than once in this propagation enginepublic boolean isInitialized()
IPropagationEngine
isInitialized
in interface IPropagationEngine
public void propagate() throws ContradictionException
IPropagationEngine
propagate
in interface IPropagationEngine
ContradictionException
- if a contradiction occurrspublic void flush()
IPropagationEngine
this
, ie. remove every pending eventsflush
in interface IPropagationEngine
public void onVariableUpdate(Variable variable, IEventType type, ICause cause)
IPropagationEngine
onVariableUpdate
in interface IPropagationEngine
variable
- modified variabletype
- type of modification eventcause
- origin of the modificationpublic void delayedPropagation(Propagator propagator, PropagatorEventType type) throws ContradictionException
IPropagationEngine
delayedPropagation
in interface IPropagationEngine
propagator
- propagator to executetype
- type of event to executeContradictionException
- if a failure is encounteredpublic void onPropagatorExecution(Propagator propagator)
IPropagationEngine
onPropagatorExecution
in interface IPropagationEngine
propagator
- propagator to executepublic void desactivatePropagator(Propagator propagator)
IPropagationEngine
desactivatePropagator
in interface IPropagationEngine
propagator
- propagator to desactivatepublic void clear()
IPropagationEngine
clear
in interface IPropagationEngine
public void dynamicAddition(boolean permanent, Propagator... ps) throws SolverException
IPropagationEngine
dynamicAddition
in interface IPropagationEngine
permanent
- does the constraint is permanently addedps
- propagators to add
* @throws SolverException if a constraint is declared more than once in this propagation engineSolverException
public void updateInvolvedVariables(Propagator p)
IPropagationEngine
updateInvolvedVariables
in interface IPropagationEngine
p
- a propagatorpublic void propagateOnBacktrack(Propagator p)
IPropagationEngine
propagateOnBacktrack
in interface IPropagationEngine
p
- a propagatorpublic void dynamicDeletion(Propagator... ps)
IPropagationEngine
dynamicDeletion
in interface IPropagationEngine
ps
- a list of propagatorsCopyright © 2017. All rights reserved.