Quodsi Docs

Randomness and replications

Real processes vary, and that variability is what creates queues. This page explains how Quodsi models it and how replications turn that randomness into an answer you can defend.

Why averages aren't enough

Suppose patients arrive every 6 minutes on average, and triage takes 5 minutes on average. A spreadsheet says the nurse is busy 83% of the time and nobody waits. In real life, patients bunch up and some triages run long, so a queue forms anyway. Averages hide that. A simulation shows it, because it plays out the variability one patient at a time.

Distributions

A distribution describes how a time varies. Wherever Quodsi asks for a duration, you pick a distribution type and fill in its values. Quodsi draws a new value each time it needs one, so each patient gets their own triage time.

TypeUse it when
ConstantThe time is always exactly the same, such as a machine cycle.
UniformYou know a minimum and maximum, and all values between them are equally likely. The minimum must be below the maximum; for one fixed value, use Constant.
TriangularYou know the minimum, the maximum and the most likely value. This is a good fit for estimates from the people doing the work.
NormalValues cluster around a mean, as with many human-driven tasks. Keep the mean at least two standard deviations above zero (see below).
ExponentialEvents happen independently at a constant average rate. Use it for random arrivals. It gives many short gaps and a few long ones.

A time can't be less than zero, so a draw below zero counts as zero. That raises the average. A Normal with mean 1 and standard deviation 2 draws below zero 31% of the time, so it averages 1.4, not 1. The same goes for a Uniform or Triangular whose minimum is below zero. Validation warns when more than about 2% of draws would fall below zero, and says what the average really is. If that isn't what you meant, move the distribution up, or use one that stays above zero, such as a Triangular starting at 0.

A generator interval that can only be zero, such as a Normal with mean 0 and standard deviation 0, is refused unless Max Entities or Periodic Occurrences limits it, because it would create entities without end at one instant. A time between failures that can only be zero is refused too.

What a replication is

A replication is one complete run of the model, from start to finish, with its own random draws. Think of it as one possible day at the clinic. Ten replications are ten possible days.

Quodsi runs every replication with the same model and settings. Only the random draws differ. It then summarizes each result across them, reporting the mean along with a 95% confidence interval: a range that shows how far you can trust that mean. Fewer replications or more variability give a wider range.

New models run 10 replications. You can change that with Replications, up to 100, in the Intermediate view. Your plan may set a lower limit, and the field tells you if you go over it.

The seed makes results repeatable

Quodsi's random numbers are not truly random. They come from a starting number called the seed, which defaults to 12345. The same model with the same seed gives the same results every time.

This matters in front of a client. You can rerun a model and get the numbers in your report. And when a rerun of the same model with the same seed gives a different result on the same Quodsi release, you know the model changed. A new release can change how something is measured, and with it the numbers.

Comparing two scenarios is different. Within a replication, every time in the model draws from one shared sequence of random numbers, in the order the run needs them. Change how many draws one step makes, for example by making it Constant or giving it breakdowns, and every later draw elsewhere moves along. So two scenarios don't see the same patient at the same moment, and part of any difference between them is chance. Changing a step's numbers while keeping its distribution type leaves the other steps' draws alone. Compare scenarios on enough replications that the confidence intervals tell the difference apart.

Each replication gets its own stream of random numbers, worked out from the seed and the replication number. Raising the replication count adds new replications and leaves the existing ones as they were.

You change the seed through the Random seed lever, on the Model editor's Levers tab (Intermediate view). A different seed gives a different set of possible days. If your conclusion only holds for one seed, it isn't a safe conclusion.

Next