Complete problem 9 from Chapter 2 and problems 1 and 15 from Chapter 4 in Kelton.
#create reproducability
set.seed(123)
Find all five of the steady-state queueing metrics for an M/D/1 queue, where D denotes a deterministic ‘distribution,’ i.e., the associated RV (in this case representing service times) is a constant with no variation at all (also called a degenerate distribution). State parameter conditions for your results to be valid; use the same meaning for , , , as we did in this chapter. Compare your results to those if D were replaced by a distribution with mean equal to the constant value from the original D distribution, except having at least some variation.
For an M/D/1 queue with an avereage interarriaval time of 1.25 minutes and a consistant service time of 1 minute, find all five of \(W_{q}\), W, \(L_{q}\), L, and \(\rho\)
For this system: \(\lambda = 1/1.25 = 0.8\) \(\mu = 1/1 = 1\) \(\rho = \lambda / \mu = 0.8 / 1 = 0.8\)
In this case:
\(L = \rho + \frac{1}{2} * \frac{\rho^2}{1-\rho}\) \(L_{q} = \frac{1}{2} * \frac{\rho^2}{1-\rho}\) \(W = \frac{1}{\mu} + \frac{\rho}{2\mu(1-\rho)}\) \(W_{q} = \frac{\rho}{2\mu(1-\rho)}\)
arrivaltime <- 1.25
servtime <- 1
lamb <- 1/arrivaltime
mu <- 1/servtime
rho <- lamb / mu
L <- rho + (1/2)*(rho^2/(1-rho))
L_q <- (1/2)*(rho^2/(1-rho))
W <- 1/mu + rho/(2*mu*(1-rho))
W_q <- rho/(2*mu*(1-rho))
df1 <- data.frame('lambda'=lamb, 'mu'=mu, 'rho'=rho, 'L'=L, 'W'=W, 'L(q)'=L_q, 'W(q)'=W_q)
df1
## lambda mu rho L W L.q. W.q.
## 1 0.8 1 0.8 2.4 3 1.6 2
To compare this model to one with the same service time and exponential arrival time:
arrivaltime <- 1.25
servtime <- 1.25
lamb <- 1/arrivaltime
mu <- 1/servtime
rho <- lamb / mu
L <- rho + (1/2)*(rho^2/(1-rho))
L_q <- (1/2)*(rho^2/(1-rho))
W <- 1/mu + rho/(2*mu*(1-rho))
W_q <- rho/(2*mu*(1-rho))
data.frame('lambda'=lamb, 'mu'=mu, 'rho'=rho, 'L'=L, 'W'=W, 'L(q)'=L_q, 'W(q)'=W_q)
## lambda mu rho L W L.q. W.q.
## 1 0.8 0.8 1 Inf Inf Inf Inf
Create a model similar to Model 4-1 except use an arrival rate, , of 120 entities per hour and a service rate, , of 190 entities per hour. Run your model for 100 hours and report the number of entities that were created, the number that completed service, and the average time entities spend in the system.
Entities created: 2,987 Number completed service: 2,978 Average time entities spend in the system: 0.1717 hours
Build Simio models to confirm and cross-check the steady-state queueing theoretic results for the four specific queueing models whose exact steady-state output performance metrics are given in Section 2.3. Remember that your Simio models are initialized empty and idle, and that they produce results that are subject to statistical variation, so design and run Simio Experiments to deal with both of these issues; make your own decisions about things like run length, number of replications, and Warm-up Period, possibly after some trial and error. In each case, first compute numerical values for the queueing-theoretic steady-state output performance metrics W_{q}, W, L_{q}, L, and from the results in Section 2.3, and then compare these with your simulation estimates and confidence intervals. All those units are in minutes, and use minutes as well throughout your Simio models.
M/M/4 queue with arrival rate = 2.4 per minute and service rate = 0.7 per minute for each of the four individual servers (the same parameters used in the mmc.exe command-line programs shown in Figure 2.2).
\(p(0) = \frac{1}{\frac{(cp)^c}{c!(1-p)} + \sum_{\substack{c-1 \\ n=0}}\frac{(cp)^n}{n!}}\)
MM4 <- function(arrivetime, servtime, c=4){
#calculate required inputs
lambda <- 1/arrivetime
mu <- 1/servtime
rho <- lambda / (c*mu)
#calculate P(0) for 4 servers
p_0 <- (((1*rho)^0/factorial(0)) + ((2*rho)^1/factorial(1)) + ((3*rho)^2/factorial(2)) + ((4*rho)^3/factorial(3)) + ((4*rho)^4*(1/factorial(4))*(1/(1-rho))))^(-1)
#calculate required outputs
p_inf <- ((c*rho)^c * p_0) / (factorial(c) * (1-rho))
L <- c*rho + ((rho * p_inf)/1-rho)
W <- L/lambda
W_q <- W - 1/mu
L_q <- W_q * lambda
df <- data.frame('lambda'=lambda, 'mu'=mu, 'c'=c, 'rho'=rho, 'L'=L, 'L(q)'=L_q, 'W'=W, 'W(q)'=W_q, 'P(0)'=p_0, 'P(L(inf) >= c)'=p_inf)
df
}
MM4(2.4, 0.7)
## lambda mu c rho L L.q. W
## 1 0.4166667 1.428571 4 0.07291667 0.2187702 -0.07289647 0.5250485
## W.q. P.0. P.L.inf.....c.
## 1 -0.1749515 0.8516294 0.0002769924
The result using Simio is shown below:
Build a Simio model to confirm and cross-check the steady-state queueing-theoretic results from your solutions to the M/D/1 queue of Problem 9 in Chapter 2 (above). Remember that your Simio model is initialized empty and idle, and that it reproduces results that are subject to statistical variation, so your own decisions about things like run length, number of replications, and Warm-up Period, possibly after some trial and error. For each of the five steady-state queueing metrics, first compute numerical values for the queeueing-theoretic steady-state output performance metrics \(W_{q}\), W, \(L_{q}\), L, and from your solutions to Problem 9 in Chapter 2, and then compare these with your simulation estimates and confidence intervals. All time units are in minutes, and use minutes as well throughout your Simio model. Take the arrival rate to be = 1 per minute, and the service rate to be = 1/0.9 per minute.
df1
## lambda mu rho L W L.q. W.q.
## 1 0.8 1 0.8 2.4 3 1.6 2
The result using Simio is shown below:
The result using Simio is shown below: