Queue simulator
How many checkouts does a supermarket need to keep the queues short? Customers arrive at random, on average the number per hour you choose, and each takes a random time at the till. Run the clock through the day and watch the lines grow and shrink, with every customer a dot and the ones who have waited too long in red. Compare one shared line with a line per checkout, add a rush hour, and read the mean wait, the 95% wait and how busy the checkouts are. The chart shows the queue over time, the waiting times beside the Erlang C formula, or the mean wait for every number of checkouts with your target wait marked. A supermarket with up to 20 checkouts. Customers arrive at random, on average the number per hour you set, and each needs a random checkout time. Choose one shared line, where the first in line takes the next free checkout, or a line per checkout, where each customer joins the shortest line and stays there. Press Play to run the clock through the day, Skip to jump to closing time, Reset to go back to opening and New run for other customers. The chart shows the queue over time, the waiting times with the Erlang C theory, or how many checkouts keep the mean wait under your target. Red dots have waited longer than the target.
How it works
- Set the customers per hour, the mean checkout time and the number of checkouts; Busy shows how much of the time the checkouts work.
- Choose one shared line or a line per checkout, steady or random checkout times, and turn on Rush hour for a busy middle of the day.
- Press Play to run the clock from opening to closing, Skip to jump to closing time, or New run for another day with other customers.
- Switch the chart between the queue over time, the waiting times with the Erlang C curve and the checkouts needed for your target wait, and save the picture or open it in the editor in layers.
Random customers, random checkout times
Customers who each decide on their own when to shop arrive as a Poisson process: on average λ per hour, but in bursts and lulls, with exponential gaps between them. Their checkout times vary too; the simulator draws them from an exponential distribution with the mean you set, or keeps them within 20% of it with Steady. Every customer is simulated one by one: when they arrive, which checkout they reach, when they start and when they leave. The same settings and run give the same day, so changing only the number of checkouts or the kind of queue shows the effect on exactly the same customers.
How many checkouts are needed?
The offered load a = λ × S says how many checkouts the customers keep busy: 120 customers an hour at 2 minutes each is 4. With 4 checkouts they are busy 100% of the time and the line grows all day; with 5 they are busy 80% of the time and Erlang's 1917 formula, Erlang C, says 55% of customers wait, on average 1.1 minutes. A sixth checkout brings the mean wait down to 17 seconds. The Checkouts needed chart draws this theory for 1 to 20 checkouts, marks your target wait and the smallest number that meets it, and puts the simulated day beside it.
One line or a line per checkout
With one shared line, the first in line takes whichever checkout comes free, so no till stands idle while someone waits. With a line per checkout, each customer joins the shortest line and stays there, and a slow customer holds up everyone behind them while the next till may be empty. At the same load the separate lines wait noticeably longer and much more unevenly, which is why banks and many shops use a single snake line. Switch between the two and compare the tiles, the queue over time and the histogram of waiting times.
Frequently asked questions
What does the queue simulator do?
It simulates a supermarket with 1 to 20 checkouts, customer by customer. Customers arrive at random at the rate you set, wait in one shared line or a line per checkout, and take a random checkout time. You see the shop at each moment of the day, a chart of the queue or the waiting times, and tiles with the mean wait, the 95% wait, how busy the checkouts are and how many are needed.
What is the Erlang C formula?
A formula A. K. Erlang published in 1917 for the Copenhagen telephone exchange. For c servers, Poisson arrivals and exponential service times (the M/M/c queue) it gives the chance C(c, a) that a customer has to wait, and the mean wait C(c, a) × S/(c − a), where a = λS is the offered load. With 5 checkouts, 2 customers a minute and 2 minutes each, 55% wait and the mean wait is 1.1 minutes.
Why does the queue explode when the checkouts are almost always busy?
Because there is no spare time to catch up after a burst of customers or a slow one. For a single checkout the mean wait is ρ/(1 − ρ) times the checkout time: 4 times at 80% busy, 9 times at 90%, 99 times at 99%. At 100% or more the line keeps growing all day, which the Busy tile warns about.
Is one shared line better than a line per checkout?
Yes, at the same number of checkouts and customers: with one line no checkout is idle while someone waits, and customers are served in order. Joining the shortest of separate lines comes close but still waits longer on average, because a line can get stuck behind a slow customer while another till is free.
Why does my run differ from the theory?
A single day is random: some days get more bursts of customers than others, and the shop opens empty, which shortens the first waits. Press New run to see other days; averaged over many days the simulated waits settle on the Erlang C values. With Rush hour or Steady checkout times the theory is only an approximation, and it is worked out for the rush peak.
Can I use the picture?
Yes. Save gives a PNG, and the pencil opens the picture in the PictorX photo editor with the shop, the waiting customers, the customers at the tills, the chart's axes, data, theory curve, markers and labels on layers of their own. Everything is simulated in your browser.
Queue Simulator: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. You can add one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Go to Editor