Skip to main content

BaseStatisticsMeasurer

A class in Root.Township, the global namespace.

Running statistics for a series of float values: sum, count, average, min and max. Subclasses can react to each value.

Constructors​

MemberWhat it is
BaseStatisticsMeasurer()Creates a BaseStatisticsMeasurer with default values.

Properties​

MemberWhat it is
float Average { get; }Sum divided by count (NaN before any value).
int Count { get; private set; }How many values were added.
float Max { get; private set; }Largest value so far (float.MinValue before any).
float Min { get; private set; }Smallest value so far (float.MaxValue before any).
float Sum { get; private set; }Total of all values.

Methods​

MemberWhat it is
void AddValue(float value)Adds a value, updates the totals and limits, then calls OnValueAdded.
protected virtual void OnValueAdded(float value)Hook for subclasses, called after each value. Empty here.