Would opening a second ticket counter at Galway station cut the longest queue?
You're at Galway station and the ticket queue is growing. Would opening a second counter make much difference? You can replay the same rush with one counter and then with two, and see how long the queue gets in each run.
Start with the update rule you already know. In each one-minute step, add new arrivals to anyone still waiting. Serve up to the available capacity. If fewer people are waiting, serve only those people. Record how many are left after service.
Set how many customers one counter can serve per minute and how many counters are open. Feed both settings into the same update rule, then find the largest queue length in the log. Settings you can change without editing the rules are called scenario parameters.
You want to find out what difference the number of open counters makes. You're starting both runs with an empty queue and using the same update rule. Which inputs should you change for the second run? Pick the fairest test.
The function takes arrivals, counter count and the rate per counter. It starts with an empty queue and log, then multiplies counters by rate. Each minute, add arrivals, serve within capacity and log how many remain. Return the log and its peak. Replay the same arrivals at rate one, first with one counter, then two.
Read every pair as one counter, then two. At one customer per minute per counter, the capacities are one and two. Start empty. Three arrivals leave two and one. One arrival leaves two and zero. Four leave five and two. With no arrivals, four and zero remain. The peaks are five and two.
Both runs start empty and get two arrivals, then zero, then three. Each counter can serve one customer per minute. Work out how many people are still waiting after each minute's service. Pick the two peak queue lengths, with the one-counter result first.
On the left, the second run opens another counter and gets fewer arrivals. Even with the same rate per counter, a smaller peak could come from either change. On the right, you open another counter too, but you replay the same arrivals at the same rate. Only the counter count changes.
The current model counts people waiting. In an agent-based version, record when each person joins. Serve customers in arrival order and record when each starts service, so you can work out who waited longest. The queue can grow and clear as customers follow these rules. That group pattern is called emergent behaviour.
If an exam question asks you to describe the test, say that you increased the counter count from one to two. Both runs started empty and used the same arrivals, rate per counter and rules. To interpret the results, say that for these arrivals, the peak after service fell from five to two.