Skip to content

Bracket uncertain choices

Several numbers the cascade asks for have no calibrated value: the debris spread factor k, the blocked share that closes a road, the vehicle clear width, the design level of a stock whose code era is unknown. The package makes them required arguments precisely so that they can be varied. This page shows how.

Sweep one choice

import dataclasses
import pandas as pd
from quakecascade import cascade

rows = []
for k in (0.15, 0.3, 0.5, 0.67):                  # the published range of the spread factor
    res = cascade.run(inputs, dataclasses.replace(params, debris_k=k, run_id=f"k={k}"))
    pbs = res.population_by_status["hospital"].set_index("isolation_status")
    rows.append({"debris_k": k,
                 "closed_edges": len(res.closed_edges),
                 "newly_cut_off_pop": pbs.loc["newly_cut_off", "population"],
                 "fingerprint": res.manifest["run_fingerprint"]})
print(pd.DataFrame(rows))

dataclasses.replace keeps every other parameter as it was, and each run's fingerprint records exactly what produced it.

The choices worth bracketing

Parameter Why it is uncertain A sensible bracket
debris_k spread of collapse debris as a share of height; not calibrated for any stock 0.15–0.67, the range reported in the literature (see Debris)
closed_share blocked share of a corridor that closes it; no verified source e.g. 0.3, 0.5, 0.7
clear_width_m width a vehicle needs; an operational choice the narrowest and the widest vehicle that must pass
design_levels / chain_level code era of the stock the bracketing levels themselves: run chain_level at each
closure_rule blockage share, navigable core, or either all three, to see which test drives the closures
collapse_seed one collapse realisation many: use cascade.realisations (see Many collapse draws)
partial_units how units with missing buildings enter ranking and shelter "exclude" against "lower_bound", to see which units the gaps affect

Combine with the collapse draw

A closure found in one draw at one k is the weakest kind of result. A robust statement looks like "this road closes in more than half of the draws for every k in the published range":

freq = {}
for k in (0.15, 0.5, 0.67):
    rz = cascade.realisations(inputs, dataclasses.replace(params, debris_k=k), range(50))
    freq[k] = rz.roads.set_index("road_id")["closed_frequency"]
robust = pd.DataFrame(freq).min(axis=1) > 0.5
print(robust.sum(), "roads close in more than half of the draws at every k")

Report it

State every bracket in the report, with the number of draws and the fingerprint of each run (see Reproduce and report a run).