Package org.evoludo.simulator.models
Class PDESupervisor
Object
PDESupervisor
- Direct Known Subclasses:
PDESupervisorGWT
Supervisor of reaction-diffusion processes. Coordinates calculations of the
next step. Subclasses are encouraged to take advantage of optimizations
available in different frameworks, GWT and JRE in particular. This default
implementation does not implement any optimizations.
- Author:
- Christoph Hauert
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPDESupervisor
(EvoLudo engine, PDE charge) Creates a new supervisor to manage the PDE calculations of model charge. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
diffuse()
Perform the diffusion step.boolean
next
(double stepDt) Advances the PDE model by a time step ofstepDt
.protected double
react()
Perform the reaction step.void
reset()
Reset supervisor and update settings.void
unload()
Unload the supervisor and free resources.void
update()
Called after a change of parameters.
-
Field Details
-
charge
The model to manage and supervise its execution. -
nUnits
protected int nUnitsThe number of units in the discretization of the PDE. -
engine
The pacemaker of all models. Interface with the outside world.
-
-
Constructor Details
-
PDESupervisor
Creates a new supervisor to manage the PDE calculations of model charge. Subclasses may introduce specific optimizations. In particular, parallel execution of computations for JRE and scheduling for GWT.- Parameters:
engine
- the pacemaker for running the modelcharge
- the model to supervise
-
-
Method Details
-
unload
public void unload()Unload the supervisor and free resources. -
reset
public void reset()Reset supervisor and update settings. -
update
public void update()Called after a change of parameters. -
next
public boolean next(double stepDt) Advances the PDE model by a time step ofstepDt
. Subclasses may override this method to implement optimizations. For example, GWT uses scheduling to avoid blocking the GUI.- Parameters:
stepDt
- the time step to advance the PDE- Returns:
true
if system converged- See Also:
-
react
protected double react()Perform the reaction step.Important: This is not thread-safe.
- Returns:
- the accumulated total change in state
-
diffuse
protected void diffuse()Perform the diffusion step.Important: This is not thread-safe.
-