Package arc.math
Class FloatCounter
java.lang.Object
arc.math.FloatCounter
Track properties of a stream of float values. The properties (total value, minimum, etc) are updated as values are
put(float)
into the stream.-
Field Summary
Modifier and TypeFieldDescriptionfloat
The average value (total / count)int
The amount of values addedfloat
The latest raw valuefloat
The largest valuefinal WindowedMean
Provides access to the WindowedMean if any (can be null)float
The smallest valuefloat
The sum of all valuesfloat
The current windowed mean value -
Constructor Summary
-
Method Summary
-
Field Details
-
mean
Provides access to the WindowedMean if any (can be null) -
count
public int countThe amount of values added -
total
public float totalThe sum of all values -
min
public float minThe smallest value -
max
public float maxThe largest value -
average
public float averageThe average value (total / count) -
latest
public float latestThe latest raw value -
value
public float valueThe current windowed mean value
-
-
Constructor Details
-
FloatCounter
public FloatCounter(int windowSize) Construct a new FloatCounter- Parameters:
windowSize
- The size of the mean window or 1 or below to not use a windowed mean.
-
-
Method Details
-
put
public void put(float value) Add a value and update all fields.- Parameters:
value
- The value to add
-
reset
public void reset()Reset all values to their default value.
-