Class Mean

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsRenderable, IsWidget, ProvidesResize, RequiresResize, AbstractGraph.Controller, AbstractGraph.Shifter, AbstractGraph.Zoomer, ChangeListener, MilestoneListener

public class Mean extends AbstractView implements AbstractGraph.Shifter, AbstractGraph.Zoomer
The view to display graphs with time series data. Typically this is used to track the mean fitness or configuration of the current EvoLudo model.

The view is interactive and allows to shift the time axis and to zoom in and out. For multiple graphs the zooming and shifting is synchronized.

Author:
Christoph Hauert
  • Field Details

    • graphs

      protected List<LineGraph> graphs
      The list of graphs that display the time series data.
      Implementation Notes:
      List<LineGraph> graphs is deliberately hiding List<AbstractGraph> graphs from the superclass because it saves a lot of ugly casting. Note that the two fields point to one and the same object.
    • state

      double[] state
      The state of the model at the current time.
  • Constructor Details

    • Mean

      public Mean(EvoLudoGWT engine, Data type)
      Construct a new view to display the time series data of the current EvoLudo model.
      Parameters:
      engine - the pacemaker for running the model
      type - the type of data to display
  • 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
      Returns:
      the name of this view
    • allocateGraphs

      protected void 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
      See Also:
    • 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
      Parameters:
      hard - the flag to indicate whether to do a hard reset
    • modelSettings

      public void modelSettings()
      Description copied from interface: MilestoneListener
      Called when the settings of the EvoLudo model changed but no reset was necessary.
      Specified by:
      modelSettings in interface MilestoneListener
    • modelDidInit

      public void modelDidInit()
      Description copied from interface: MilestoneListener
      Called after the EvoLudo model got re-initialized.
      Specified by:
      modelDidInit in interface MilestoneListener
      Overrides:
      modelDidInit in class AbstractView
    • 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
      Parameters:
      force - true to force the update
    • 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
      Returns:
      the list of viable export types