Package org.evoludo.simulator.views
Class Mean
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,IsRenderable
,IsWidget
,ProvidesResize
,RequiresResize
,AbstractGraph.Controller
,AbstractGraph.Shifter
,AbstractGraph.Zoomer
,ChangeListener
,MilestoneListener
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
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractView
AbstractView.ExportCommand, AbstractView.ExportType
Nested classes/interfaces inherited from class UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface ChangeListener
ChangeListener.PendingAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe list of graphs that display the time series data.(package private) double[]
The state of the model at the current time.Fields inherited from class AbstractView
engine, exportSubmenu, exportSubmenuTrigger, gCols, gRows, isActive, isLoaded, logger, MIN_MSEC_BETWEEN_UPDATES, model, restoreMenu, timestamp, type, updatetime, wrapper
Fields inherited from class UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionMean
(EvoLudoGWT engine, Data type) Construct a new view to display the time series data of the current EvoLudo model. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Allocate all graphs managed by this view.protected AbstractView.ExportType[]
Return the list of export types that are acceptable for _all_ graphs in this view.getName()
Get the name of this view.void
Called after the EvoLudo model got re-initialized.void
Called when the settings of the EvoLudo model changed but no reset was necessary.void
reset
(boolean hard) Called when a module has been reset.void
update
(boolean force) Called when the view needs updating.Methods inherited from class AbstractView
activate, clear, createWidget, deactivate, destroyGraphs, dispose, export, export, exportDataHeader, exportMeanData, exportPNG, exportStatData, exportSVG, exportTrajData, getGraphAt, getLogger, getMode, getModel, getStatus, getStatus, getType, hasLayout, isRunning, keyDownHandler, keyUpHandler, layoutComplete, load, modelChanged, modelDidReset, modelStopped, modelUnloaded, moduleRestored, moduleUnloaded, onResize, populateContextMenu, scheduleUpdate, setBounds, setMode, shift, unload, update, zoom
Methods inherited from class Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
Methods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods inherited from class UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface AbstractGraph.Controller
setInitialState
Methods inherited from interface AbstractGraph.Shifter
shift
Methods inherited from interface AbstractGraph.Zoomer
zoom
Methods inherited from interface MilestoneListener
modelLoaded, modelRelaxed, modelRunning, moduleLoaded
-
Field Details
-
graphs
The list of graphs that display the time series data.- Implementation Notes:
List<LineGraph> graphs
is deliberately hidingList<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[] stateThe state of the model at the current time.
-
-
Constructor Details
-
Mean
Construct a new view to display the time series data of the current EvoLudo model.- Parameters:
engine
- the pacemaker for running the modeltype
- the type of data to display
-
-
Method Details
-
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 classAbstractView
- 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'scalcBounds(int, int)
is triggered throughsetBounds(int, int)
to properly calculate the layout.- Specified by:
allocateGraphs
in classAbstractView
- 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, unlesshard
istrue
.- Overrides:
reset
in classAbstractView
- 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 interfaceMilestoneListener
-
modelDidInit
public void modelDidInit()Description copied from interface:MilestoneListener
Called after the EvoLudo model got re-initialized.- Specified by:
modelDidInit
in interfaceMilestoneListener
- Overrides:
modelDidInit
in classAbstractView
-
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 unlessforce
istrue
.- Specified by:
update
in classAbstractView
- Parameters:
force
-true
to force the update
-
exportTypes
Description copied from class:AbstractView
Return the list of export types that are acceptable for _all_ graphs in this view.- Overrides:
exportTypes
in classAbstractView
- Returns:
- the list of viable export types
-