Each tier only sees the order stream from the tier just below it — never the true end-customer demand. Every tick, tier i updates an exponentially-smoothed demand forecast, sets a target inventory position that covers the replenishment lead time plus a safety buffer, and orders enough to close the gap:
forecast_t = α·demand_t + (1-α)·forecast_(t-1)
MAD_t = α·|demand_t - forecast_t| + (1-α)·MAD_(t-1)
target_t = forecast_t·(L+1) + z·(1.25·MAD_t)·√(L+1)
order_t = max(0, target_t - inventoryPosition_t)
The lead time L and the safety-stock factor z both multiply the forecast and its error, so any noise in the forecast gets scaled up before it becomes an order — and that noisier order becomes the "demand" the next tier upstream reacts to. Re-applied four times in a row (retailer → wholesaler → distributor → factory), a mild wobble in customer demand turns into large swings at the factory purely from information delay and over-reaction, with no change in real end demand. This is the bullwhip effect, first formalised by Lee, Padmanabhan & Whang (1997) and demonstrated for decades in MIT's "Beer Distribution Game".
- Demand volatility — how noisy the retailer's actual customer demand is, as a fraction of its average.
- Forecast smoothing α — how heavily each tier weights the newest observation; a high α reacts fast but overshoots more.
- Lead time — ticks between placing an order and receiving the goods; longer lead times force bigger safety buffers and stronger amplification.
- Safety-stock factor z — how many forecast-error deviations of buffer stock each tier keeps; higher z means each tier over-orders more aggressively when demand looks uncertain.
- Demand shock — injects a temporary step increase in customer demand so you can watch it ripple and amplify upstream tier by tier.
The bars are a scrolling history of the order quantity each tier actually placed, one row per tier; the four floating cubes at the front show each tier's current inventory position (dipping below the plane means a backlog).