public abstract class Statistic
extends java.lang.Object
Statistic
is an abstract base class that
controls measurement and printing. Statistic
that is characterized by the
following:
resetStatistic()
causes a complete reset of the statistics at the
beginning of a simulation as well as after a warm-up phase
resetBatchStatistic()
causes a reset of counters, etc. at the
beginning of a batch
computeMeasures(int)
calculates a partial spot test from the
measured values of a batch
SimNode
to support the exporting, importing,
and printing of results.
update()
which often exists in
derived classes). These results are used to calculate an intermediate result
with computeMeasures(int)
at the end of a batch depending on the
statistics type. At the end of all batches the individual intermediate
results are dealt with as samples. Normally, a mean value is composed from
these samples and the confidence interval is determined. The confidence
interval is an indication of the statistical significance of the determined
value. It is defined as an interval, in which the actual value lies with the
probability \(q\) (default value \(q = 0.95\)). In order to determine the
confidence interval the student-t distribution is applied *. Statistic
, which define
these measurement procedures. There is one class for each of these special
statistics, that defines the interface for evaluation (e.g.,
SampleStatistic
) and another that
implements the evaluation functions (e.g.,
StdSampleStatistic
). Summation
for the registration and evaluation of measured
values or samples from the batches e.g., mean value, variance, standard
deviation and confidence interval of the mean values.
Range
to determine the smallest and largest mean value
during a batch or the complete simulation.
EstimationManager
, StatisticEstimation
,
Student
, StudentSearch
, StudentCalc
, and StudentMixed
to determine the confidence interval (calls
occur from Summation
automatically)
StatisticManager
), which contained the appropriate
create<*>Statistic()
and delete<*>Statistic()
methods, was used to create an object of a special statistics class. The
interface of the statistics manager was used to assure that the code of the
model components remained unchanged, should a statistics type (e.g.,
SampleStatistic
) be realized by a class
not belonging to the pre-defined standard statistics class (e.g.,
StdSampleStatistic
). Modifier and Type | Field and Description |
---|---|
protected int |
sampleIndex |
protected SimNode |
simNode |
protected ResultWriter |
traceWriter
Writer object to write trace entries
|
Modifier and Type | Method and Description |
---|---|
void |
addResultTag(ResultKeyword keyword,
java.lang.String value)
Adds a tag (keyword and value) to the output of this statistic in the
final results file.
|
void |
addResultTag(java.lang.String keyword,
java.lang.String value)
Convenience method which creates a new result keyword from a string.
|
abstract void |
computeMeasures(int batchNumber) |
void |
disableTracing()
Un-sets the writer object and disables tracing
|
void |
enableTracing(ResultWriter writer)
Sets the writer object and enables tracing
|
void |
handleInitSimulation() |
void |
handleStartBatch(int batchNumber) |
void |
handleStartTransientPhase() |
void |
handleStopBatch(int batchNumber) |
void |
handleStopTransientPhase() |
protected void |
printComments(PrintResultWriter writer) |
abstract void |
resetBatchStatistic()
only between batches
|
abstract void |
resetStatistic()
reset complete statistic
|
protected void |
update()
Basic update method, that triggers the output of trace entries
|
protected void |
writeTraceEntry()
Abstract method to be overwritten by derived statistics to output trace
entries
|
protected final SimNode simNode
protected ResultWriter traceWriter
protected int sampleIndex
public Statistic(SimNode ownNode)
public abstract void resetStatistic()
public abstract void resetBatchStatistic()
public abstract void computeMeasures(int batchNumber)
public void addResultTag(ResultKeyword keyword, java.lang.String value)
addResultTag(ResultKeywords.UNIT, "bytes")
.keyword
- the keyvalue
- the valuepublic void addResultTag(java.lang.String keyword, java.lang.String value)
keyword
- the keyvalue
- the valueaddResultTag(ResultKeyword, String)
protected void printComments(PrintResultWriter writer)
public void handleInitSimulation()
public void handleStartBatch(int batchNumber)
public void handleStartTransientPhase()
public void handleStopBatch(int batchNumber)
public void handleStopTransientPhase()
protected void update()
public void enableTracing(ResultWriter writer)
writer
- ResultWriter
connected to trace filepublic void disableTracing()
protected void writeTraceEntry()