Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

UNIT 5

M/M/1 QUEUES

1
Introduction to
ExtendSim
Modeling the MM1 Queue

Approved for Public Release


09-MDA-4816 (27 AUG 09) 2
What is ExtendSim ?
 ExtendSim is one of many process modeling tools that
has been chosen to illustrate an example of a discrete-
event simulation.
 Using Extend, you can develop dynamic models of real-
life processes in a wide variety of fields.
 Use Extend to create models from building blocks,
explore the processes involved, and see how they relate.
 Then change assumptions to arrive at an optimum
solution.
 Similar tools include Arena and SimProcess

Approved for Public Release 3


09-MDA-4816 (27 AUG 09)
ExtendSim Windows

Approved for Public Release 4


09-MDA-4816 (27 AUG 09)
MM1 Queue Modeling Blocks
 From the Item library window, select and drag the following
blocks to the modeling window:
 Executive; Creator; Queue; Activity; and Exit.

 Statistics and Plotter


Approved for Public Release 5
09-MDA-4816 (27 AUG 09)
DOE: 480 minutes & 1 Run
 First, observe that the Average Wait is 2.2812, higher than the
known mean of 1.633
 Second, note the spikes in the graph of wait times. What has
occurred is that a long wait time for one entity tends to cause a long
wit time for the subsequent entities.

Approved for Public Release 6


09-MDA-4816 (27 AUG 09)
Enhancing the MM1
Queue Model
Experimental Design & Model
Validation

7
Enhancing the Model &
Experimental Design
 We will now add enhancements to our MM1 Queue model
 The reason for adding these enhancements are more than
cosmetic
 We will use these enhancements to determine if our simulation
model’s behavior is consistent with an analytical MM1 Queue
model
 In other words, we will use these enhancements to adjust the
simulation model until it is “valid”
 We must do this for several reasons:
 Simulation models do not necessarily start out at steady state
(ours starts out in an empty-idle state)
 Standard statistical techniques cannot be used with simulation
model results
 The experimental design is as important as the model

Approved for Public Release 8


09-MDA-4816 (27 AUG 09)
Characteristics of Queuing Systems:
The Arrival Process
 Arrival rate - the manner in which customers arrive at
the system for service.
 Arrivals are often described by a Poisson random
variable:

x e  
P( x)  , for x = 0, 1, 2, ...
x!
 l is the arrival rate (e.g., calls arrive at a rate of l=5
per hour)

Approved for Public Release 9


09-MDA-4816 (27 AUG 09)
Characteristics of Queuing Systems:
The Service Process
 Queue time - the amount of time spent awaiting service after
arrival.
 Service time - the amount of time a customer spends
receiving service (not including time in the queue).
 Service times are often described by an Exponential
random variable:
t2

P (t1  T  t 2 )   e  x dx  e ut1  e  t 2 , for t1  t 2


t1
 m is the service rate (e.g., calls can be serviced at a rate of
m=7 per hour)
 The average service time is 1/m.

Approved for Public Release 10


09-MDA-4816 (27 AUG 09)
A Spreadsheet Simulation of M/M/1
Queue Waiting Times (1)
 Suppose we have a queue with exponential interarrival
and service times, with mean interarrival time equal
0.7 units and mean service time equal 1.0 units.
 Use simulation to determine parameter estimates of
the average waiting time.
 Also calculate the known mean waiting time, given by:
λ
Wq 
μ μ  λ

Approved for Public Release 11


09-MDA-4816 (27 AUG 09)
Characteristics of Data from Dynamic
Systems
 This system is stable because the arrival rate is
less than the service rate, and the server is busy
approximately 70 percent of the time over a long
period.
 Twenty independent replications of the model,
consisting of 500 observations each, were run.
 In each replication, the initial waiting time was
set to zero, indicating that the system started in
the empty-and-idle state.
 The next graph shows the average over 20
replications of each observation in the series.
Approved for Public Release 12
09-MDA-4816 (27 AUG 09)
System Behavior of Transient M/M/1
Queue
Estimates of Waiting Time
in a Transient M/M/1 Queue

3.00
Avg. Waiting Time

2.00

1.00

0.00
0 100 200 300 400 500
Customer Number

Average Moving Avg

Approved for Public Release 13


09-MDA-4816 (27 AUG 09)
Influences on Mean Estimation
 The Initial Transient Period (next)
 Autocorrelated Observations (now)
 Waiting times are not independent—they are autocorrelated.
 If a customer’s waiting time is small, then the next
customer’s waiting time is likely to be small.
 The previous graph shows this effect: instead of “bouncing
around” above and below the stationary mean, the waiting
times will “make excursions” staying above the mean, then
dipping below the mean for periods of time.
 The practical effect of this behavior is that ordinary
statistical methods cannot be applied naively to compute a
reliable confidence interval for the mean.
 When appropriate techniques are used, a great deal of data
are frequently needed.

Approved for Public Release 14


09-MDA-4816 (27 AUG 09)
Characteristics of Data from
Dynamic Simulations (1)
 The Initial Transient Period
 There is a “warm-up period” during which the
mean waiting time appears to increase to a
value close to 2.0 and then settle back to a
value close to 1.6.
 Using λ = .7 and μ = 1.0, we can compute that
the true stationary mean waiting time is 1.6333.
 Thus, we see that in the first 100 observations,
there is much evidence that the waiting times
have settled into their stationary behavior.

Approved for Public Release 15


09-MDA-4816 (27 AUG 09)
Characteristics of Data from
Dynamic Simulations (2)
 The actual stationary distribution of waiting time is
known for the M/M/1 queue:
1   if w  0
Pr W  w       w
1  e if w  0
where r = l/m, with mean 1/(m − l).
 If the first waiting time is chosen from this distribution,
then all subsequent waiting times will be from this
distribution.
 By generating the first waiting time, we can produce a
sequence of waiting times, all of which are from the
stationary distribution.
Approved for Public Release 16
09-MDA-4816 (27 AUG 09)
Transient vs. Stationary M/M/1 Queue
Estimates of Waiting Time in a Transient M/M/1 Queue

4.0
Avg Waiting Time

3.0

2.0

1.0

0.0
0 50 100 150 200 250 300 350 400 450 500

Customer Number

Average Moving Average

Estimates of Waiting Time in Stationary M/M/1 Queue

3.5
Mean Waiting Time

3.0
2.5
2.0
1.5
1.0
0.5
0.0
0 50 100 150 200 250 300 350 400 450 500
Customer Number

Average Moving Average

Approved for Public Release 17


09-MDA-4816 (27 AUG 09)
Characteristics of Data from
Dynamic Simulations (3)

 The initial transient behavior is an important


characteristic of observations from a dynamic system.
 Every simulation of a dynamic system must begin in a
fixed state.
 The initial state cannot be selected from the stationary
distribution because the stationary distribution is not
known for those systems that we wish to simulate.
 Every simulation of a dynamic system must go through
an initial transient period before exhibiting the behavior
of a stationary distribution.

Approved for Public Release 18


09-MDA-4816 (27 AUG 09)
Batch Means Computation (1)
 After the initial transient period, we assume that all
remaining observations (non-transient) are sampled from
the system operating in steady state.
 The next problem is to choose a method to compute a
confidence interval for the mean.
 The simplest method is called the batched means
method (Fishman, 1979; Law & Kelton, 1984).
 Method:
 group observations into several batches,
 compute the sample mean of the observations in each batch,
and
 compute the confidence interval from these batched means
using traditional statistical techniques.

Approved for Public Release 19


09-MDA-4816 (27 AUG 09)
Batch Means Computation (2)
 Suppose we have the following 12 observations, after
removing initial transient observations:
1.2, 3.3, 2.6, 5.1, 4.4, 0.6, 0.0, 1.3, 1.5, 3,7, 3.5, 2.4
 Suppose we group these into three batches:

Batch 1 1.2, 3.3, 2.6, 5.1 Mean X1 = 3.05


Batch 2 4.4, 0.6, 0.0, 1.3 Mean X2 = 1.58
Batch 3 1.5, 3.7, 3.5, 2.4 Mean X3 = 2.78
 Now we treat the three batch means as if they are a sequence
of independent observations from the same population whose
mean we want to estimate.

X  2.47 and S X  .78


Approved for Public Release 20
09-MDA-4816 (27 AUG 09)
Batch Means Computation (3)
 A 95 percent confidence interval for the mean is

sX .78
X  t.025, 2  2.47  4.303
3 3
 2.47  1.95
  0.52,4.42

Note that ta,k is the 100(1 − a) percentage point on a


Student’s t-distribution with k degrees of freedom.

Approved for Public Release 21


09-MDA-4816 (27 AUG 09)
Guidelines
 If batch size is sufficiently large, the batch means
from separate batches will be approximately
uncorrelated.
 The batch means will be approximately normally
distributed when the batch size is sufficiently large.
 The batch means will also be approximately
independent when the batch size is sufficiently large.
 Our objective is to select the batch size large enough
that the batch means are approximately uncorrelated.
 At the same time, we must ensure a maximum
number of batches is formed.
 We usually want the number of batches to be at least
10, and the batch size to be at least 100.
Approved for Public Release 22
09-MDA-4816 (27 AUG 09)
Alternative
 An alternative to the batched means method, is to run
several independent replications.
 Compute the sample mean for each replication.
 Use these sample means to compute a confidence
interval for the mean.
 Because each replication starts with the same initial
condition, we are guaranteed that the sample means are
mutually independent, not just approximately
uncorrelated.
 Each replication must run through the initial transient
period, and each must reach steady state.
 Use a graphical method, such as a time series plot, to
judge the adequacy of the initial transient period.

Approved for Public Release 23


09-MDA-4816 (27 AUG 09)
DOE: 480 Minutes & 1 Run
This run will not provide us the results we are looking for!
 The waiting time at the queue does not appear to have
reached steady state.
 The average waiting time does not agree with the
analytic solution
 The waiting times show autocorrelation effects

2.1700

Approved for Public Release 24


09-MDA-4816 (27 AUG 09)
DOE: 660 Minutes & 10 Runs
 This experimental design resulted in 10 batches of
about 600 observations each.
 The true mean lies within the 95% confidence interval

1.620±0.2712

Approved for Public Release 25


09-MDA-4816 (27 AUG 09)
DOE: 720 Minutes, 100 Runs,
Initialized with 2 Entities
 The effects of the initial transient period have been
eliminated in two ways.
 The number of batches have increased to 100
 The queuing systems does not start in the empty-idle state
 The actual waiting time lies within the 95% confidence
interval of the simulation waiting time

1.626 ± 0.0849
Approved for Public Release 26
09-MDA-4816 (27 AUG 09)
Alternative: Clear Stats
 Allow the simulation to run until it has “reached” steady state, and
then begin to collect statistics
 We can do this with Extend’s Clear Statistics block from the Value
library
 Although we still see some effects of auto correlation, this is the usual
means for dealing with the initial transient period.

Approved for Public Release 27


09-MDA-4816 (27 AUG 09)
BMDS Model
 Hierarchical Modeling
 Simple ExtendSim LT BMDS End-to-End Model
 74 modeling blocks (LT limit is 75)
 Model could be more realistic with Full Version of ExtendSim

This model of the


BMDS is
hypothetical. In
this example, 38
targets were
detected, tracked, a l
and engaged. Of
on
i
ot
60 available
interceptors, 50
interceptors hit
the 38 targets, 10
N
interceptors
missed, and all 38
targets were
Approved for Public Release
engaged.
09-MDA-4816 (27 AUG 09)
28

You might also like