public class StdMedianStatistic extends MedianStatistic implements BatchExportable, ReflectionConstructable2<SimNode,Parameters>
maxBufferSize
can be set to
a number > 0, which determines the maximum number of samples the statistic
should hold in memory. The median is then calculated at the end of the
simulation as an approximation that is based on all samples. Often, 10000
samples are sufficient for a good approximation.MedianTimeMeter
sampleIndex, simNode, traceWriter
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
StdMedianStatistic(SimNode ownNode) |
StdMedianStatistic(SimNode ownNode,
int maxBufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
computeMeasures(int batchNumber) |
protected double |
computeMedian()
Returns the value for the median calculated from fSamples.
|
static StdMedianStatistic |
createInstance(SimNode ownNode,
Parameters pars)
as required by
ReflectionConstructable |
void |
exportBatch(ResultWriter writer)
Exports the batch state to a result writer.
|
long |
getBatchEvents() |
double |
getBatchMedian() |
long |
getEvents() |
double |
getMaximum() |
double |
getMedian() |
double |
getMedianConfidenceInterval() |
double |
getMinimum() |
void |
importBatch(ResultReader reader)
Imports the state of a batch from the result reader.
|
void |
resetBatchStatistic()
only between batches
|
void |
resetStatistic()
reset complete statistic
|
void |
update(double sample) |
getResultTypeName, printResults
addResultTag, addResultTag, disableTracing, enableTracing, handleInitSimulation, handleStartBatch, handleStartTransientPhase, handleStopBatch, handleStopTransientPhase, printComments, update, writeTraceEntry
public StdMedianStatistic(SimNode ownNode, int maxBufferSize)
public StdMedianStatistic(SimNode ownNode)
public static StdMedianStatistic createInstance(SimNode ownNode, Parameters pars)
ReflectionConstructable
protected double computeMedian()
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 readerpublic long getBatchEvents()
getBatchEvents
in class MedianStatistic
public double getBatchMedian()
getBatchMedian
in class MedianStatistic
public long getEvents()
getEvents
in class MedianStatistic
public double getMaximum()
getMaximum
in class MedianStatistic
public double getMedian()
getMedian
in class MedianStatistic
public double getMedianConfidenceInterval()
getMedianConfidenceInterval
in class MedianStatistic
public double getMinimum()
getMinimum
in class MedianStatistic
public void update(double sample)
update
in class MedianStatistic
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