Class MultiTraceFunction.Long

java.lang.Object
microsim.statistics.functions.MultiTraceFunction
microsim.statistics.functions.MultiTraceFunction.Long
All Implemented Interfaces:
EventListener, IDoubleSource, ILongSource, IUpdatableSource
Enclosing class:
MultiTraceFunction

public static class MultiTraceFunction.Long extends MultiTraceFunction implements ILongSource
An implementation of the MemorylessSeries class, which manages long type data sources.
Author:
Michele Sonnessa and Ross Richardson
  • Field Details

    • max

      protected long max
    • min

      protected long min
    • sum

      protected long sum
    • sumSquare

      protected long sumSquare
    • target

      protected ILongSource target
  • Constructor Details

    • Long

      public Long(ILongSource source, Enum<?> valueID)
      Create a basic statistic probe on a IDblSource object.
      Parameters:
      source - The ILongSource object.
      valueID - The value identifier defined by source object.
    • Long

      public Long(Object source, String valueName, boolean getFromMethod)
      Create a basic statistic probe on a generic object.
      Parameters:
      source - A generic source object.
      valueName - 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.
  • Method Details

    • updateSource

      public void updateSource()
      Read the source values and update statistics.
      Specified by:
      updateSource in interface IUpdatableSource
      Overrides:
      updateSource in class MultiTraceFunction
    • getDoubleValue

      public double getDoubleValue(Enum<?> valueID)
      Return the result of a given statistic.
      Specified by:
      getDoubleValue in interface IDoubleSource
      Overrides:
      getDoubleValue in class MultiTraceFunction
      Parameters:
      valueID - One of the F_ constants representing available statistics.
      Returns:
      The computed value.
      Throws:
      UnsupportedOperationException - If the given valueID is not supported.
    • getLongValue

      public long getLongValue(Enum<?> valueID)
      Return the result of a given statistic.
      Specified by:
      getLongValue in interface ILongSource
      Parameters:
      valueID - One of the F_ constants representing available statistics.
      Returns:
      The computed value.
      Throws:
      UnsupportedOperationException - If the given valueID is not supported.
    • getVariance

      public double getVariance()
      The variance function.
      Specified by:
      getVariance in class MultiTraceFunction
      Returns:
      The variance value.
    • getLastValue

      public long getLastValue()
      Return the last long value read from the source object.
      Returns:
      A long value collected at the last reading operation.
    • getMax

      public long getMax()
      The maximum function.
      Returns:
      The maximum value.
    • getSum

      public long getSum()
      The sum function.
      Returns:
      The sum of collected values.
    • getMin

      public long getMin()
      The minimum function.
      Returns:
      The minimum value.
    • getMean

      public double getMean()
      The mean function.
      Specified by:
      getMean in class MultiTraceFunction
      Returns:
      The mean value.