public class WeightedMeanStatistic extends Statistic implements BatchExportable, Printable
WeightedMeanStatistic
is similar to
SampleStatistic
with the difference that
in the update(double, double)
method not only a measured value but
also a weight is passed. The default value for that weight is 1. Based on that
difference, only first order statistic are calculated.
getMean()
getBatchMean()
getMeanConfidenceInterval()
sampleIndex, simNode, traceWriter
Constructor and Description |
---|
WeightedMeanStatistic(SimNode ownNode) |
Modifier and Type | Method and Description |
---|---|
void |
computeMeasures(int batchNumber) |
void |
exportBatch(ResultWriter writer)
Exports the batch state to a result writer.
|
double |
getBatchMean() |
double |
getMean() |
double |
getMeanConfidenceInterval() |
java.lang.String |
getResultTypeName() |
void |
importBatch(ResultReader reader)
Imports the state of a batch from the result reader.
|
void |
printResults(ResultType type,
PrintResultWriter writer) |
void |
resetBatchStatistic()
only between batches
|
void |
resetStatistic()
reset complete statistic
|
void |
update(double sample) |
void |
update(double sample,
double weight) |
addResultTag, addResultTag, disableTracing, enableTracing, handleInitSimulation, handleStartBatch, handleStartTransientPhase, handleStopBatch, handleStopTransientPhase, printComments, update, writeTraceEntry
public WeightedMeanStatistic(SimNode ownNode)
public void printResults(ResultType type, PrintResultWriter writer)
printResults
in interface Printable
public java.lang.String getResultTypeName()
getResultTypeName
in interface Printable
public void update(double sample, double weight)
public final void update(double sample)
public double getMean()
public double getBatchMean()
public double getMeanConfidenceInterval()
public void computeMeasures(int batchNumber)
computeMeasures
in class Statistic
public void resetBatchStatistic()
Statistic
resetBatchStatistic
in class Statistic
public void resetStatistic()
Statistic
resetStatistic
in class Statistic
public void exportBatch(ResultWriter writer) throws ResultException
BatchExportable
importBatch
despite the keywords.exportBatch
in interface BatchExportable
writer
- the result writer which preserves the stateResultException
- if any exception occurs while writing a result to the writerpublic void importBatch(ResultReader reader) throws ResultException
BatchExportable
exportBatch
despite the keywords.importBatch
in interface BatchExportable
reader
- the result reader which contains the batch stateResultException
- if any exception occurs while reading a result from the reader