A cellular-automaton wildfire spreads across a forest grid every simulation tick. A burning cell ignites an unburnt neighbour with probability
P = p0 · (1 + k·max(0, d·ŵ)) · (1 − S)
where d is the direction to the neighbour, ŵ the wind unit vector, and S the local firebreak suppression (0–0.92) — so fire spreads fastest downwind and slowest through a well-built break.
Six firebreak segments line the containment edge. Each tick, a segment measures the heat flux approaching it:
Φᵢ = Σ 1 / (1 + distance) over burning cells in its sensing zone
A controller then reallocates the fixed material budget B toward the hottest segments and lerps each segment's width toward that target:
targetᵢ = 0.15·B/N + 0.85·B·Φᵢ/ΣΦⱼ
widthᵢ ← widthᵢ + η·(targetᵢ − widthᵢ)
Summed across all six segments, Σtargetᵢ = 0.15B + 0.85B·(ΣΦᵢ/ΣΦⱼ) = B whenever any flux is detected — the controller never allocates more material than the budget allows, it only redistributes it. When no fire is visible yet, each segment idles at its 0.15B/N baseline share.
- Wind speed / direction — sets how aggressively fire advances toward the break line and which segments face the highest flux.
- Total material budget — the finite amount of firebreak width the controller can distribute; spread thin, no segment fully blocks the fire.
- Responsiveness η — how fast the controller reacts to a flux reading; too low and it lags behind a shifting front, too high and it oscillates.
- Base spread probability p0 / wind sensitivity k — the raw combustibility of the forest and how strongly wind biases the spread direction, independent of the controller.
Real firebreak crews make the same trade-off: limited dozer-line length or retardant has to go where the fire is actually pushing, not spread evenly along the whole perimeter. Drag the grid to pan, scroll to zoom — the per-segment panel below the readouts shows the feedback loop reallocating material live as the fire front shifts.