public final class BootstrappingDecayingRunningAverage extends java.lang.Object implements RunningAverage, java.lang.Cloneable
Constructor and Description |
---|
BootstrappingDecayingRunningAverage(double defaultValue,
double min,
double max,
int maxReports,
SimpleFieldSet fs)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
changeMaxReports(int maxReports)
Change
maxReports . |
BootstrappingDecayingRunningAverage |
clone()
Copy the RunningAverage (create a snapshot).
|
long |
countReports() |
double |
currentValue() |
SimpleFieldSet |
exportFieldSet(boolean shortLived)
Export this object as
SimpleFieldSet . |
void |
report(double d) |
void |
report(long d) |
protected double |
setCurrentValue(double d)
Not a public method. Changes the internally stored
currentValue and return the old one. |
double |
valueIfReported(double d)
Get what currentValue() would be if we reported some given value
|
public BootstrappingDecayingRunningAverage(double defaultValue, double min, double max, int maxReports, SimpleFieldSet fs)
defaultValue
- default valuemin
- minimum value of input datamax
- maxumum value of input datamaxReports
- number of reports before bootstrapping period ends and decay beginsfs
- SimpleFieldSet
parameter for this object. Will
override other parameters.public final BootstrappingDecayingRunningAverage clone()
RunningAverage
clone
in interface RunningAverage
clone
in class java.lang.Object
public double currentValue()
currentValue
in interface RunningAverage
protected double setCurrentValue(double d)
currentValue
and return the old one.
Used by DecayingKeyspaceAverage
to normalize the stored averages. Calling this function
may (purposefully) destroy the utility of the average being kept.d
- DecayingKeyspaceAverage
public void report(double d)
report
in interface RunningAverage
d
- public void report(long d)
report
in interface RunningAverage
d
- public double valueIfReported(double d)
valueIfReported
in interface RunningAverage
d
- public void changeMaxReports(int maxReports)
maxReports
.maxReports
- public long countReports()
countReports
in interface RunningAverage
public SimpleFieldSet exportFieldSet(boolean shortLived)
SimpleFieldSet
.shortLived
- See SimpleFieldSet.SimpleFieldSet(boolean)
.