|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.math.WindowedMean
public final class WindowedMean
A simple class keeping track of the mean of a stream of values within a certain window. the WindowedMean will only return a value in case enough data has been sampled. After enough data has been sampled the oldest sample will be replaced by the newest in case a new sample is added.
Constructor Summary | |
---|---|
WindowedMean(int window_size)
constructor, window_size specifies the number of samples we will continuously get the mean and variance from. |
Method Summary | |
---|---|
void |
addValue(float value)
adds a new sample to this mean. |
void |
clear()
clears this WindowedMean. |
float |
getLatest()
|
float |
getMean()
returns the mean of the samples added to this instance. |
float |
getOldest()
|
boolean |
hasEnoughData()
|
float |
standardDeviation()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WindowedMean(int window_size)
window_size
- size of the sample windowMethod Detail |
---|
public boolean hasEnoughData()
public void clear()
public void addValue(float value)
value
- The value to addpublic float getMean()
public float getOldest()
public float getLatest()
public float standardDeviation()
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |