eduni.simjava
Class Sim_stat

Object
  extended byeduni.simjava.Sim_stat
All Implemented Interfaces:
Serializable

public class Sim_stat
extends Object
implements Serializable

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:

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:

More information on SimJava's statistical support can be found at the SimJava Tutorial.

Version:
1.0 11 July 2002
Author:
Costas Simatos
See Also:
Sim_system, Sim_entity, Serialized Form

Field Summary
(package private) static int ARRIVAL
           
static int ARRIVAL_RATE
          Constant specifying the entity's arrival rate.
(package private) static int END_HOLD
           
(package private) static int END_RESIDENCE
           
(package private) static int END_SERVICE
           
(package private)  double end_time
           
(package private) static int END_WAITING
           
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(String measure_name, int measure_type)
          Specify a (continuous) state, interval, or rate based custom measure to be calculated.
 void add_measure(String measure_name, int measure_type, boolean continuous)
          Specify a (continuous or non-continuous) state based custom measure.
 void add_measure(String measure_name, int measure_type, double level)
          Specify a continuous state based custom measure with a given initial state.
 void addAnnotation(String measure, Object[] annotation)
          Add an annotation to a measure's graph.
 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(String measure)
          Get the sample average for a custom measure.
 double average(String measure, double start_time, double end_time)
          Get the sample average for a custom measure, applying to a specific time interval.
 Object[] averages(String measure, double[] times)
          Get a series of sample averages, as well as the minimum and maximum observation for a measure based for a set of time values.
 void calc_proportions(int measure, double[] levels)
          Specify a default measure for which exceedence proportions are to be calculated.
 void calc_proportions(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(String measure)
          Get the event count for a custom rate based measure.
 int count(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(String measure)
          Get the exceedence proportions for the defined levels for a custom state or rate based measure.
 double exc_proportion(String measure, double level)
          Get an exceedence proportion for a custom state or interval based measure.
 double[] exc_proportion(String measure, double[] levels)
          Get the exceedence proportions for arbitrary levels, for a custom state or interval based measure.
 double[] exc_proportion(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(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.
 List[] get_data()
          Get all the data contained in the Sim_stat object.
 List get_detailed_measures()
          Get the information for the non-efficient measures defined in the Sim_stat object.
(package private)  int get_id()
           
 double[] get_levels(int measure)
          Get the exceedence proportion levels defined for a default measure.
 double[] get_levels(String measure)
          Get the exceedence proportion levels defined for a custom measure.
 List get_measures()
          Get the information for the measures defined in the Sim_stat object.
(package private)  String get_name_default(int measure)
           
 String get_name()
          Get the name of the entity to which this Sim_stat object belongs to.
(package private)  Sim_stat get_stat_copy()
           
(package private)  int get_type(String measure)
           
 List getAnnotations(String measure)
          Get a measure's graph annotations.
 boolean is_efficient(int measure)
          Check to see whether a default measure is specified to be efficient.
 boolean is_efficient(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(String measure)
          Get the maximum observation for a custom state or interval based measure.
 double maximum(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.
(package private)  double min_max_time(String measure)
           
 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(String measure)
          Get the minimum observation for a custom state or interval based measure.
 double minimum(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.
(package private)  int[] observation_count(int measure_id, double start_time, double end_time)
           
(package private)  int[] observation_count(String measure_name, double start_time, double end_time)
           
(package private)  void reset()
           
(package private)  void set_busy(double time)
           
(package private)  void set_data(HashMap data)
           
 void set_efficient(int measure)
          Mark a default measure as memory efficient.
 void set_efficient(String measure)
          Mark a custom measure as memory efficient
(package private)  void set_end_time(double end_time)
           
(package private)  void set_entity_info(int id, String name)
           
(package private)  void set_levels(List levels)
           
(package private)  void set_measures(List measures)
           
(package private)  void set_observations(List observations)
           
(package private)  void set_tags(List tags)
           
(package private)  void set_trans_time(double trans_time)
           
 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(String measure)
          Get the sample standard deviation for a custom state or interval based measure.
 double std_deviation(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.
(package private)  void steady_state_reached(double trans_time)
           
(package private)  void tidy_up()
           
(package private)  void update(int type, double start_time, double end_time)
           
(package private)  void update(int type, int tag, double time_occurred)
           
(package private)  void update(int type, int tag, double start_time, double end_time)
           
 void update(String measure, double time_occurred)
          Update a custom rate based measure.
 void update(String measure, double first, double end_time)
          Update a custom continuous state based or custom interval based measure.
 void update(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(String measure)
          Get the sample variance for a custom state or interval based measure.
 double variance(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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RATE_BASED

public static final int RATE_BASED
Constant defining rate based measures.

See Also:
Constant Field Values

STATE_BASED

public static final int STATE_BASED
Constant defining state based measures.

See Also:
Constant Field Values

INTERVAL_BASED

public static final int INTERVAL_BASED
Constant defining interval based measures.

See Also:
Constant Field Values

ARRIVAL

static final int ARRIVAL
See Also:
Constant Field Values

END_WAITING

static final int END_WAITING
See Also:
Constant Field Values

END_SERVICE

static final int END_SERVICE
See Also:
Constant Field Values

END_RESIDENCE

static final int END_RESIDENCE
See Also:
Constant Field Values

END_HOLD

static final int END_HOLD
See Also:
Constant Field Values

ARRIVAL_RATE

public static final int ARRIVAL_RATE
Constant specifying the entity's arrival rate.

See Also:
Constant Field Values

THROUGHPUT

public static final int THROUGHPUT
Constant specifying the entity's throughput.

See Also:
Constant Field Values

QUEUE_LENGTH

public static final int QUEUE_LENGTH
Constant specifying the entity's queue length.

See Also:
Constant Field Values

UTILISATION

public static final int UTILISATION
Constant specifying the entity's utilisation.

See Also:
Constant Field Values

WAITING_TIME

public static final int WAITING_TIME
Constant specifying the entity's event waiting time.

See Also:
Constant Field Values

RESIDENCE_TIME

public static final int RESIDENCE_TIME
Constant specifying the entity's event residence time.

See Also:
Constant Field Values

SERVICE_TIME

public static final int SERVICE_TIME
Constant specifying the entity's event service time.

See Also:
Constant Field Values

end_time

double end_time
Constructor Detail

Sim_stat

public Sim_stat()
The constructor used to create a new Sim_stat object.

Method Detail

set_entity_info

void set_entity_info(int id,
                     String name)

get_id

int get_id()

get_name

public String get_name()
Get the name of the entity to which this Sim_stat object belongs to.

Returns:
The Sim_stat owner's name

add_measure

public void add_measure(int measure)
Specify a default measure to be calculated.

Parameters:
measure - The int constant defining the default measure of interest

add_measure

public void add_measure(String measure_name,
                        int measure_type)
Specify a (continuous) state, interval, or rate based custom measure to be calculated. If a state based measure is defined the original state is set to 0.0.

Parameters:
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

add_measure

public void add_measure(String measure_name,
                        int measure_type,
                        double level)
Specify a continuous state based custom measure with a given initial state.

Parameters:
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 measure

add_measure

public void add_measure(String measure_name,
                        int measure_type,
                        boolean continuous)
Specify a (continuous or non-continuous) state based custom measure. If the measure is continuous the initial state is set to 0.0.

Parameters:
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.

calc_proportions

public void calc_proportions(int measure,
                             double[] levels)
Specify a default measure for which exceedence proportions are to be calculated. The measure must be state or interval based but not utilisation.

Parameters:
measure - The int constant defining the default measure of interest
levels - The set of exceedence proportion levels

calc_proportions

public void calc_proportions(String measure,
                             double[] levels)
Specify a custom measure for which exceedence proportions are to be calculated. The measure must be state or interval based.

Parameters:
measure - The name of the measure
levels - he set of exceedence proportion levels

measure_for

public void measure_for(int[] tags)
Specify a set of event tags for which measures are to be considered. This is used for default measures that need to be automatically updated. Events with tags other than the ones specified will not be considered for the defined default measures. If the measure is not called, all the event tags will be considered. Finally, in the case of utilisation, the selected tags are not taken into account and observations are always collected.

Parameters:
tags - The set of event tags of interest

set_efficient

public void set_efficient(int measure)
Mark a default measure as memory efficient.

Parameters:
measure - The int constant defining the default measure of interest

set_efficient

public void set_efficient(String measure)
Mark a custom measure as memory efficient

Parameters:
measure - The name of the measure

update

void update(int type,
            int tag,
            double time_occurred)

update

void update(int type,
            int tag,
            double start_time,
            double end_time)

update

void update(int type,
            double start_time,
            double end_time)

update

public void update(String measure,
                   double time_occurred)
Update a custom rate based measure.

Parameters:
measure - The name of the measure
time_occurred - The occurrence time of the event
Throws:
Sim_stat_exception - If an update error occurs. This error can be left unchecked.

update

public void update(String measure,
                   double level,
                   double start_time,
                   double end_time)
Update a custom non-continuous state based measure.

Parameters:
measure - The name of the measure
level - The state of the measure for this update
start_time - The interval's start time
end_time - The interval's end_time
Throws:
Sim_stat_exception - If an update error occurs. This error can be left unchecked.

update

public void update(String measure,
                   double first,
                   double end_time)
Update a custom continuous state based or custom interval based measure.

Parameters:
measure - The name of the measure
first - 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.
Throws:
Sim_stat_exception - If an update error occurs. This error can be left unchecked.

tidy_up

void tidy_up()

set_busy

void set_busy(double time)

steady_state_reached

void steady_state_reached(double trans_time)

count

public int count(int measure)
Get the event count for a default rate based measure. In the case of efficient measures, before steady state is reached the count applies to the entire run length up to that point. If steady state has been reached the count applies to the steady state up to that point.

If the provided measure isn't efficient the count applies to the entire run length.

Parameters:
measure - The int constant representing the default measure
Returns:
The event count
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

average

public double average(int measure)
Get the sample average for a default measure. In the case of efficient measures, before steady state is reached the average applies to the entire run length up to that point. If steady state has been reached the average applies to the steady state up to that point.

If the provided measure isn't efficient the average applies to the entire run length.

The measure provided may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
Returns:
The sample average
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

maximum

public double maximum(int measure)
Get the maximum observation for a default state or interval based measure. In the case of efficient measures, before steady state is reached the maximum applies to the entire run length up to that point. If steady state has been reached the maximum applies to the steady state up to that point.

If the provided measure isn't efficient the maximum applies to the entire run length.

The measure provided may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
Returns:
The maximum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

minimum

public double minimum(int measure)
Get the minimum observation for a default state or interval based measure. In the case of efficient measures, before steady state is reached the minimum applies to the entire run length up to that point. If steady state has been reached the minimum applies to the steady state up to that point.

If the provided measure isn't efficient the minimum applies to the entire run length.

The measure provided may not be utilisation.

Parameters:
measure - The int constant representing the default measure
Returns:
The minimum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

variance

public double variance(int measure)
Get the sample variance for a default state or interval based measure. The variance can't be obtained for a measure when it is defined as efficient. Furthermore, the measure provided may not be the utilisation. The variance applies to the entire run length.

Parameters:
measure - The int constant representing the default measure
Returns:
The sample variance
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

std_deviation

public double std_deviation(int measure)
Get the sample standard deviation for a default state or interval based measure. The standard deviation can't be obtained for a measure when it is defined as efficient. Furthermore, the measure provided may not be the utilisation. The standard deviation applies to the entire run length.

Parameters:
measure - The int constant representing the default measure
Returns:
The sample standard deviation.
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double[] exc_proportion(int measure,
                               double[] levels)
Get the exceedence proportions for arbitrary levels, for a default state or interval based measure. The proportions apply to the entire run length. The measure provided may not be utilisation.

Parameters:
measure - The int constant representing the default measure
levels - The levels for which exceedence proportions will be calculated
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double exc_proportion(int measure,
                             double level)
Get an exceedence proportion for a default state or interval based measure. The proportion applies to the entire run length. The measure provided may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
Returns:
The exceedence proportion
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double[] exc_proportion(int measure)
Get the exceedence proportions for the defined levels for a default state or rate based measure. In the case of efficient measures, before steady state is reached the proportions apply to the entire run length up to that point. If steady state has been reached they apply to the steady state up to that point.

If the provided measure isn't efficient the average applies to the entire run length.

The measure provided may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

count

public int count(String measure)
Get the event count for a custom rate based measure. In the case of efficient measures, before steady state is reached the count applies to the entire run length up to that point. If steady state has been reached the count applies to the steady state up to that point.

If the provided measure isn't efficient the count applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The event count
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

average

public double average(String measure)
Get the sample average for a custom measure. In the case of efficient measures, before steady state is reached the average applies to the entire run length up to that point. If steady state has been reached the average applies to the steady state up to that point.

If the provided measure isn't efficient the average applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The sample average
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

maximum

public double maximum(String measure)
Get the maximum observation for a custom state or interval based measure. In the case of efficient measures, before steady state is reached the maximum applies to the entire run length up to that point. If steady state has been reached the maximum applies to the steady state up to that point.

If the provided measure isn't efficient the maximum applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The maximum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

minimum

public double minimum(String measure)
Get the minimum observation for a custom state or interval based measure. In the case of efficient measures, before steady state is reached the minimum applies to the entire run length up to that point. If steady state has been reached the minimum applies to the steady state up to that point.

If the provided measure isn't efficient the minimum applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The minimum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

variance

public double variance(String measure)
Get the sample variance for a custom state or interval based measure. The variance can't be obtained for a measure when it is defined as efficient. The variance applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The sample variance
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

std_deviation

public double std_deviation(String measure)
Get the sample standard deviation for a custom state or interval based measure. The standard deviation can't be obtained for a measure when it is defined as efficient. The standard deviation applies to the entire run length.

Parameters:
measure - The name of the ustom measure
Returns:
The sample variance
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double[] exc_proportion(String measure,
                               double[] levels)
Get the exceedence proportions for arbitrary levels, for a custom state or interval based measure. The proportions apply to the entire run length.

Parameters:
measure - The name of the custom measure
levels - The levels for which exceedence proportions will be calculated
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double exc_proportion(String measure,
                             double level)
Get an exceedence proportion for a custom state or interval based measure. The proportion applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The exceedence proportion
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double[] exc_proportion(String measure)
Get the exceedence proportions for the defined levels for a custom state or rate based measure. In the case of efficient measures, before steady state is reached the proportions apply to the entire run length up to that point. If steady state has been reached they apply to the steady state up to that point.

If the provided measure isn't efficient the average applies to the entire run length.

Parameters:
measure - The name of the custom measure
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

count

public 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.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The event count
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

average

public double average(int measure,
                      double start_time,
                      double end_time)
Get the sample average for a default measure, applying to a specific time interval.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample average
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

maximum

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The maximum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

minimum

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The minimum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

variance

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample variance observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

std_deviation

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample standard deviation observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
levels - The set of levels for which exceedence proportions will be calculated
start_time - The interval's start time
end_time - The interval's end time
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public 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. The provided measure may not be the utilisation.

Parameters:
measure - The int constant representing the default measure
level - The level for which the exceedence proportion will be calculated
start_time - The interval's start time
end_time - The interval's end time
Returns:
The exceedence proportion
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

count

public int count(String measure,
                 double start_time,
                 double end_time)
Get the event count for a custom rate based measure, applying to a specific time interval.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The event count
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

average

public double average(String measure,
                      double start_time,
                      double end_time)
Get the sample average for a custom measure, applying to a specific time interval.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample average
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

maximum

public double maximum(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.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The maximum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

minimum

public double minimum(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.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The minimum observation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

variance

public double variance(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.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample variance
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

std_deviation

public double std_deviation(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.

Parameters:
measure - The name of the custom measure
start_time - The interval's start time
end_time - The interval's end time
Returns:
The sample standard deviation
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double[] exc_proportion(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.

Parameters:
measure - The name of the custom measure
levels - The set of levels for which exceedence proportions will be calculated
start_time - The interval's start time
end_time - The interval's end time
Returns:
The set of exceedence proportions
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

exc_proportion

public double exc_proportion(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.

Parameters:
measure - The name of the custom measure
level - The level for which the exceedence proportion will be calculated
start_time - The interval's start time
end_time - The interval's end time
Returns:
The exceedence proportion
Throws:
Sim_stat_exception - If there is an error in the passed parameters. This error can be left unchecked.

observation_count

int[] observation_count(String measure_name,
                        double start_time,
                        double end_time)

observation_count

int[] observation_count(int measure_id,
                        double start_time,
                        double end_time)

get_data

public List[] get_data()
Get all the data contained in the 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:

Returns:
The Sim_stat's data as described above

get_measures

public List get_measures()
Get the information for the measures defined in the Sim_stat object.

The information returned in the following form:

List {Object[] {String measure_name, Integer measure_type [, Boolean is_continuous]}, ... }

Returns:
The Sim_stat's measure information as described above

get_detailed_measures

public List get_detailed_measures()
Get the information for the non-efficient measures defined in the Sim_stat object.

The information is returned in the following form:

List {Object[] {String measure_name, Integer measure_type [, Boolean is_continuous]}, ... }

Returns:
The Sim_stat's measure information as described above

is_efficient

public boolean is_efficient(int measure)
Check to see whether a default measure is specified to be efficient.

Parameters:
measure - The int constant representing the default measure
Returns:
true if the measure is efficient, false otherwise

is_efficient

public boolean is_efficient(String measure)
Check to see whether a custom measure is specified to be efficient.

Parameters:
measure - The name of the measure
Returns:
true if the measure is efficient, false otherwise

get_levels

public double[] get_levels(int measure)
Get the exceedence proportion levels defined for a default measure.

Parameters:
measure - The int constant representing the default measure
Returns:
The set of levels or null if none have been specified

get_levels

public double[] get_levels(String measure)
Get the exceedence proportion levels defined for a custom measure.

Parameters:
measure - The name of the custom measure
Returns:
The set of levels or null if none have been specified

get_type

int get_type(String measure)

get_name_default

String get_name_default(int measure)

min_max_time

double min_max_time(String measure)

reset

void reset()

get_stat_copy

Sim_stat get_stat_copy()

set_measures

void set_measures(List measures)

set_observations

void set_observations(List observations)

set_levels

void set_levels(List levels)

set_tags

void set_tags(List tags)

set_data

void set_data(HashMap data)

set_end_time

void set_end_time(double end_time)

set_trans_time

void set_trans_time(double trans_time)

averages

public Object[] averages(String measure,
                         double[] times)
Get a series of sample averages, as well as the minimum and maximum observation for a measure based for a set of time values. This method is used by the SimJava Graph Viewer in order to efficiently calculate a set of sample averages. The form of the data obtained is:

Object[] {double[] averages, Double min, Double max}

This method should not be used in simulations.

Parameters:
measure - The name of the measure
times - The set of time values
Returns:
The averages, the minimum and the maximum in the form describde above

addAnnotation

public void addAnnotation(String measure,
                          Object[] annotation)
Add an annotation to a measure's graph. This method is used by the SimJava Graph Viewer to make annotations. It should not be used in simulations.

Parameters:
measure - The name of the measure
annotation - The text, and time and value pair of the annotation

getAnnotations

public List getAnnotations(String measure)
Get a measure's graph annotations. This method is used by the SimJava Graph Viewer to retrieve a graph's annotations. It should not be used in simulations.

Parameters:
measure - The name of the measure

detailed_measure_count

public int detailed_measure_count()
Get the number of detailed measures defined in this Sim_stat object.

Returns:
The number of defined detailed (non-efficient) measures