Distributions
A rate or a latency sets how long things take on average. The distribution sets how much each one differs from that average.
How it works#
A Generator, a Server, a Delay and a Shared Server each have a Distribution setting. On a generator it decides how the times between arrivals are spread around their mean; on a server, how the service times are; on a delay, how the times entities spend in it are; on a shared server, how the times entities would take if each were served alone are.
The rate keeps its meaning under every distribution. The mean time is always 1 / rate — Arrival Rate for a generator, Service Rate for a server, both in entities per second — so a server with a rate of 4 takes a quarter of a second on average whichever distribution it uses. A delay is set by a Latency in seconds instead of a rate, and its mean time is that Latency. A shared server has a Service Rate too, but it gives the mean time of an entity served alone; entities served together take longer. The distribution changes only how much individual times vary around the mean.
The defaults differ. A generator, a server and a shared server start out Exponential; a delay starts out Deterministic, so left alone it holds every entity for exactly its Latency.
- Exponentialdefault for a generator, a server and a shared server — no shape setting
- Memoryless times, as varied as their mean.
- Deterministicdefault for a delay — no shape setting
- The same time, every time.
- Uniformshape: Spread
- Any time within a spread around the mean, each as likely.
- Erlangshape: Stages
- A sum of exponential stages. More stages, less variation.
- Lognormalshape: Variability
- Skewed times with a long tail.
In the editor, Distribution sits between the rate and Wait Timeout in a generator's or server's settings, after Latency in a delay's, and between Service Rate and Contention in a shared server's. Each distribution has at most one extra setting for its shape — Spread, Stages or Variability — and that field appears only when the distribution that uses it is selected.
The handy measure for comparing them is the coefficient of variation: the standard deviation of the times divided by their mean. It is 0 when every time is the same and 1 for the exponential distribution. Variation is what makes queues: with the same two rates, steadier arrivals or steadier service mean shorter waits, and more erratic ones mean longer waits and more drops.
Exponential#
The default for a generator, a server and a shared server, with no shape setting. Times are memoryless: however long an arrival or a job has already taken, the time still to go looks the same. Most times are shorter than the mean and a few are much longer, and the standard deviation equals the mean — a coefficient of variation of 1.
This is the “M” in M/M/1. On a generator it makes the arrivals a Poisson process, the standard assumption for independent, uncoordinated traffic.
Deterministic#
No shape setting, and the default for a delay. Every time is exactly the mean — 1 / rate, or the Latency of a delay — and nothing random is drawn. Use it for arrivals on a fixed schedule or a step that always takes the same time: a timer, a machine cycle, a polling interval.
Uniform#
A time is equally likely anywhere in a band centred on the mean. Use it when all you know about a time is the range it falls in.
- Spreadshare of the mean, 0 to 1 — default 0.5
- How far either side of the mean a time can fall, as a share of the mean, in steps of 0.1. A time is equally likely anywhere between mean × (1 − spread) and mean × (1 + spread).
With a rate of 4 the mean is 0.25 seconds, and a spread of 0.5 gives times anywhere between 0.125 and 0.375 seconds. A spread of 0 gives a constant time, the same as Deterministic; a spread of 1 gives anything from 0 to twice the mean.
The coefficient of variation is spread / √3, so it never exceeds about 0.58: a uniform time is always steadier than an exponential one. The band is set by its spread around the mean only, not by a minimum and a maximum.
Erlang#
A time is the sum of several exponential stages, one after another. Use it for work that is a sequence of steps, or simply as a dial between exponential and constant.
- Stagesexponential stages, 1 to 100 — default 2
- How many exponential stages are added together to make one time. A whole number; each stage has a mean of the overall mean divided by the number of stages.
One stage is the exponential distribution. More stages mean less variation: the coefficient of variation is 1 / √stages, so 2 stages give about 0.71, 4 give 0.5 and 100 give 0.1. The overall mean stays the same however many stages there are.
Lognormal#
Skewed times with a long right tail, and always positive: most times sit below the mean and an occasional one is far above it. Use it for response times and other work where a few jobs take much longer than the rest.
- Variabilitystandard deviation over the mean, 0.1 to 10 — default 1
- The coefficient of variation of the times: their standard deviation divided by their mean, in steps of 0.1. The mean stays the same whatever the variability.
It is the one distribution here that can be more variable than the exponential. A variability below 1 is steadier than exponential; above 1 it is more erratic, with a heavier tail. At 1 it matches the exponential's variation but not its shape.
Kendall notation#
Queueing theory names a system by its arrival process, its service process and its number of servers. Each letter maps onto a Distribution setting: the first onto the generator, the second onto the server.
- M/M/1
- Exponential generator, Exponential server. The default for both.
- M/D/1
- Exponential generator, Deterministic server.
- D/M/1
- Deterministic generator, Exponential server.
- M/Eₖ/1
- Exponential generator, Erlang server with Stages set to k.
- M/G/1
- Exponential generator, and a server with any of the five — Uniform and Lognormal are the general cases the other rows do not cover.
The M/M/1, M/M/1/K and M/M/c models in the model library are exponential throughout. Open one and change a Distribution to see what the variation was costing: at the same rates, an M/D/1 waits in its queue half as long on average as an M/M/1.
Runs, results and saved models#
- During a live run the distribution is shown next to the rate or latency but cannot be changed. The rate, the latency and the shape — Spread, Stages or Variability — can be changed while the run is going. On a shared server a new shape applies to entities that enter afterwards.
- After a batch run the distribution and its shape are listed among each component's settings, read-only.
- The same seed gives the same run under every distribution, so a batch can be repeated whichever ones the model uses.
- A model saved before distributions existed has none set and runs exactly as it did before: a generator or a server as exponential, a delay as deterministic.