Class MovingAverageTraceFunction

java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.functions.MovingAverageTraceFunction
All Implemented Interfaces:
EventListener, IDoubleSource, IUpdatableSource

@Deprecated(forRemoval=true) public class MovingAverageTraceFunction extends AbstractFunction implements IDoubleSource
Deprecated, for removal: This API element is subject to removal in a future version.
This class computes the average of the last values collected from a data source. The number of values used to compute the average value is specified in the constructor. The mean function return always double values, so it implements only the IDoubleSource interface.

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

    Nested classes/interfaces inherited from interface IDoubleSource

    IDoubleSource.Variables
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected IDoubleSource
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected IFloatSource
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected IIntSource
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected ILongSource
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected Enum<?>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected double[]
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Fields inherited from class AbstractFunction

    timeChecker
  • Constructor Summary

    Constructors
    Constructor
    Description
    MovingAverageTraceFunction(IDoubleSource source, Enum<?> valueID, int windowSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a basic statistic probe on a IDoubleSource object.
    MovingAverageTraceFunction(IFloatSource source, Enum<?> valueID, int windowSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a basic statistic probe on a IFloatSource object.
    MovingAverageTraceFunction(IIntSource source, Enum<?> valueID, int windowSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a basic statistic probe on a IIntSource object.
    MovingAverageTraceFunction(ILongSource source, Enum<?> valueID, int windowSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a basic statistic probe on a ILongSource object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Collect a value from the source.
    double
    getDoubleValue(Enum<?> valueID)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the result of a given statistic.
    void
    onEvent(Enum<?> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    ISimEventListener callback function.

    Methods inherited from class Object

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

    • TYPE_DBL

      protected static final int TYPE_DBL
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_FLT

      protected static final int TYPE_FLT
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_INT

      protected static final int TYPE_INT
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_LNG

      protected static final int TYPE_LNG
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • dblSource

      protected IDoubleSource dblSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fltSource

      protected IFloatSource fltSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • intSource

      protected IIntSource intSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • lngSource

      protected ILongSource lngSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • type

      protected int type
      Deprecated, for removal: This API element is subject to removal in a future version.
    • valueID

      protected Enum<?> valueID
      Deprecated, for removal: This API element is subject to removal in a future version.
    • len

      protected int len
      Deprecated, for removal: This API element is subject to removal in a future version.
    • values

      protected double[] values
      Deprecated, for removal: This API element is subject to removal in a future version.
    • average

      protected double average
      Deprecated, for removal: This API element is subject to removal in a future version.
    • valueCount

      protected int valueCount
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • MovingAverageTraceFunction

      public MovingAverageTraceFunction(IDoubleSource source, Enum<?> valueID, int windowSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a basic statistic probe on a IDoubleSource object.
      Parameters:
      source - The IDoubleSource object.
      valueID - The value identifier defined by source object.
    • MovingAverageTraceFunction

      public MovingAverageTraceFunction(IFloatSource source, Enum<?> valueID, int windowSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a basic statistic probe on a IFloatSource object.
      Parameters:
      source - The IFloatSource object.
      valueID - The value identifier defined by source object.
    • MovingAverageTraceFunction

      public MovingAverageTraceFunction(ILongSource source, Enum<?> valueID, int windowSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a basic statistic probe on a ILongSource object.
      Parameters:
      source - The ILongSource object.
      valueID - The value identifier defined by source object.
    • MovingAverageTraceFunction

      public MovingAverageTraceFunction(IIntSource source, Enum<?> valueID, int windowSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a basic statistic probe on a IIntSource object.
      Parameters:
      source - The IIntSource object.
      valueID - The value identifier defined by source object.
  • Method Details

    • applyFunction

      public void applyFunction()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Collect a value from the source.
      Specified by:
      applyFunction in class AbstractFunction
    • getDoubleValue

      public double getDoubleValue(Enum<?> valueID)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the result of a given statistic.
      Specified by:
      getDoubleValue in interface IDoubleSource
      Parameters:
      valueID - One of the F_ constants representing available statistics.
      Returns:
      The computed value.
      Throws:
      UnsupportedOperationException - If the given valueID is not supported.
    • onEvent

      public void onEvent(Enum<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      ISimEventListener callback function. It supports only jas.engine.Sim.EVENT_UPDATE event.
      Specified by:
      onEvent in interface EventListener
      Overrides:
      onEvent in class AbstractFunction
      Throws:
      UnsupportedOperationException - If actionType is not supported.