Operations · Simulator 071
Customers arrive at random and wait for a free server. Change how fast they arrive, how fast they are served, and how many servers there are. Watch the queue grow and shrink, and see why waiting times explode as servers approach 100% busy.
CollegeCollege operations research
This is an M/M/c queue: Poisson arrivals at rate λ, exponential service at rate μ per server, and c servers. The utilisation is ρ = λ / (cμ), which must stay below 1 or the queue grows without limit.
For one server (M/M/1):
L = ρ / (1 − ρ) (average number in system)
W = 1 / (μ − λ) (average time in system)
Little's law: L = λ W
Waiting time grows like 1/(1 − ρ): going from 80% to 90% busy doubles the average time in system, and 95% doubles it again. The simulator runs a discrete-event simulation with a seeded generator and compares measured averages with the Erlang C formula for c servers.
First-come first-served, infinite waiting room, no balking or reneging. Averages need long runs to settle, especially at high utilisation.
A help desk receives 30 calls per hour, and each takes 6 minutes on average. With one agent, what is the average time a caller spends in the system? With two?
λ = 0.5/min and μ = 1/6 per min, so one agent has ρ = 3, which is impossible: the queue grows for ever. Two agents also give ρ = 1.5, still unstable. You need at least 4 agents (ρ = 0.75). Try λ = 0.5, μ = 0.1667 with c = 4.
One server: λ = 3 customers per minute, μ = 4 per minute, so ρ = 0.75.
M/M/1 results: L = ρ / (1 − ρ) = 3 in the system, W = 1 / (μ − λ) = 1 minute, of which 0.75 min is queueing. Little's law checks: L = λW = 3 × 1.
Add 20% traffic (λ = 3.6, ρ = 0.9): W = 1 / 0.4 = 2.5 minutes. A small rise in load more than doubles the wait.
Two servers at the same utilisation (λ = 6, μ = 4, c = 2): with a = λ/μ = 1.5, P₀ = 1 / (1 + 1.5 + 1.5² / (2 × 0.25)) = 1/7, Lq = P₀ × 1.5² × 0.75 / (2 × 0.25²) ≈ 1.93, so Wq = 1.93 / 6 ≈ 0.32 min, less than half the single-server queueing time.
Set λ = 3, μ = 4, c = 1; then λ = 3.6; then λ = 6 with c = 2.
L = λW: the average number in a system equals the arrival rate times the average time each one spends there. It holds for almost any queue, whatever the arrival or service pattern.
Random bursts of arrivals build a queue that the server can only work off when it has spare capacity. As ρ approaches 1 there is almost no spare capacity, so the wait grows like 1 / (1 − ρ).
Arrivals are random (Markov, so Poisson), service times are random (exponential), and there are c servers sharing one queue.