Three tellers share one line. It is the smallest model where pooling servers matters, and one of the few with an exact answer to check a simulation against.
Customers arrive on average every 4 minutes and a transaction takes 10 minutes on average, both exponential. Three tellers work one shared line, first come, first served.
Work arrives at 10 ÷ 4 = 2.5 tellers’ worth, so each teller is busy 2.5 ÷ 3, about 83% of the time. That sounds comfortable. Erlang C says otherwise: 70% of customers wait, and the mean wait over all customers is 14 minutes.
TELLERS STORAGE 3
GENERATE RVEXPO(1,4)
QUEUE LOBBY
ENTER TELLERS
DEPART LOBBY
ADVANCE RVEXPO(2,10)
LEAVE TELLERS
TERMINATE
GENERATE 480
TERMINATE 1
STORAGE of 3 is three identical tellers; ENTER and LEAVE take and give back one.The storage keeps its name and its capacity: storage Tellers capacity = 3. A customer queues in the lobby, enters the tellers when one is free, and leaves after an exponential service drawn from its own stream.
import <h4>
module tellers_h4
{
storage Tellers capacity = 3;
queue Lobby;
rn_stream Arrivals seed=100000;
rn_stream Service seed=200000;
float run_length = 480;
int served;
float waited;
float busy;
object customer
{
float arrived, service;
actions
{
arrived = time;
enqueue Lobby;
enter Tellers;
depart Lobby;
waited += time - arrived;
service = rv_expo(Service, 10.0);
advance service;
leave Tellers;
busy += service;
served++;
terminate;
}
}
procedure main
{
arrivals: customer iat = rv_expo(Arrivals, 4.0);
advance run_length;
report(system);
}
}
deck/tellers, without its header comment.Each run starts with an empty lobby at opening time, so a single day averages below the long-run figures further down. The day-to-day spread is wide.
| Measure | Mean of 20 runs | Lowest to highest run |
|---|---|---|
| Customers served | 113.3 ± 4.7 | 97 to 132 |
| Mean wait in line | 6.93 min ± 1.83 | 1.81 min to 14.99 min |
| Teller utilization | 75.09% ± 4.19 | 56.95% to 89.70% |
± is the 95% confidence interval of the mean over 20 runs.
Set run_length to 50,000 minutes and the averages land on the formula. Every theory value sits inside the simulated interval.
| Measure | Mean of 20 runs | Lowest to highest run | Theory |
|---|---|---|---|
| Mean wait in line (Wq) | 13.97 min ± 0.89 | 10.88 min to 19.98 min | 14.04 min |
| Mean number waiting (Lq) | 3.5 ± 0.2 | 2.7 to 5.0 | 3.5 |
| Teller utilization | 83.01% ± 0.48 | 81.05% to 84.86% | 83.33% |
Erlang C for M/M/3 with arrival rate 0.25 a minute and service rate 0.1 a minute. Lq is total waiting time divided by run length. The other three classic problems checked this way are on the verification page.
Set the capacity to 4 and run it again to see what a fourth teller buys; it is a one-word change. Giving each teller its own line takes three facilities and three queues; queueing theory says the same staff then gives longer waits, and the model lets you see by how much. The GPSS block names and what they become in chiaha-SLX are listed on the GPSS models page.
GPSS/H is a trademark of its owner. ChiAha is not affiliated with or endorsed by it.