Inventory policy Discrete-event simulation Runs in your browser

Inventory Stress Lab

Two reorder policies, one demand stream. A continuous (r, Q) rule and a periodic order-up-to rule face exactly the same seeded demand and lead times, day for day, so the difference you see between them comes from the policies rather than from luck. Unmet demand walks away rather than waiting in a backlog.

The model, stated plainly

What happens on a day

  1. Anything scheduled to arrive today arrives and joins on-hand stock.
  2. The policy reviews. The continuous rule looks every day; the periodic rule looks only on its review days.
  3. If the rule says to order, the order is placed and scheduled to arrive after its lead time. Lead time is at least one day, so nothing ever arrives the same day it is ordered.
  4. Demand arrives. Whatever is on the shelf is sold. Whatever is not on the shelf is lost — there is no backlog and no back-order queue, so a customer turned away today does not return tomorrow.
  5. Closing on-hand stock is charged holding cost.

Inventory position

Both rules review the actual inventory position: on-hand stock plus everything already ordered and still in transit. Tracking only on-hand stock is the classic way to over-order, because the same shortfall gets covered again on every review until the first shipment lands.

The two rules

How the two are made comparable

For each replication the lab draws one demand series and one lead-time series, then runs both policies against those same numbers. The lead time for an order placed on day t is the same draw for both policies, so when both order on the same day both wait the same number of days. This is common random numbers: it strips out the shared noise and leaves a much cleaner paired comparison than running the two policies on separate random streams.

Demand and lead times come from separate streams, so switching the demand distribution leaves the lead-time draws untouched and vice versa.

Where the model is thin

Set up the scenario

Demand

Only used by the normal option. Poisson fixes the variance at the mean.

Lead time

Whole days. One is the smallest the model allows.

Set it equal to the shortest for a fixed lead time. Otherwise every whole number in the range is equally likely.

Policies
Costs
Run

Any text. The same seed and settings give identical results every time.

Fixed for every run: 30 warmup days that are simulated but not scored, 180 measured days, and 100 replications.

Self-tests

A simulation is easy to get subtly wrong, and a wrong one still produces confident-looking averages. These checks run the same simulation code and confirm the accounting closes: units are conserved, stock never goes negative, orders fire only when the rule says they should, and the same seed reproduces the same numbers. The values in the table are computed when you press the button.

Also callable from the console as window.runToolTests().

Things worth trying