MASMATIXInnovations
← All insights

Simulation · Heatwaves

When cooling centres fit a fifth of the people, the rule only decides who gets in

Three allocation rules, 60 synthetic city scenarios, and a stress test from a severe shortage of places to a surplus.

By Muzammal Hussain · 10 November 2026 · 5 min read

In a Pakistani heatwave, cooling centres often lose power and water at the same time the heat peaks, so they can take fewer people than planned. I built a small simulator to ask a narrow question: when places are short, how do different allocation rules share them, and what does each rule cost? Everything here is synthetic. No real neighbourhood, shelter or city is modelled.

Key findings

  • At the default setting the usable places covered about 20% of demand. All three rules filled every place, so overall coverage was the same (19.8%). The rule only changed who got in.
  • Serving the most heat-exposed and vulnerable neighbourhoods first raised risk-weighted coverage from 0.193 to 0.358 (difference 0.166, 95% CI 0.150 to 0.180).
  • The cost: coverage of low-vulnerability neighbourhoods fell from 18.9% to 0.2%.
  • Ranking shelters by power and water reliability changed nothing while places were scarce. Only with a surplus of places did it help, and only slightly (+0.007).
  • With a 5 km reach limit, even eight times the capacity served only about 69% of demand. Distance, not capacity, became the limit.

How the simulator works

Each of 60 scenarios (seed 17) has 35 neighbourhoods and 9 shelters placed in a 20 km by 20 km square. Every neighbourhood has a demand, a heat-exposure score, a social-vulnerability score and two access barriers (mobility and women's safe access). Every shelter has a capacity and power and water reliability. One grid shock and one water shock per scenario lower all shelters together, and a shelter's usable places are its capacity times its power and water reliability.

Three rules share the places:

Then I stretched two things: shelter capacity from half to eight times the default, and a reach limit of none or 5 km. All rules ran on the same scenarios, so each difference is paired by scenario, with a 95% bootstrap interval over the 60 scenarios.

Results

SettingPlaces / demandRuleRisk-weighted coverageLow-vulnerability coverageService reliability
x1, no limit0.20Nearest0.1930.1890.590
Vulnerability first0.3580.0020.590
Reliability aware0.3560.0020.590
x8, no limit1.58Nearest0.9740.9680.581
Reliability aware0.9870.9350.588
x8, 5 km limit1.58Nearest0.6870.6750.576
Reliability aware0.7120.6190.583
Two line charts against shelter capacity scale from x0.5 to x8. Left: risk-weighted coverage rises with capacity and is higher for the vulnerability-first and reliability-aware rules than for nearest, whose lines overlap. Right: coverage of low-vulnerability areas stays near zero for the two priority rules until x4, while nearest rises steadily. Dashed lines with a 5 km reach limit sit lower at high capacity.
Figure 1. Mean over 60 synthetic scenarios. Solid lines: no reach limit; dashed: 5 km. The vulnerability-first and reliability-aware lines almost overlap.

What I noticed

Limitations

Reproduce the analysis

The repository has the simulator, the three rules, the stress sweep and 13 tests. On a Mac with Python 3.9, python -m heatbridge_pk.cli analyze reproduces every number and the figure above in a few seconds.

Context: Urban Unit, Government of Punjab (2025), Heatwave Management Plan of Lahore (2025-2028). Latif, Ahsaan and Latif (2025), Heatwaves and water scarcity in Pakistan, BMJ Global Health 10(12), e020980.