public class PropagationEngine extends Object
onVariableUpdate
, it stores the event generated and schedules the propagator in
one of the 7 queues wrt to its priority for future revision.
Modifier and Type | Field and Description |
---|---|
static boolean |
CHECK_SCOPE |
Constructor and Description |
---|
PropagationEngine(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 |
execute(Propagator propagator)
Execute 'coarse' propagation on a newly added propagator
or one that should be propagated on backtrack
|
void |
flush()
Flush
this , ie. |
void |
ignoreModifications() |
void |
initialize()
Build up internal structure, if not yet done, in order to allow propagation.
|
boolean |
isInitialized()
Is the engine initialized?
Important for dynamic addition of constraints
|
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 propagator)
Update the scope of variable of a propagator (addition or deletion are allowed -- p.vars are scanned)
|
void |
reset()
Reset the propagation engine.
|
void |
updateInvolvedVariables(Propagator p)
Update the scope of variable of a propagator (addition or deletion are allowed -- p.vars are scanned)
|
public PropagationEngine(Model model)
model
- the declaring modelpublic void initialize() throws SolverException
SolverException
- if a constraint is declared more than once in this propagation enginepublic boolean isInitialized()
public void propagate() throws ContradictionException
ContradictionException
- if a contradiction occurrspublic void execute(Propagator propagator) throws ContradictionException
propagator
- a propagator to propagateContradictionException
- if propagation failspublic void flush()
this
, ie. remove every pending eventspublic void onVariableUpdate(Variable variable, IEventType type, ICause cause)
variable
- modified variabletype
- type of modification eventcause
- origin of the modificationpublic void delayedPropagation(Propagator propagator, PropagatorEventType type) throws ContradictionException
propagator
- propagator to executetype
- type of event to executeContradictionException
- if a failure is encounteredpublic void onPropagatorExecution(Propagator propagator)
propagator
- propagator to executepublic void desactivatePropagator(Propagator propagator)
propagator
- propagator to desactivatepublic void reset()
public void clear()
public void ignoreModifications()
public void dynamicAddition(boolean permanent, Propagator... ps) throws SolverException
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)
p
- a propagatorpublic void propagateOnBacktrack(Propagator propagator)
propagator
- a propagatorpublic void dynamicDeletion(Propagator... ps)
ps
- a list of propagatorsCopyright © 2018. All rights reserved.