Class TimeWeightedSummaryStat

    • Constructor Detail

      • TimeWeightedSummaryStat

        public TimeWeightedSummaryStat()
        Constructs a new instance with lastTime and lastValue initialized with 0.
      • TimeWeightedSummaryStat

        public TimeWeightedSummaryStat​(TimeWeightedSummaryStat s)
        Copy constructor.
        Parameters:
        s - The object to copy.
    • Method Detail

      • value

        public TimeWeightedSummaryStat value​(double value,
                                             double time)
        Adds a new value, weighted by the difference between time and lastTime(). time is then saved for the next invocation of this method.
        Overrides:
        value in class SummaryStat
        Parameters:
        value - Value of some state variable from the point in time given as the second parameter.
        time - The point in time from which the current value is value
        Returns:
        this to allow easy chaining of calls.
      • min

        public double min()
        Description copied from class: SummaryStat
        Returns the minimum value seen so far.
        Overrides:
        min in class SummaryStat
        Returns:
        The minimum value seen so far, or NaN, if no values were given so far.
      • max

        public double max()
        Description copied from class: SummaryStat
        Returns the maximum value seen so far.
        Overrides:
        max in class SummaryStat
        Returns:
        The maximum value seen so far, or NaN, if no values were given so far.
      • variance

        public double variance()
        Description copied from class: SummaryStat
        Returns the sample variance of the values.
        Overrides:
        variance in class SummaryStat
        Returns:
        The (sample) variance of all values given to SummaryStat.value(double). Returns NaN, if no values were added yet.