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

    • onEvent

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

      public void addSeries(String legend, IDoubleSource plottableObject)
      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

      public void addSeries(String legend, IDoubleSource plottableObject, Color lineColor, boolean shapesFilled, boolean isDashed, Shape shape)
    • addSeries

      public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID)
      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

      public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID, Color lineColor, boolean shapesFilled, boolean isDashed, Shape shape)
    • addSeries

      public void addSeries(String legend, IDoubleSource plottableObject, Enum<?> variableID, Color lineColor, boolean validation)
    • addSeries

      public void addSeries(String legend, IFloatSource plottableObject)
      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

      public void addSeries(String legend, IFloatSource plottableObject, Enum<?> variableID)
      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

      public void addSeries(String legend, ILongSource plottableObject)
      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

      public void addSeries(String legend, ILongSource plottableObject, Enum<?> variableID)
      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

      public void addSeries(String legend, IIntSource plottableObject)
      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

      public void addSeries(String legend, IIntSource plottableObject, Enum<?> variableID)
      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

      public void addSeries(String legend, Object target, String variableName, boolean getFromMethod)
      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)