Class SmoothedAverage


  • public class SmoothedAverage
    extends Object
    Used for statistics.
    Author:
    Charles Draper
    • Field Detail

      • DEFAULT_SMOOTHING_FACTOR

        public static final double DEFAULT_SMOOTHING_FACTOR
        See Also:
        Constant Field Values
    • Constructor Detail

      • SmoothedAverage

        public SmoothedAverage()
        Creates a new SmoothedAverage with the default smoothing factor.
      • SmoothedAverage

        public SmoothedAverage​(double smoothingFactor)
        Creates a new SmoothedAverage with the given smoothing factor.
        Parameters:
        smoothingFactor - the smoothing factor
    • Method Detail

      • add

        public void add​(double addend)
        Adds a new value to this statistic.
        Parameters:
        addend - the value to add
      • get

        public double get()
        Returns the smoothed average.
        Returns:
        the smoothed average