Class S3

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsRenderable, IsWidget, ProvidesResize, RequiresResize, ChangeListener, LifecycleListener, RunListener, SampleListener

public class S3 extends AbstractView<S3Graph>
The view to display time series of data as a trajectory on the \(S_3\) simplex.
Author:
Christoph Hauert
Implementation Notes:
Note (yet) ready for multiple species!
  • Field Details

    • state

      protected double[] state
      The current state of the model. The end point of the current trajectory.
  • Constructor Details

    • S3

      public S3(EvoLudoGWT engine)
      Construct a new view to display the time series data of the current EvoLudo model as a trajectory in a \(S_3\) simplex.
      Parameters:
      engine - the pacemaker for running the model
  • Method Details

    • getName

      public String getName()
      Description copied from class: AbstractView
      Get the name of this view. This is used to dynamically build the view selector.
      Specified by:
      getName in class AbstractView<S3Graph>
      Returns:
      the name of this view
    • allocateGraphs

      protected boolean allocateGraphs()
      Description copied from class: AbstractView
      Allocate all graphs managed by this view. This is called when loading the view. Once all views are attached to the browser DOM a call to the graph's calcBounds(int, int) is triggered through setBounds(int, int) to properly calculate the layout.
      Specified by:
      allocateGraphs in class AbstractView<S3Graph>
      Returns:
      true if graphs were (re)allocated
      See Also:
    • createS3Graph

      private S3Graph createS3Graph(Module<?> module, int role)
      Helper method to create and configure an S3Graph for a given role.
      Parameters:
      module - module supplying the data
      role - role index (strategy) to visualize
      Returns:
      configured graph instance
    • unload

      public void unload()
      Description copied from class: AbstractView
      Unload the view. This is called when changing the module or model that implement this view. This is independent of the activation of the view.
      Overrides:
      unload in class AbstractView<S3Graph>
    • reset

      public void reset(boolean hard)
      Description copied from class: AbstractView
      Called when a module has been reset. All graphs are reset and updated if needed, unless hard is true.
      Overrides:
      reset in class AbstractView<S3Graph>
      Parameters:
      hard - the flag to indicate whether to do a hard reset
    • modelDidInit

      public void modelDidInit()
      Description copied from interface: RunListener
      Called after the EvoLudo model got re-initialized.
      Specified by:
      modelDidInit in interface RunListener
      Overrides:
      modelDidInit in class AbstractView<S3Graph>
    • update

      public void update(boolean force)
      Description copied from class: AbstractView
      Called when the view needs updating. This gets called when the selected view changed or new data is available from the model. Views may ignore updating requests unless force is true.
      Specified by:
      update in class AbstractView<S3Graph>
      Parameters:
      force - true to force the update
    • setInitialState

      public boolean setInitialState(double[] init)
      Description copied from class: AbstractView
      Notifies the controller that the user requested setting a new initial configuration init (optional implementation).
      Overrides:
      setInitialState in class AbstractView<S3Graph>
      Parameters:
      init - the new initial configuration
      Returns:
      true if the request was honoured
    • exportTypes

      protected AbstractView.ExportType[] exportTypes()
      Description copied from class: AbstractView
      Return the list of export types that are acceptable for _all_ graphs in this view.
      Overrides:
      exportTypes in class AbstractView<S3Graph>
      Returns:
      the list of viable export types