Forest-Fire and Mitigation on Network

Forest-Fire and Mitigation on Network preview image

1 collaborator

Default-person C. Y. (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 7.0.2 • Viewed 14 times • Downloaded 2 times • Run 0 times
Download the 'Forest-Fire and Mitigation on Network' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


1. Model Overview

Forest-Fire and Mitigation on Network is an agent-based model that simulates the spread of fire through a spatially clustered network.
The network consists of interconnected nodes that represent trees.
Each node can exist in one of three states: normal, burning, or ash.
Fire spreads probabilistically through the active links that connect nodes.
Two mitigation mechanisms, sprinklers and firebreaks, influence how the fire evolves within the network.
Sprinklers reduce the duration of burning for affected nodes.
Firebreaks decrease network connectivity and help to limit further spread.

2. Core Dynamics – Fire Spread

The simulation begins with a subset of nodes ignited as initial fire sources.
At each time step:
- Burning nodes attempt to ignite neighboring normal nodes across active links with a probability defined by spread-prob.
- Each burning node maintains a burn timer; once the timer exceeds burn-limit, the node transitions to ash.
- Independently, burning nodes can also extinguish early with probability extinguish-prob, returning to the normal state.
The process continues until no nodes remain in the burning state, representing the natural or managed cessation of the fire.

3. Mitigation Strategies

Sprinklers

Sprinklers are placed near high-degree nodes, representing central or dense parts of the network.
Nodes located on or near sprinkled patches experience a reduced burn duration, determined by sprinkler-effect, which shortens the window during which they can ignite neighbors. This mimics the dampening or cooling effects of targeted water distribution.

Firebreaks

Firebreaks are modeled as yellow patch bands that interrupt spatial continuity.
Links that intersect these areas may be probabilistically disabled, governed by disable-prob, thus reducing the effective connectivity of the network. Firebreaks emulate physical barriers such as cleared strips or roads that restrict the spread of fire across landscapes.

4. Parameter Descriptions

number-of-nodes: Total number of nodes (trees) in the network
average-node-degree: Average number of connections per node
initial-ignition-size: Number of nodes initially set on fire
spread-prob: Probability of fire spreading across an active link
extinguish-prob: Probability that a burning node is extinguished before becoming ash
base-burn-limit: Base number of ticks a node remains burning before turning to ash
sprinklers-on?: Enables or disables the sprinkler intervention
sprinkler-count: Number of sprinklers deployed
sprinkler-radius: Effective radius of sprinkler influence (in patches)
sprinkler-effect: Percentage reduction of the burn limit for sprinkled nodes
firebreaks-on?: Enables or disables the firebreak intervention
firebreak-count: Number of firebreak starting points
firebreak-steps: Number of random-walk steps used to carve each firebreak
disable-prob: Probability that a link crossing a firebreak becomes inactive seed-fixed? / initial-seed: Optional random seed settings for reproducibility

5. Reference Model

Stonedahl, F. and Wilensky, U. (2008). NetLogo Virus on a Network model.
http://ccl.northwestern.edu/netlogo/models/VirusonaNetwork. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

6. How to Cite

Please cite this model as:
Yu, C. (2025). Fire Spread and Mitigation on Network. Indiana University Bloomington.

7. Copyright and License

© 2025 Yu, C.
This model is licensed under the Creative Commons Attribution–NonCommercial–ShareAlike 3.0 License (CC BY-NC-SA 3.0).
You are free to share and adapt the model for non-commercial purposes, provided appropriate credit is given and any derivative works are distributed under the same license.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

; =============================================================================
; Forest-Fire and Mitigation on Network
; -----------------------------------------------------------------------------
; Agents:
;   - nodes (trees) connected by links (network edges)
;   - sprinklers (placed near high-degree nodes)
;   - firebreaks (draw lines on patches to break connectivity)
;
; State flow for nodes:
;   normal -> burning -> (ash OR revert to normal via extinction)
;
; Mechanics:
;   - Fire spreads along ACTIVE links with probability spread-prob
;   - Burning nodes either:
;       * turn to ash after burn-limit ticks, or
;       * are extinguished (revert to normal) with probability extinguish-prob
;   - Sprinklers shorten burn-limit within a radius (reducing spread window)
;   - Firebreaks mark yellow patch bands and probabilistically disable links
;
; =============================================================================


; ============================== BREEDS & OWN ================================

breed [nodes node]
breed [sprinklers sprinkler]
breed [firebreaks firebreak]

nodes-own
[
  ;node state
  normal?
  burning?       
  ash?   
  
  ;fire duration
  check-timer  ; ticks since ignition 
  burn-limit   ; duration threshold to become ash
  
  ;lables
  ignition?  ; marks initial ignition nodes
  degree     ; current degree (# of link neighbors)
]

links-own
[
  active?           ; if false, fire cannot pass along this link
  pass-firebreak?   ; whether this link crosses a firebreak area
]

patches-own 
[
  sprinkled?        ; patch is inside a sprinkler's radius (blue)
  firebreak?        ; patch belongs to a firebreak path (yellow)
]


; ============================== SETUP =================================

to setup
  clear-all
  if seed-fixed? [ random-seed initial-seed ] 
  
  setup-patches
  setup-nodes
  setup-spatially-clustered-network
  
  ; compute node degrees after links are created
  ask nodes [ set degree count link-neighbors ]
  
  ; initialize links to be active
  ask links 
  [ 
    set color grey - 1
    set active? true
    set pass-firebreak? false
  ]
  
  ; ignite a set of initial nodes
  ask n-of initial-ignition-size nodes
  [
    set ignition? true
    become-burning
  ]
  
  ; optional mitigation 1 : sprinklers
  if sprinklers-on? 
  [ 
    place-sprinklers 
    apply-sprinkler-burn-limits
  ]
  
  ; optional mitigation 2 : firebreaks
  if firebreaks-on? 
  [
    carve-firebreak
    disable-links-by-firebreak
  ]
  
  reset-ticks
end 


; --- patches baseline visuals & flags ---------------------------------------

to setup-patches
  ask patches 
  [
    set pcolor black
    set sprinkled? false
    set firebreak? false
  ]
end 


; --- create nodes and initialize node-level state ---------------------------

to setup-nodes
  set-default-shape nodes "tree"
  create-nodes number-of-nodes
  [
    ; for visual reasons, we don't put any nodes *too* close to the edges
    setxy (random-xcor * 0.95) (random-ycor * 0.95)
    become-normal
    set check-timer 0
    set burn-limit base-burn-limit
    set ignition? false
  ]
end 


; --- build a spatially-clustered network -----------------------------------
; Goal: add links so that each new link connects to the nearest non-neighbor,
; until we reach target number of links. Then relax layout for aesthetics.

to setup-spatially-clustered-network
  let num-links (average-node-degree * number-of-nodes) / 2
  while [count links < num-links ]
  [
    ask one-of nodes
    [
      let choice (min-one-of (other nodes with [not link-neighbor? myself])
                   [distance myself])
      if choice != nobody [ create-link-with choice ]
    ]
  ]
  ; make the network look a little prettier
  repeat 10
  [
    layout-spring nodes links 0.3 (world-width / (sqrt number-of-nodes)) 1
  ]
end 


; ============================== MAIN LOOP ===================================

to go
  ; stop when no nodes are burning
  if all? nodes [not burning?]
  [ stop ]

  ; update burning timers, convert to ash if threshold met
  ask nodes with [burning?]
  [
     set check-timer check-timer + 1
     if check-timer >= burn-limit
       [ become-ash ]
  ]

  ; fire dynamics
  spread-fire
  extinct
  
  tick
end 


; ============================= STATE TRANSITIONS ============================

to become-burning  ;; node procedure
  set normal? false
  set burning? true
  set ash? false
  set color red
end 

to become-normal  ;; node procedure
  set normal? true
  set burning? false
  set ash? false
  set color green
end 

to become-ash  ;; node procedure
  set normal? false
  set burning? false
  set ash? true
  set color gray
  ask my-links 
  [
    if active? 
    [ set color gray - 3]
  ]
end 


; ============================== FIRE DYNAMICS ===============================

to spread-fire
  ask nodes with [burning?]
  [
    ask link-neighbors with [normal?]
    [
      let lk link-with myself
      if (lk != nobody) and [active?] of lk
      [
        if random 100 < spread-prob
        [ become-burning ]
      ]
    ]
  ]
end 


; --- burning nodes may be extinguished (revert to normal) -------------------

to extinct
  ask nodes with [burning?]
  [
    if random 100 < extinguish-prob
    [ become-normal ]
  ]
end 


; ============================ SPRINKLER SYSTEM ==============================

; --- place sprinklers near the top-degree nodes -----------------------------

to place-sprinklers
  let s sprinkler-count
  if s = 0 [ stop ]

  ; choose s nodes with maximum degree
  let topS max-n-of s nodes [degree]   
  
  ; for each, find a nearby empty patch (or use current) and place a sprinkler
  ask topS 
  [
    let target-patch find-nearby-empty-patch patch-here
    if target-patch != nobody 
    [
      ask target-patch 
      [
        sprout-sprinklers 1 
        [
          setxy [pxcor] of target-patch [pycor] of target-patch
          set shape "target"
          set color blue
          set size 1.2
        ]
        set sprinkled? true
      ]
      ask patches with [ distance target-patch <= sprinkler-radius ] 
      [
        set pcolor blue
        set sprinkled? true
      ]
    ]
  ]
end 


; --- reduce burn-limit for nodes standing on sprinkled patches --------------

to apply-sprinkler-burn-limits
  let factor (1 - (sprinkler-effect / 100)) 
  ;show (word "factor = " factor)
  
  ask nodes with [[sprinkled?] of patch-here] 
  [
    set burn-limit max list 1 floor (base-burn-limit * factor)
    set color green + 3
  ]
end 


; --- helper: choose an alternative nearby patch for placing a sprinkler -----

to-report find-nearby-empty-patch [ base-patch ]
  let candidates patches in-radius 1.5 with [ self != base-patch ]
  if any? candidates [ report one-of candidates ]
  report base-patch 
end 


; ============================= FIREBREAK SYSTEM =============================

; --- carve yellow firebreak bands by walking "firebreak" turtles ------------

to carve-firebreak
  let f firebreak-count
  if f = 0 [ stop ]
  
  if firebreak-steps <= 0 [ stop ]

  let start-patch n-of f patches
  let step-len floor(world-width * 0.1)
  ;show(step-len)
  
  ; seed movers (temporary firebreak turtles)
  ask start-patch 
  [
    sprout-firebreaks 1 
    [
      set color black
      set shape "x"
      set size 0.5
      set heading random 360
    ]
  ]
  
  ; random-walk forward "stamping" yellow patches along the path
  repeat firebreak-steps 
  [
    ask firebreaks 
    [
      let fromx xcor
      let fromy ycor

      fd step-len
      
      stain-line-yellow fromx fromy xcor ycor
      rt (random-float 90 - 45)
    ]
  ]
  
  ; remove walkers, leave yellow patches; re-sprout markers for visualization
  ask firebreaks [die]
  
  ask patches with [firebreak?]
  [
      sprout-firebreaks 1 
    [
        set color black
        set shape "x"
        set size 0.5
    ]
  ]
end 


; --- color patches along a line segment yellow and flag as firebreak --------

to stain-line-yellow [x1 y1 x2 y2]
  let dist [ distancexy x2 y2 ] of patch x1 y1
  let samples max list 3 ceiling (2 * dist)
  ;show(samples)
  foreach (n-values samples [ i -> i ]) [ i ->
    let t  (i / (samples - 1))
    let sx (x1 + t * (x2 - x1))
    let sy (y1 + t * (y2 - y1))
    ask patch sx sy [
      set firebreak? true
      set pcolor yellow
    ]
  ]
end 


; --- detect and probabilistically disable links crossing firebreak patches ---

to disable-links-by-firebreak
  ask links 
  [
    if link-crosses-firebreak? self 
    [
      set pass-firebreak? true
      if random 100 < disable-prob 
      [
        set active? false
        set color yellow
        set thickness 0.1
      ]
    ]
  ]
end 


; --- sample along link AB to check if any point lies on a firebreak patch ---

to-report link-crosses-firebreak? [ lnk ]
  let a [end1] of lnk
  let b [end2] of lnk
  let x1 [xcor] of a
  let y1 [ycor] of a
  let x2 [xcor] of b
  let y2 [ycor] of b

  let delta-x (x2 - x1)
  let delta-y (y2 - y1)
  let dist sqrt (delta-x * delta-x + delta-y * delta-y)
  let samples max list 3 ceiling (2 * dist)
  let crosses? false

  foreach (n-values samples [ i -> i ]) [ i ->
    if not crosses? [
      let t  (i / (samples - 1))
      let sx (x1 + t * delta-x)
      let sy (y1 + t * delta-y)
      if [firebreak?] of patch sx sy [
        set crosses? true
      ]
    ]
  ]
  report crosses?
end 

There is only one version of this model, created 6 days ago by C. Y..

Attached files

File Type Description Last updated
firebreak.png png With Firebreak 6 days ago, by C. Y. Download
Forest-Fire and Mitigation on Network.png preview Preview for 'Forest-Fire and Mitigation on Network' 6 days ago, by C. Y. Download
model-view.png png basic model 6 days ago, by C. Y. Download

This model does not have any ancestors.

This model does not have any descendants.