Class ExponentiallyDecayedSum
java.lang.Object
com.illumon.numerics.movingaverages.ExponentiallyDecayedSum
- All Implemented Interfaces:
Serializable
A sum where the values are decayed at an exponential rate to zero.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExponentiallyDecayedSum(double decayRate, boolean enableTimestepOutOfOrderException) Creates a new exponentially decayed sum. -
Method Summary
Modifier and TypeMethodDescriptionlongdoublegetValue()voidprocessDouble(long timestamp, double data) voidreset()
-
Constructor Details
-
ExponentiallyDecayedSum
public ExponentiallyDecayedSum(double decayRate, boolean enableTimestepOutOfOrderException) Creates a new exponentially decayed sum.- Parameters:
decayRate- rate in milliseconds to decay the sum.enableTimestepOutOfOrderException- true to allow an exception to be thrown when timesteps are not sequential.
-
-
Method Details
-
processDouble
public void processDouble(long timestamp, double data) -
getValue
public double getValue() -
getLastTimestamp
public long getLastTimestamp() -
reset
public void reset()
-