@ExportedBean public final class TimeSeries extends Object implements Serializable
This class computes
the exponential moving average from the raw data (to be supplied by update(float)
).
Constructor and Description |
---|
TimeSeries(float initialValue,
float decay,
int historySize) |
Modifier and Type | Method and Description |
---|---|
float[] |
getHistory()
Gets the history data of the exponential moving average.
|
float |
getLatest()
Gets the most up-to-date data point value.
|
String |
toString() |
void |
update(float newData)
Pushes a new data point.
|
public void update(float newData)
Exponential moving average is calculated, and the history
is updated.
This method needs to be called periodically and regularly, and it represents
the raw data stream.
@Exported public float[] getHistory()
@Exported public float getLatest()
getHistory[0]
.Copyright © 2004–2019. All rights reserved.