public class MeanStatistic extends Statistic implements Printable, BatchExportable, UnweightedSampleCollector<java.lang.Double>
SampleStatistic
, but ignores batches. It therefore does
not calculate confidence intervals. The calculated mean is the true mean over
all samples, independent of the number of values per batch. For simplicity,
only the mean and the number of events is written to the result file.sampleIndex, simNode, traceWriter
Constructor and Description |
---|
MeanStatistic(SimNode ownNode) |
Modifier and Type | Method and Description |
---|---|
void |
computeMeasures(int batchNumber) |
void |
exportBatch(ResultWriter writer)
Exports the batch state to a result writer.
|
long |
getEvents() |
double |
getMean() |
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(java.lang.Double value) |
addResultTag, addResultTag, disableTracing, enableTracing, handleInitSimulation, handleStartBatch, handleStartTransientPhase, handleStopBatch, handleStopTransientPhase, printComments, update, writeTraceEntry
public MeanStatistic(SimNode ownNode)
public void update(java.lang.Double value)
update
in interface UnweightedSampleCollector<java.lang.Double>
public void printResults(ResultType type, PrintResultWriter writer) throws PrintException
printResults
in interface Printable
PrintException
public void resetStatistic()
Statistic
resetStatistic
in class Statistic
public void resetBatchStatistic()
Statistic
resetBatchStatistic
in class Statistic
public void computeMeasures(int batchNumber)
computeMeasures
in class Statistic
public void exportBatch(ResultWriter writer) throws PrintException
BatchExportable
importBatch
despite the keywords.exportBatch
in interface BatchExportable
writer
- the result writer which preserves the statePrintException
- if any exception occurs while writing a result to the writerpublic void importBatch(ResultReader reader) throws ImportException
BatchExportable
exportBatch
despite the keywords.importBatch
in interface BatchExportable
reader
- the result reader which contains the batch stateImportException
- if any exception occurs while reading a result from the readerpublic double getMean()
public long getEvents()