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
- Anything scheduled to arrive today arrives and joins on-hand stock.
- The policy reviews. The continuous rule looks every day; the periodic rule looks only on its review days.
- 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.
- 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.
- 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
- Continuous (r, Q). Reviewed daily. When the inventory position falls to r or below, order whole lots of Q until the position sits above r. Ordering in lot multiples matters when a large day of demand drops the position far below r at once; a single lot would leave it short.
- Periodic order-up-to (R, S). Reviewed every R days. When the inventory position is below S, order the gap so the position lands exactly on S. Between reviews the rule does nothing, whatever happens.
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
- The continuous rule is reviewed once a day, not truly continuously. On a daily clock that is the closest it gets.
- Orders may cross: with variable lead times a later order can arrive before an earlier one. The lab allows this rather than forcing arrivals into sequence, which is the more realistic of the two choices but makes some textbook formulas inapplicable.
- Each policy starts full at its own target — the continuous rule at r plus Q, the periodic rule at S. The 30-day warmup exists to let that starting choice wash out, but it does not erase it completely.
- No capacity limits, no minimum order quantities, no quantity discounts, no perishability, no supplier failures.
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
- Widen the lead time without changing its mean. Move from 4 to 4 days up to 1 to 7 days. The average wait is unchanged; the fill rate usually is not. Variability, not the average, is what a buffer has to absorb.
- Stretch the review interval. Push R from 7 to 14 days with S unchanged and watch the periodic policy give ground. The periodic rule is blind between reviews, so it has to carry cover for the review interval plus the lead time, while the continuous rule only covers the lead time.
- Raise the lost-sale penalty. Physical flows do not move at all — the same units are sold and the same units are lost — but the ranking of the two policies can flip, because the penalty reprices the same outcome.
- Take Q down and watch ordering cost climb. Small lots hold less stock and order far more often. Where those two lines cross is the practical version of the economic order quantity, found by simulation rather than by the square-root formula, and with lost sales in the picture the two answers do not have to agree.