Each city block is a cell on a square lattice with a fixed, noise-generated elevation. Rain falls uniformly; every frame the cells are processed from highest elevation to lowest and any water above a cell's capacity is routed to its single steepest-descent downhill neighbor (a D4 flow-routing pass, the same idea GIS hydrology tools use on a digital elevation model). Cells with no lower neighbour are local sinks and pond.
is_corridor(cell) ~ Bernoulli(p) // site percolation
capacity = corridor ? cap_lo + maturity*(cap_hi-cap_lo) : cap_imperv
infiltrated = capacity * infilRate * (0.3+0.7*maturity) * dt // corridor only, leaves the system
overflow = max(0, water - capacity) -> routed to steepest-descent neighbour
- City grid size — city blocks tracked in the blue-green network.
- Corridor density (p) — probability each block becomes a rain-garden/corridor cell; this is exactly the occupation probability of site percolation, so above roughly p≈0.59 a spanning cluster tends to appear.
- Rainfall intensity — storm event size driving the uniform rainfall input.
- Corridor maturity rate — how quickly a corridor cell's storage capacity and infiltration rate grow from freshly planted toward full absorptive capacity.
The connectivity readout is a real flood-fill (breadth-first search) over corridor cells: it reports the size of the largest connected corridor cluster as a percentage of all corridor cells — the same percolation-theory metric landscape ecologists use to judge whether a wildlife/stormwater corridor network actually spans the city or stays fragmented into disconnected islands.