Theoretic steady state values are computed below for the MM4 queue:
mmc <- function (mean_inter, mean_service, c) {
lam <- mean_inter
mu <- mean_service
# If p is less than 1, we have a stable queue
p <- lam/(mu*c)
#empty vector to store values
summ <- 0
for (i in 1:c) {
summ <- summ + (c*p)^(i-1)/(factorial(i-1))
}
p0 <- (((c*p)^c)/(factorial(c)*(1-p)) + summ)^-1
#Wq is the steady state average time in the queue
Wq <- ((c*p)^c*p0) / (factorial(c)*c*mu*(1-p)^2)
#W is the steady state average time in the system
W <- Wq + 1/mu
# Lq is the steady state average number of entities in the queue
Lq <- (p * ((c*p)^c) * p0)/ (factorial(c)*((1-p)^2))
#L is the steady state average number of entities in the system (rather than the number in queue)
L <- Lq + (lam/mu)
df <- data.frame(p, Lq, L, W, Wq)
return(df)
}
mmc(2.4,0.7,4)
## p Lq L W Wq
## 1 0.8571429 4.218278 7.646849 3.186187 1.757616
My numbers were pretty far off from the expected values, despite running the experiment for 30 hours with a 20 hour warm up period and 10 replications. It also looked like the model was not running correctly because queues were forming at each teller window rather than at the transfer node. Image below:
I realized what I was doing wrong after reading Walt’s post on the discussion board.I had to create an input list and set the buffer on each server to 0 (the default is infinity). The model then seemed to run with a a single queue, as I orignally had expected it to.
alt text
My results are below, using a 95% confidence interval
alt text
mmc(2.4, 0.7, 4)
## p Lq L W Wq
## 1 0.8571429 4.218278 7.646849 3.186187 1.757616