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
Modifier and Type | Field and Description |
---|---|
protected IEnvironment |
environment |
protected int[][] |
eventmasks |
protected IntCircularQueue[] |
eventsets |
protected ContradictionException |
exception |
protected Propagator |
lastProp |
protected int |
notEmpty |
protected IId2AbId |
p2i |
protected CircularQueue<Propagator>[] |
pro_queue |
protected Propagator[] |
propagators |
protected short[] |
scheduled |
Constructor and Description |
---|
SevenQueuesPropagatorEngine(Solver solver) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
delayedPropagation(Propagator propagator,
PropagatorEventType type) |
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 |
fails(ICause cause,
Variable variable,
String message) |
void |
flush()
Flush
this , ie. remove every pending events |
ContradictionException |
getContradictionException() |
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) |
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)
|
protected final ContradictionException exception
protected final IEnvironment environment
protected Propagator[] propagators
protected final CircularQueue<Propagator>[] pro_queue
protected Propagator lastProp
protected IId2AbId p2i
protected int notEmpty
protected short[] scheduled
protected IntCircularQueue[] eventsets
protected int[][] eventmasks
public SevenQueuesPropagatorEngine(Solver solver)
public void fails(ICause cause, Variable variable, String message) throws ContradictionException
fails
in interface IPropagationEngine
ContradictionException
public ContradictionException getContradictionException()
getContradictionException
in interface IPropagationEngine
public void initialize()
IPropagationEngine
initialize
in interface IPropagationEngine
public 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) throws ContradictionException
IPropagationEngine
onVariableUpdate
in interface IPropagationEngine
variable
- modified variabletype
- type of modification eventContradictionException
public void delayedPropagation(Propagator propagator, PropagatorEventType type) throws ContradictionException
delayedPropagation
in interface IPropagationEngine
ContradictionException
public void onPropagatorExecution(Propagator propagator)
onPropagatorExecution
in interface IPropagationEngine
public void desactivatePropagator(Propagator propagator)
IPropagationEngine
desactivatePropagator
in interface IPropagationEngine
propagator
- propagator to desactivatepublic void clear()
clear
in interface IPropagationEngine
public void dynamicAddition(boolean permanent, Propagator... ps)
IPropagationEngine
dynamicAddition
in interface IPropagationEngine
permanent
- does the constraint is permanently addedps
- propagators to addpublic 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 © 2015. All rights reserved.