Class PDESupervisor

Object
PDESupervisor
Direct Known Subclasses:
PDESupervisorGWT

public class PDESupervisor extends Object
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
    Modifier and Type
    Field
    Description
    protected PDE
    The model to manage and supervise its execution.
    protected EvoLudo
    The pacemaker of all models.
    protected int
    The number of units in the discretization of the PDE.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PDESupervisor(EvoLudo engine, PDE charge)
    Creates a new supervisor to manage the PDE calculations of model charge.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Perform the diffusion step.
    boolean
    next(double stepDt)
    Advances the PDE model by a time step of stepDt.
    protected double
    Perform the reaction step.
    void
    Reset supervisor and update settings.
    void
    Unload the supervisor and free resources.
    void
    Called after a change of parameters.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • charge

      protected PDE charge
      The model to manage and supervise its execution.
    • nUnits

      protected int nUnits
      The number of units in the discretization of the PDE.
    • engine

      protected EvoLudo engine
      The pacemaker of all models. Interface with the outside world.
  • Constructor Details

    • PDESupervisor

      public PDESupervisor(EvoLudo engine, PDE charge)
      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 model
      charge - 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 of stepDt. 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.