|
SSJ V. labo. |
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
BatchMeansSim | Performs a simulation experiment on an infinite horizon, for estimating steady-state performance measures, using batch means. |
RepSim | Performs a simulation experiment on a finite horizon, using a certain number of independent runs or replications. |
SimExp | Represents a framework for performing experiments using simulation. |
Provides some classes to manage simulation experiments. Let bar(X)n be an average of random vectors:
The simplest way to generate the sample (X0,…, Xn-1) is by simulating the same system n times, independently. In that setting, r becomes the index of a replication. In general, a simulation generates n copies of Xr to compute bar(X)n, in order to estimate μ. We may also be interested in some sample covariances of components of Xr, for computing confidence intervals on functions of μ. The most common functions return a single component of μ, or a ratio of two components.
For example, when simulating a M/M/1 queue, we may be able to get the total waiting time W for all customers, the number N of served customers, and the integral of the queue size over simulation time Q(T) = ∫0Tq(t) dt, where q(t) is the queue size at time t. In this case, Xr = (Wr, Nr, Qr(T)), and μ = (E[W], E[N], E[Q(T)]). Two interesting functions of μ are the expected waiting time per customer E[W]/E[N], and the time-average queue size E[Q(T)]/T. The functions are simply evaluated at bar(X)n to estimate the latter quantities.
The number of observations n is usually constant, but it may also be random if sequential sampling is used. With this scheme, after n0 observations are available, an error check is performed to determine if simulation should continue. For example, this check may evaluate the relative error of an estimated performance measure by dividing the half-width of a computed confidence interval by the point estimator, and require additional observations if this error is too high. The procedure is repeated until the stopping conditions are verified, or a maximal number of observations is obtained. However, because the sample size n is random, the estimator bar(X)n is biased when using sequential sampling.
The vector Xr is usually computed by summing costs incurred for various events during a part of the experiment. These costs can be waiting times, number of items, etc., not necessarily money. The computed sums may then be processed in a way depending of the simulated horizon and model to get the required values. If the horizon is finite, simulation stops after a finite time T, or a finite number N of events, and is usually repeated n times independently. Then, for replication r,
When the horizon is infinite, a single replication is usually simulated, and the cost per time unit or per event is computed in the long run in order to estimate
However, with a single long replication, computing sample covariances and confidence intervals is more difficult. A simple technique to overcome this problem is batch means, which divides the truncated horizon into successive intervals called batches. More specifically, let T0 be the time at which the warmup ends. We divide the horizon [T0, T] in n batches starting at times T0 < ... < Tn-1, and the last batch ends at Tn = T > Tn-1. Then, for batch r,
FunctionOfMultipleMeansTally
can be used for this.
This package provides helper classes to facilitate management of a
complex simulation experiment. A base class called
SimExp
contains methods to initialize
lists of statistical probes and to help in sequential sampling.
The subclass
RepSim
is used for simulating independent replications of a given model on a
finite horizon.
The subclass
BatchMeansSim
can be used for simulating a stationary model using the batch means
technique.
|
SSJ V. labo. |
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |