Converter tool

Discrete-Event Queue Simulator

Simulate queues and service stations with arrivals, multi-server stations, routing and finite capacity. Run seeded replications and read utilisation, waits, cycle time and bottlenecks with confidence intervals.

One row per station

1. Your data

Or paste the table

What the simulator covers

Model and limits

An open network: entities arrive from outside at one or more stations, queue (first-in first-out unless a discipline column says lifo), are served by c identical servers, and are routed by probability to another station or out. A station with a capacity turns entities away when it holds that many. Distributions: exp, const, uniform, tri, lognormal, erlang.

Not modelled: priorities, batching, resource shifts and breakdowns, and animation. A replication stops with a message after 4 million events.

Discrete-Event Queue Simulator

Operator: Abdulla Al Fahad. How tools are built and checked

A queue that is 64% busy on average can still make people wait, because arrivals and service times are random and the waits pile up in bursts. Simulation lets you see that without algebra: entities arrive, wait for a free server, get served and move on, and the program records how long each of those steps took.

This page runs that experiment from a table of stations. You say how many servers each station has, how long service takes, where outside arrivals come in and where entities go next, and it repeats the run many times with different random streams so that every result carries a confidence interval rather than a single lucky number.

Because nobody should trust a simulation they cannot test, the page also solves the exact queueing formulas whenever your model is one of the cases that have them, and shows them next to the simulated values.

Key features

  • Open networks of stations: any number of servers, a service distribution, an optional capacity limit and probabilistic routing to other stations or out of the system
  • Six distributions: exponential, constant, uniform, triangular, lognormal and Erlang
  • A binary-heap event calendar, a separate seeded random stream per arrival source, service and routing decision, a warm-up period and up to 200 replications
  • Per station: utilisation, mean number in the station and in the queue, mean wait, mean time in the station, throughput and entities lost, each as mean plus or minus a 95% half-width
  • System throughput, cycle time, entities in the system, a bottleneck pointer, and a check of Little's law
  • Scenarios kept side by side, a JSON copy of the model and CSV or XLSX results

The station table, the distributions and how replications are summarised

One row per station. The service column holds a distribution such as exp(0.8), where the number is the mean time. The arrivals column holds an inter-arrival distribution for stations that receive entities from outside, for example exp(1.25) for a Poisson stream of 0.8 per time unit; leave it blank for stations fed only by other stations. Capacity is the most entities the station may hold, waiting and in service together, and blank means no limit.

The next column lists where an entity goes after service as station:probability pairs, for example Triage:0.7, Exam:0.3. Probabilities that add to less than 1 send the rest out of the system, the word exit does the same, and an empty cell means everyone leaves. A loop with no way out is rejected. An optional discipline column set to lifo serves the newest waiting entity first.

How it works

The calendar holds the next outside arrival of every source and the completion time of every busy server. The simulation repeatedly takes the earliest event, advances the clock, updates the time-weighted counts of how many entities are in each station, queue and server, and schedules whatever the event causes. When the warm-up ends all statistics are zeroed while the system keeps its entities, so the early, emptier period does not bias the averages.

Each replication uses its own random streams, so replications are independent and their means can be averaged. The half-width is Student's t for n minus 1 degrees of freedom times the standard deviation of the replication means over the square root of n.

With exponential service, Poisson arrivals and no capacity limits, each station is an M/M/c queue. The page solves the traffic equations for the arrival rate at every station, which is exact for a Jackson network, and computes utilisation, L, Lq, W and Wq from the Erlang formulas. A single station may also have a capacity limit, which gives the M/M/c/K formulas.

When to use it

  • A manager asks whether a second server at Reception is worth it. Its utilisation falls from 0.64 to 0.32, but the bottleneck marker stays at Exam, which is 0.69 busy either way, so the change only shortens the wait at the front desk.
  • A student runs the M/M/1 example with arrivals exp(1.25) and service exp(1). The queue is 80% busy, the mean number in the system is 4.053 ± 0.125 against the exact 4, and Little's law agrees within 0.03%.

Inputs

  1. Load the station table or choose Load 3-station clinic or Load M/M/1 queue.
  2. Set the run length, the warm-up to discard, the number of replications and a seed.
  3. Press Run the simulation and watch the replication counter; Cancel stops the worker.
  4. Read the station table, the system measures and, if shown, the closed-form comparison.
  5. Download the results, keep a scenario, change the table and run again to compare.
  6. Download the model JSON to document the settings you used.

Worked example

Three-station clinic, run length 20,000, warm-up 1,000, 30 replications, seed 1

station,servers,service,capacity,arrivals,next
Reception,1,exp(0.8),,exp(1.25),"Triage:0.7, Exam:0.3"
Triage,2,exp(2.4),,,"Exam:0.8, exit:0.2"
Exam,2,exp(2.0),,,exit

Simulated against exact (Jackson network)

Reception: utilisation 0.641 ± 0.003 (exact 0.640), mean in station 1.792 ± 0.029 (exact 1.778)
Triage: 0.672 ± 0.003 (0.672), 2.459 ± 0.042 (2.451)
Exam: 0.687 ± 0.003 (0.688), 2.623 ± 0.037 (2.613)
System: throughput 0.7997 ± 0.0025, cycle time 8.595 ± 0.060 (exact 8.551), 1.7 million events

Tips for best results

  • Use the same seed when comparing two designs. Both runs then see the same random streams, so a difference between scenarios is less likely to be noise.
  • Look at the entities-in-system chart: if the line is still climbing when the dashed warm-up marker ends, extend the warm-up.
  • Give a station a capacity to see blocking losses: M/M/1 with capacity 5 at the same load loses entities and carries a lower throughput than it is offered.

Limits

A station above about 95% utilisation settles very slowly. Its interval may look tight and still be biased by a start that was too short, so lengthen both run and warm-up.

The closed forms are steady-state results. They describe a run that is long enough to be in steady state, which is why the page asks for a warm-up.

Entities refused at a full station are lost, not retried or queued outside, so a cycle time then describes only the entities that got in.

Common errors and how to fix them

Station "Triage" routes to "Exm", which is not a station.
A route has to name another station exactly as written in the station column, or use exit.
Entities that reach "Exam" can never leave the system.
Every chain of routes must be able to end. Add an exit route, or probabilities that add to less than 1, somewhere along the loop.

Best practices

  • Run at least 30 replications and compare the interval half-width with the mean before drawing a conclusion; the page warns when it is above 10% of the mean.
  • Keep the model JSON next to your results so the settings behind a number can be recovered.

Warm-up and replications

Start-up bias is the main reason simulated waits come out too low: the first customers arrive at an empty system. Discarding the first stretch of time removes most of it, and the entities-in-system chart shows where the line levels off. Replications then measure randomness. Thirty replications of 20,000 time units each give a half-width of 0.029 on the mean number in the first clinic station; doubling the replications narrows that by about 30%, not by half.

What the closed-form comparison covers

The comparison table appears only for models it is exact for: exponential service and exponential inter-arrival times, no capacity limit except on a single station, and for networks the probabilistic routing of a Jackson network. If you change one service time to a constant or a triangular distribution the comparison disappears, because the formulas no longer apply and a number printed beside the simulation would be misleading.

With 95% intervals about one comparison in twenty is expected to miss by chance. The column counting how many of five measures sit inside their interval is meant for that kind of reading, not as a pass or fail.

Finite capacity

A capacity turns the station into a loss system for arrivals that find it full. M/M/1 with capacity 5, arrivals at 0.8 and service at 1, blocks 8.9% of arrivals, so the carried throughput is about 0.729. The page checks entities lost per run and flags the cycle-time caveat when any are lost.

Frequently asked questions

How do I know the engine is right?

Single stations are compared with the M/M/1, M/M/c and M/M/c/K formulas and networks with the Jackson solution. On the M/M/1 example the simulated mean number in the system is 4.053 ± 0.125 against the exact value 4, and Little's law L = lambda W holds within 0.03%.

Can entities have priorities or be batched?

No. Queues are first-in first-out, or last-in first-out with the discipline column. Priorities, batching, shifts, breakdowns and animation are not built.

What does a run that stops with a message about events mean?

One replication needed more than 4 million events, usually because the arrival rate is high for the run length. Shorten the run or lower the arrival rate rather than raising the limit, which exists to protect the browser.

Why do two scenarios with the same model differ slightly?

They differ if the seed or the run settings differ. With the same seed, the same table gives the same numbers to the last digit on any machine.