← Back to the lab

Simulation

Medicine supply digital twin (14/14): the control tower and whose failure it is

The end of the series. A traffic light with a normalized gap per link and an attribution rule that passes part of the failure up the chain, so the problem is fixed where it starts and not where it shows.

By ·

A patient leaves the pharmacy without their medicine. At the unit it’s seen as an unfilled prescription. But the cause may be five steps back: a forecast that missed the season, a tender with no award, a warehouse that ran short, a truck that didn’t leave. If each area looks only at its own indicator, each finds a reason to say the problem belongs to someone else.

The twin’s control tower runs every module of this series with the same scenario and summarizes them as a chain. Each link has its indicator, a target, a critical level and a single owner.

A gap that can be compared

Indicators can’t be compared with each other: 93 % service level doesn’t mean the same as 93 % forecast accuracy. To put them on the same scale, the twin measures how far each one is from its target, relative to the distance between target and critical level:

gap=max⁡ ⁣(0,  target−valuetarget−critical)\text{gap} = \max\!\left(0,\;\frac{\text{target} - \text{value}}{\text{target} - \text{critical}}\right)
  • 0: meets the target. Green.
  • Between 0 and 1: below target but above critical. Amber.
  • 1 or more: at critical or worse. Red.

What matters is that target and critical level are written down before seeing the results. That way the traffic light stops being an opinion.

Whose is it

The unit’s fully filled prescriptions depend on everything upstream. If the warehouse didn’t supply it, the unit can’t fill. Charging it the whole gap would be unfair and, above all, useless: the fix would be attempted in the wrong place.

The twin’s rule: an outcome indicator counts fully against its owner only if the link above met its target. If not:

passed upstream={0.65×own gapif the link above is red0.25×own gapif the link above is amber0if the link above is green\text{passed upstream} = \begin{cases} 0.65 \times \text{own gap} & \text{if the link above is red} \\ 0.25 \times \text{own gap} & \text{if the link above is amber} \\ 0 & \text{if the link above is green} \end{cases}

The link keeps the rest. The gap attributed to each one is what it kept of its own plus what the link below passed to it.

The 65 and 25 percentages are a modelling choice, not a law. What matters is that the rule is written down, is the same for everyone and can be debated before there’s a problem, not after.

The control tower in 3D: the traffic light for each link in the chain, from planning to the unit. (Interface in Spanish.) · Open full screen

Escalating to the right person

With the attributed gap, the twin proposes whom to alert:

  1. Level 1, the direct owner, within 24 to 48 hours, when the failure is local.
  2. Level 2, the weekly operations review, when it spans two links.
  3. Level 3, senior management, when it’s systemic or high-impact.

The tower also states in each block what scope and period each figure covers. The twin’s modules don’t run linked as a single simulation: each has its own consistent scenario. The tower doesn’t hide that; it writes it next to the number.

Closing the series

In 14 posts the twin covered the whole supply chain of a fictional public health system:

  1. Forecast with Holt-Winters, validated with WAPE.
  2. Safety stock: zσHz\sigma\sqrt{H}, and why the supplier weighs more than demand.
  3. Warehouse policy: the forecast gives more service with 25 % less stock, as long as the supplier is reliable.
  4. Allocation equalizing coverage, by water-filling and bisection.
  5. Routes with Clarke-Wright savings and 2-opt: 20 % lower cost in the twin.
  6. Docks as an M/M/c queue: one dock fewer multiplies the wait by nine.
  7. Cold chain: a time constant τ\tau and the limit Tr−kτT_r - k\tau.
  8. Accumulated heat with Q10Q_{10}, and failures that go unseen.
  9. Procurement with a price window and several sources: a 2.4 % premium for half the expected shortfall.
  10. Contracts: penalty on what’s undelivered and days until the cap.
  11. Physical inventory: drift equilibrium and the blind second count.
  12. Last mile: from 35 % to 99 % within 24 hours.
  13. Integrity: detection, false alarms and Bayes.
  14. Control tower: a comparable gap and a rule to attribute it.

No module uses exotic math. What makes the twin useful is that they all run on the same scenario, that every assumption is written down, and that anyone can move a parameter and see what happens before it happens for real.