Class TimeSeries

java.lang.Object
microsim.statistics.TimeSeries
All Implemented Interfaces:
EventListener, IUpdatableSource

@Deprecated(forRemoval=true) public class TimeSeries extends Object implements EventListener, IUpdatableSource
Deprecated, for removal: This API element is subject to removal in a future version.
use TimeSeries instead
It is a collection of series (data panel). It contains more series synching their time.

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002 Michele Sonnessa

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 8Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected cern.colt.list.DoubleArrayList
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final char
    Deprecated, for removal: This API element is subject to removal in a future version.
    The character used to separate data in the output file.
    protected ArrayList<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    A custom event identifier for perfomAction method.
    protected ArrayList<Series>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a new time series container.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSeries(Object target, String variableName, boolean getFromMethod)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    void
    addSeries(String name, IDoubleSource source, Enum<?> valueID)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    void
    addSeries(String name, IFloatSource source, Enum<?> valueID)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    void
    addSeries(String name, IIntSource source, Enum<?> valueID)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    void
    addSeries(String name, ILongSource source, Enum<?> valueID)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    void
    addSeries(Series aSeries)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a new series.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the current output file name.
    getSeries(int seriesIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return a series at the given index.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the number of series.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the list of contained time series.
    void
    onEvent(Enum<?> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Perform one of the defined actions.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Store the entire data content on the output file.
    void
    saveToFile(String path, String fileName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Store the entire data content on the given output file.
    void
    saveToFile(String path, String fileName, boolean withTimes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Store the entire data content on the given output file.
    void
    saveToFile(String path, String fileName, boolean withTimes, char separator)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Store the entire data content on the given output file.
    void
    setFileName(String fileName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the output file name.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Update all the contained time series and the current time.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EVENT_SAVE

      public static final int EVENT_SAVE
      Deprecated, for removal: This API element is subject to removal in a future version.
      A custom event identifier for perfomAction method. Save to disk.
      See Also:
    • DEFAULT_SEPARATOR

      public static final char DEFAULT_SEPARATOR
      Deprecated, for removal: This API element is subject to removal in a future version.
      The character used to separate data in the output file.
      See Also:
    • series

      protected ArrayList<Series> series
      Deprecated, for removal: This API element is subject to removal in a future version.
    • absTimes

      protected cern.colt.list.DoubleArrayList absTimes
      Deprecated, for removal: This API element is subject to removal in a future version.
    • descTimes

      protected ArrayList<String> descTimes
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • TimeSeries

      public TimeSeries()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new time series container.
  • Method Details

    • setFileName

      public void setFileName(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the output file name.
      Parameters:
      fileName - A valid path for the output file name.
    • getFileName

      public String getFileName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the current output file name.
      Returns:
      The output file name.
    • addSeries

      public void addSeries(Series aSeries)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      aSeries - An instance of the SeriesStats class.
      Throws:
      IllegalArgumentException - If the series name already exists.
    • addSeries

      public void addSeries(String name, IDoubleSource source, Enum<?> valueID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      name - Name of the statistic object.
      source - The IDoubleSource object.
      valueID - The value identifier defined by source object.
    • addSeries

      public void addSeries(String name, IFloatSource source, Enum<?> valueID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      name - Name of the statistic object.
      source - The IFloatSource object.
      valueID - The value identifier defined by source object.
    • addSeries

      public void addSeries(String name, IIntSource source, Enum<?> valueID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      name - Name of the statistic object.
      source - The IIntSource object.
      valueID - The value identifier defined by source object.
    • addSeries

      public void addSeries(String name, ILongSource source, Enum<?> valueID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      name - Name of the statistic object.
      source - The ILongSource object.
      valueID - The value identifier defined by source object.
    • addSeries

      public void addSeries(Object target, String variableName, boolean getFromMethod)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a new series.
      Parameters:
      target - A generic source object.
      variableName - The name of the field or the method returning the variable to be probed.
      getFromMethod - Specifies if valueName is a method or a property value.
    • updateSource

      public void updateSource()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Update all the contained time series and the current time.
      Specified by:
      updateSource in interface IUpdatableSource
    • getSeriesList

      public ArrayList<Series> getSeriesList()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the list of contained time series.
      Returns:
      An array list containing SeriesStats objects.
    • getSeries

      public Series getSeries(int seriesIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return a series at the given index.
      Parameters:
      seriesIndex - The name of the series.
      Returns:
      The asked series. Null if series does not exists.
      Throws:
      IndexOutOfBoundsException - If seriesIndex is out of bounds.
    • getSeriesCount

      public int getSeriesCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the number of series.
      Returns:
      The number of series.
    • saveToFile

      public void saveToFile()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Store the entire data content on the output file. It is used the default separator and the time description is stored with the absolute one.
    • saveToFile

      public void saveToFile(String path, String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Store the entire data content on the given output file. It is used the default separator and the time description is stored with the absolute one.
      Parameters:
      path - The optional path string. Passing an empty string it is ignored.
      fileName - The name of the output file.
    • saveToFile

      public void saveToFile(String path, String fileName, boolean withTimes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Store the entire data content on the given output file. It is used the default separator.
      Parameters:
      path - The optional path string. Passing an empty string it is ignored.
      fileName - The name of the output file.
      withTimes - If true time description is saved. Only absolute time is saved if false.
    • saveToFile

      public void saveToFile(String path, String fileName, boolean withTimes, char separator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Store the entire data content on the given output file.
      Parameters:
      path - The optional path string. Passing an empty string it is ignored.
      fileName - The name of the output file.
      withTimes - If true time description is saved. Only absolute time is saved if false.
      separator - The character used to separate data.
    • onEvent

      public void onEvent(Enum<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Perform one of the defined actions.
      Specified by:
      onEvent in interface EventListener
      Parameters:
      type - One of the following actions:
      Sim.EVENT_UPDATE calls the update() method.
      TimeSeries.EVENT_SAVE calls the saveToFile() method.