Class TimeSeriesSimulationPlotter

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, EventListener

public class TimeSeriesSimulationPlotter extends JInternalFrame implements EventListener
A time series plotter is able to trace one or more data sources over time. It is based on JFreeChart library and uses data sources based on the microsim.statistics.* interfaces.

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002-17 Michele Sonnessa and Ross Richardson

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa and Ross Richardson
See Also:
  • Constructor Details

    • TimeSeriesSimulationPlotter

      public TimeSeriesSimulationPlotter(String title, String yaxis)
    • TimeSeriesSimulationPlotter

      public TimeSeriesSimulationPlotter(String title, String yaxis, boolean includeLegend, int maxSamples)
  • Method Details

    • addSource

      public void addSource(String legend, Supplier<? extends Number> source)
      Add a value source.
      Parameters:
      legend - Name of the series.
      source - The source of values.
    • addSource

      public void addSource(String legend, Supplier<? extends Number> source, Color lineColor, boolean shapesFilled, boolean isDashed, Shape shape)
      Add a value source and set some plotting properties.
      Parameters:
      legend - Name of the series.
      source - The source of values.
      lineColor - The color of the line.
      shapesFilled - whether to fill the markers.
      isDashed - whether the line is dashed.
      shape - what shape to use for markers.
    • addSource

      public void addSource(String legend, Supplier<? extends Number> source, Color lineColor, boolean validation)
      Add a value source and set plotting properties for validation plot.
      Parameters:
      legend - Name of the series.
      source - The source of values.
      lineColor - The color of the line.
      validation - Switch between two plotting styles for validation.
    • onEvent

      public void onEvent(Enum<?> type)
      Specified by:
      onEvent in interface EventListener
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IDoubleSource plottableObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series retrieving data from a IDoubleSource object, using the default variableId.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDoubleSource interface.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IDoubleSource plottableObject, Color lineColor, boolean shapesFilled, boolean isDashed, Shape shape)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series retrieving data from a IDoubleSource object.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDoubleSource interface.
      variableID - The variable id of the source object.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID, Color lineColor, boolean shapesFilled, boolean isDashed, Shape shape)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID, Color lineColor, boolean validation)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IFloatSource plottableObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a IFloatSource object, using the default variableId.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IFloatSource interface.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IFloatSource plottableObject, Enum<?> variableID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a IFloatSource object.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IFloatSource interface.
      variableID - The variable id of the source object.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, ILongSource plottableObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a ILongSource object, using the default variableId.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the ILongSource interface.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, ILongSource plottableObject, Enum<?> variableID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a ILongSource object.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDblSource interface.
      variableID - The variable id of the source object.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IIntSource plottableObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a IIntSource object, using the default variableId.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IIntSource interface.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, IIntSource plottableObject, Enum<?> variableID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a IIntSource object.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IIntSource interface.
      variableID - The variable id of the source object.
    • addSeries

      @Deprecated(forRemoval=true) public void addSeries(String legend, Object target, String variableName, boolean getFromMethod)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Build a series from a generic object.
      Parameters:
      legend - The legend name of the series.
      target - The data source object.
      variableName - The variable or method name of the source object.
      getFromMethod - Specifies if the variableName is a field or a method.
    • getMaxSamples

      public int getMaxSamples()
      Max samples parameters allow to define a maximum number of points. When set the plotting window shifts automatically along with time.
    • setMaxSamples

      public void setMaxSamples(int maxSamples)
      Set the max sample parameter.
      Parameters:
      maxSamples - Maximum number of time-steps rendered on x axis.
    • getRenderer

      public org.jfree.chart.renderer.xy.XYLineAndShapeRenderer getRenderer()
    • setRenderer

      public void setRenderer(org.jfree.chart.renderer.xy.XYLineAndShapeRenderer renderer)