|
SimJava v2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--eduni.simjava.Sim_stat
A class that provides entities with statistical support.
If a modeller is interested in collecting statistical measurements from an entity
he needs to create a Sim_stat
object, define measures of interest, and
set it as the entity's statistics gatherer. The Sim_stat
objects defined
in the simulation are also accessed by Sim_system
in order to apply output
analysis as well as certain transient and termination conditions.
The first step to adding statistical support to an entity is to create a Sim_stat
object in the entity's constructor. Following this, an add_measure
method is
called to define a measure of interest for the entity. This is repeated for each measure that
is of interest. The way in which a measure is defined depends on its type. A measure can be
either default or custom.
Default measures are measures that can be considered in most simulations. Since their
meaning is straightforward, observations for these can be collected automatically based on
the internal events within the simulation. All that is required from the modeller is to define
the default measures of interest and then let Sim_system
include summary statistics
based on their observations in the simulation report. The modeller also has access to the measures
at runtime via the several measurement calculation methods. The measurements that can be obtained
from default measures depend on the measure's type.
Custom measures on the other hand are measures with a simulation specific meaning. They are not generally applicable and as such the modeller needs to define their type and the instances at which they will be updated. Apart from the definition of custom measures and their updating, they do not differ in any way from default measures.
All measures can be classified in one of the following categories:
The default measures provided are the following:
The measurements available for each measure type are the following:
SimJava
are considered to have single
server behaviour.
These measurements are produced by relevant methods of Sim_stat
. These may be called at
runtime by the user to check a measure's progress, or at the simulation's end by Sim_system
in order to apply output analysis and to generate the simulation's report.
To calculate exceedence proportions the user calls calc_proportions
on the Sim_stat
object after the relevant measure has been defined. The levels of interest for which proportions will
be calculated are provided with this method.
The user also has the ability to specify certain event tags for which the measures defined should
be considered. This is made possible through the measure_for
method. The ability to
select tags of interest is important since events with specific tags are often used as control events
between the entities and do not represent actual system jobs. Furthermore, it could be the case that tags
differentiate between different types of events, in which case the user may be interested only in
measures for one of those types. The tags specified are used to decide whether or not observations should
be collected for default measures. In the case of custom measures the specified tags are not considered.
This is the case since custom measures are updated by the modeller explicitly.
Custom measures may also be used to implement default measures for several different event types. In this case the user defines separate measures for each event type of interest and proceeds to update them during the simulation run.
Apart from defining a measure as default or custom, the user has an additional option regarding its calculation efficiency. The default way in which measurements are calculated is through observation collection. Whenever an internal (for default measures) or user called update method (for custom measures) is used, an observation is collected based on the given parameters. The approach of collecting observations for each measure provides the maximum possible information level. Such detailed measures can be used with all output analysis methods, in all transient and termination conditions and also used to produce graphs of the measures' progress through time. However, considerable memory requirements are presented in this case that could be in certain cases prohibiting.
For this reason the user has the option to define a measure as being "efficient". In this case observations are not collected, but measurements are rather dynamically recalculated with each update. This approach minimises the memory requirements and is to be used in cases of large simulations with many entities and measures, which are to have large run lengths. The tradeoff in this case is functionality. When efficient measures are defined batch means can't be used as an output analysis method. Furthermore, the minimum-maximum method of transient period estimation can't be used with an efficient measure. The measurements of variance and standard deviation are not available for these measures and the other measurements may be calculated only for the entire run length or the entire steady state - not for arbitrary time periods. Finally, graphs may not be produced for efficient measures.
Which approach is to be used is left to the user's discretion. It is possible however to have a mix of
detailed and efficient measures with the above stated limitations. A measure is specified as being
efficient by calling a set_efficient
method while the Sim_stat
object is
being setup.
A final point of consideration is the order with which the setup steps are carried out for a Sim_stat
object:
Sim_stat
object is instantiated.
calc_proportions
method is called after the measure definition.
set_efficient
method. The main point here
is that measures must be set as efficient after they have been defined and also after exceedence
proportions have been specified.
Sim_stat
object is set to be the entity's statistics gatherer by using
the set_stat
method.
More information on SimJava
's statistical support can be found at the
SimJava Tutorial.
Sim_system
,
Sim_entity
, Serialized FormField Summary | |
static int |
ARRIVAL_RATE
Constant specifying the entity's arrival rate. |
static int |
INTERVAL_BASED
Constant defining interval based measures. |
static int |
QUEUE_LENGTH
Constant specifying the entity's queue length. |
static int |
RATE_BASED
Constant defining rate based measures. |
static int |
RESIDENCE_TIME
Constant specifying the entity's event residence time. |
static int |
SERVICE_TIME
Constant specifying the entity's event service time. |
static int |
STATE_BASED
Constant defining state based measures. |
static int |
THROUGHPUT
Constant specifying the entity's throughput. |
static int |
UTILISATION
Constant specifying the entity's utilisation. |
static int |
WAITING_TIME
Constant specifying the entity's event waiting time. |
Constructor Summary | |
Sim_stat()
The constructor used to create a new Sim_stat object. |
Method Summary | |
void |
add_measure(int measure)
Specify a default measure to be calculated. |
void |
add_measure(java.lang.String measure_name,
int measure_type)
Specify a (continuous) state or interval based custom measure to be calculated. |
void |
add_measure(java.lang.String measure_name,
int measure_type,
boolean continuous)
Specify a (continuous or non-continuous) state based custom measure. |
void |
add_measure(java.lang.String measure_name,
int measure_type,
double level)
Specify a continuous state based custom measure with a given initial state. |
double |
average(int measure)
Get the sample average for a default measure. |
double |
average(int measure,
double start_time,
double end_time)
Get the sample average for a default measure, applying to a specific time interval. |
double |
average(java.lang.String measure)
Get the sample average for a custom measure. |
double |
average(java.lang.String measure,
double start_time,
double end_time)
Get the sample average for a custom measure, applying to a specific time interval. |
void |
calc_proportions(int measure,
double[] levels)
Specify a default measure for which exceedence proportions are to be calculated. |
void |
calc_proportions(java.lang.String measure,
double[] levels)
Specify a custom measure for which exceedence proportions are to be calculated. |
int |
count(int measure)
Get the event count for a default rate based measure. |
int |
count(int measure,
double start_time,
double end_time)
Get the event count for a default rate based measure, applying to a specific time interval. |
int |
count(java.lang.String measure)
Get the event count for a custom rate based measure. |
int |
count(java.lang.String measure,
double start_time,
double end_time)
Get the event count for a custom rate based measure, applying to a specific time interval. |
int |
detailed_measure_count()
Get the number of detailed measures defined in this Sim_stat object. |
double[] |
exc_proportion(int measure)
Get the exceedence proportions for the defined levels for a default state or rate based measure. |
double |
exc_proportion(int measure,
double level)
Get an exceedence proportion for a default state or interval based measure. |
double[] |
exc_proportion(int measure,
double[] levels)
Get the exceedence proportions for arbitrary levels, for a default state or interval based measure. |
double[] |
exc_proportion(int measure,
double[] levels,
double start_time,
double end_time)
Get the exceedence proportions for a set of levels, for a default state or interval based measure, applying to a specific time interval. |
double |
exc_proportion(int measure,
double level,
double start_time,
double end_time)
Get an exceedence proportion for a specific level, for a default state or interval based measure, applying to a specific time interval. |
double[] |
exc_proportion(java.lang.String measure)
Get the exceedence proportions for the defined levels for a custom state or rate based measure. |
double |
exc_proportion(java.lang.String measure,
double level)
Get an exceedence proportion for a custom state or interval based measure. |
double[] |
exc_proportion(java.lang.String measure,
double[] levels)
Get the exceedence proportions for arbitrary levels, for a custom state or interval based measure. |
double[] |
exc_proportion(java.lang.String measure,
double[] levels,
double start_time,
double end_time)
Get the exceedence proportions for a set of levels, for a custom state or interval based measure, applying to a specific time interval. |
double |
exc_proportion(java.lang.String measure,
double level,
double start_time,
double end_time)
Get an exceedence proportions for a specific level, for a custom state or interval based measure, applying to a specific time interval. |
java.util.List[] |
get_data()
Get all the data contained in the Sim_stat object. |
java.util.List |
get_detailed_measures()
Get the information for the non-efficient measures defined in the Sim_stat object. |
double[] |
get_levels(int measure)
Get the exceedence proportion levels defined for a default measure. |
double[] |
get_levels(java.lang.String measure)
Get the exceedence proportion levels defined for a custom measure. |
java.util.List |
get_measures()
Get the information for the measures defined in the Sim_stat object. |
java.lang.String |
get_name()
Get the name of the entity to which this Sim_stat object belongs to. |
boolean |
is_efficient(int measure)
Check to see whether a default measure is specified to be efficient. |
boolean |
is_efficient(java.lang.String measure)
Check to see whether a custom measure is specified to be efficient. |
double |
maximum(int measure)
Get the maximum observation for a default state or interval based measure. |
double |
maximum(int measure,
double start_time,
double end_time)
Get the maximum observation for a default state or interval based measure, applying to a specific time interval. |
double |
maximum(java.lang.String measure)
Get the maximum observation for a custom state or interval based measure. |
double |
maximum(java.lang.String measure,
double start_time,
double end_time)
Get the maximum observation for a custom state or interval based measure, applying to a specific time interval. |
void |
measure_for(int[] tags)
Specify a set of event tags for which measures are to be considered. |
double |
minimum(int measure)
Get the minimum observation for a default state or interval based measure. |
double |
minimum(int measure,
double start_time,
double end_time)
Get the minimum observation for a default state or interval based measure, applying to a specific time interval. |
double |
minimum(java.lang.String measure)
Get the minimum observation for a custom state or interval based measure. |
double |
minimum(java.lang.String measure,
double start_time,
double end_time)
Get the minimum observation for a custom state or interval based measure, applying to a specific time interval. |
void |
set_efficient(int measure)
Mark a default measure as memory efficient. |
void |
set_efficient(java.lang.String measure)
Mark a custom measure as memory efficient |
double |
std_deviation(int measure)
Get the sample standard deviation for a default state or interval based measure. |
double |
std_deviation(int measure,
double start_time,
double end_time)
Get the sample standard deviation for a default state or interval based measure, applying to a specific time interval. |
double |
std_deviation(java.lang.String measure)
Get the sample standard deviation for a custom state or interval based measure. |
double |
std_deviation(java.lang.String measure,
double start_time,
double end_time)
Get the sample standard deviation for a custom state or interval based measure, applying to a specific time interval. |
void |
update(java.lang.String measure,
double time_occurred)
Update a custom rate based measure. |
void |
update(java.lang.String measure,
double first,
double end_time)
Update a custom continuous state based or custom interval based measure. |
void |
update(java.lang.String measure,
double level,
double start_time,
double end_time)
Update a custom non-continuous state based measure. |
double |
variance(int measure)
Get the sample variance for a default state or interval based measure. |
double |
variance(int measure,
double start_time,
double end_time)
Get the sample variance for a default state or interval based measure, applying to a specific time interval. |
double |
variance(java.lang.String measure)
Get the sample variance for a custom state or interval based measure. |
double |
variance(java.lang.String measure,
double start_time,
double end_time)
Get the sample variance for a custom state or interval based measure, applying to a specific time interval. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RATE_BASED
public static final int STATE_BASED
public static final int INTERVAL_BASED
public static final int ARRIVAL_RATE
public static final int THROUGHPUT
public static final int QUEUE_LENGTH
public static final int UTILISATION
public static final int WAITING_TIME
public static final int RESIDENCE_TIME
public static final int SERVICE_TIME
Constructor Detail |
public Sim_stat()
Sim_stat
object.Method Detail |
public java.lang.String get_name()
Sim_stat
object belongs to.
Sim_stat
owner's namepublic void add_measure(int measure)
measure
- The int
constant defining the default measure of interestpublic void add_measure(java.lang.String measure_name, int measure_type)
0.0
.
measure_name
- The name of the measure. This must be unique among the entity's measures.measure_type
- The int
constant that specifies the measure's typepublic void add_measure(java.lang.String measure_name, int measure_type, double level)
measure_name
- The name of the measure. This must be unique among the entity's measures.measure_type
- The int
constant that specifies the measure's type. In this
case the type must be STATE_BASED
.level
- The initial state of the measurepublic void add_measure(java.lang.String measure_name, int measure_type, boolean continuous)
0.0
.
measure_name
- The name of the measure. This must be unique among the entity's measures.measure_type
- The int
constant that specifies the measure's type. In this
case the type must be STATE_BASED
.continuous
- true
for a continuous measure, false
for a
non-continuous measure.public void calc_proportions(int measure, double[] levels)
measure
- The int
constant defining the default measure of interestlevels
- The set of exceedence proportion levelspublic void calc_proportions(java.lang.String measure, double[] levels)
measure
- The name of the measurelevels
- he set of exceedence proportion levelspublic void measure_for(int[] tags)
tags
- The set of event tags of interestpublic void set_efficient(int measure)
measure
- The int
constant defining the default measure of interestpublic void set_efficient(java.lang.String measure)
measure
- The name of the measurepublic void update(java.lang.String measure, double time_occurred)
measure
- The name of the measuretime_occurred
- The occurrence time of the eventSim_stat_exception
- If an update error occurs. This error can be left unchecked.public void update(java.lang.String measure, double level, double start_time, double end_time)
measure
- The name of the measurelevel
- The state of the measure for this updatestart_time
- The interval's start timeend_time
- The interval's end_timeSim_stat_exception
- If an update error occurs. This error can be left unchecked.public void update(java.lang.String measure, double first, double end_time)
measure
- The name of the measurefirst
- If the measure is state based this represents the update's level. If the
measure is interval based it represents the interval's start time.end_time
- If the measure is state based this represents the time at which the entity
entered the update's state. If the measure is interval based it represents
the interval's end time.Sim_stat_exception
- If an update error occurs. This error can be left unchecked.public int count(int measure)
If the provided measure isn't efficient the count applies to the entire run length.
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double average(int measure)
If the provided measure isn't efficient the average applies to the entire run length.
The measure provided may not be the utilisation.
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double maximum(int measure)
If the provided measure isn't efficient the maximum applies to the entire run length.
The measure provided may not be the utilisation.
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double minimum(int measure)
If the provided measure isn't efficient the minimum applies to the entire run length.
The measure provided may not be utilisation.
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double variance(int measure)
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double std_deviation(int measure)
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(int measure, double[] levels)
measure
- The int
constant representing the default measurelevels
- The levels for which exceedence proportions will be calculatedSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double exc_proportion(int measure, double level)
measure
- The int
constant representing the default measurelevels
- The level for which the exceedence proportion will be calculatedSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(int measure)
If the provided measure isn't efficient the average applies to the entire run length.
The measure provided may not be the utilisation.
measure
- The int
constant representing the default measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public int count(java.lang.String measure)
If the provided measure isn't efficient the count applies to the entire run length.
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double average(java.lang.String measure)
If the provided measure isn't efficient the average applies to the entire run length.
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double maximum(java.lang.String measure)
If the provided measure isn't efficient the maximum applies to the entire run length.
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double minimum(java.lang.String measure)
If the provided measure isn't efficient the minimum applies to the entire run length.
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double variance(java.lang.String measure)
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double std_deviation(java.lang.String measure)
measure
- The name of the ustom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(java.lang.String measure, double[] levels)
measure
- The name of the custom measurelevels
- The levels for which exceedence proportions will be calculatedSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double exc_proportion(java.lang.String measure, double level)
measure
- The name of the custom measurelevels
- The level for which the exceedence proportion will be calculatedSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(java.lang.String measure)
If the provided measure isn't efficient the average applies to the entire run length.
measure
- The name of the custom measureSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public int count(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double average(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double maximum(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double minimum(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double variance(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double std_deviation(int measure, double start_time, double end_time)
measure
- The int
constant representing the default measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(int measure, double[] levels, double start_time, double end_time)
measure
- The int
constant representing the default measurelevels
- The set of levels for which exceedence proportions will be calculatedstart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double exc_proportion(int measure, double level, double start_time, double end_time)
measure
- The int
constant representing the default measurelevel
- The level for which the exceedence proportion will be calculatedstart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public int count(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double average(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double maximum(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double minimum(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double variance(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double std_deviation(java.lang.String measure, double start_time, double end_time)
measure
- The name of the custom measurestart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double[] exc_proportion(java.lang.String measure, double[] levels, double start_time, double end_time)
measure
- The name of the custom measurelevels
- The set of levels for which exceedence proportions will be calculatedstart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public double exc_proportion(java.lang.String measure, double level, double start_time, double end_time)
measure
- The name of the custom measurelevel
- The level for which the exceedence proportion will be calculatedstart_time
- The interval's start timeend_time
- The interval's end timeSim_stat_exception
- If there is an error in the passed parameters. This error can be left unchecked.public java.util.List[] get_data()
Sim_stat
object. The data is a two sized
array of Lists
. The first element of the array contains the measures' information:
List {Object[] {String measure_name, Integer measure_type [, Boolean is_continuous]}, ... }
The second element contains the measures' observations:
List {Double occurrence_time, Double occurrence_time, ... }
- for rate based measures
List {double[] {state, start_time, end_time}, double[] {state, start_time, end_time}, ... }
- for state based measures
List {double[] {start_time, end_time}, double[] {start_time, end_time}, ... }
- for interval based measures
Sim_stat
's data as described abovepublic java.util.List get_measures()
Sim_stat
object.
The information returned in the following form:
List {Object[] {String measure_name, Integer measure_type [, Boolean is_continuous]}, ... }
Sim_stat
's measure information as described abovepublic java.util.List get_detailed_measures()
Sim_stat
object.
The information is returned in the following form:
List {Object[] {String measure_name, Integer measure_type [, Boolean is_continuous]}, ... }
Sim_stat
's measure information as described abovepublic boolean is_efficient(int measure)
measure
- The int
constant representing the default measuretrue
if the measure is efficient, false
otherwisepublic boolean is_efficient(java.lang.String measure)
measure
- The name of the measuretrue
if the measure is efficient, false
otherwisepublic double[] get_levels(int measure)
measure
- The int
constant representing the default measurenull
if none have been specifiedpublic double[] get_levels(java.lang.String measure)
measure
- The name of the custom measurenull
if none have been specifiedpublic int detailed_measure_count()
Sim_stat
object.
|
SimJava v2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |