Child of Fire Ecology with Pine Beetle Kill

No preview image

1 collaborator

Default-person Mike Borowczak (Author)


(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.1.0 • Viewed 334 times • Downloaded 21 times • Run 0 times
Download the 'Child of Fire Ecology with Pine Beetle Kill' modelDownload this modelEmbed this model

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


This project simulates the spread of a fire through a forest with respect to Pine Beetle kill impacts and wind conditions. This is an example of a common feature of complex systems (specifically within the Rocky Mountain Region). This visualization can help students understand and see the relationships between excessive beetle kill and fire ecology connections.


The fire starts from the center and spreads to neighboring trees. The fire can spread based on wind conditions and beetle kill presence.

The model allows for wind condition and beetle kill manipulation of variables. So, the fire must have trees along its path in order to advance. In order for the fire to spread, beetle kill trees must be neighboring. While the fire spread to 3 out of 10 green healthy trees in this targeted environment. In addtion, the fire will not spread in unwooded areas (patch), so such a patch blocks the fire's motion in that direction.


Click the SETUP button to set up the trees (green) and fire (red on the left-hand side).

Click the GO button to start the simulation.

The DENSITY slider controls the density of trees in the forest. (Note: Changes in the DENSITY slider do not take effect until the next SETUP.)

The BEETLE-PERCENT slider controls the amount of beetle-kill trees present the system.

The WIND-DIRECTION, GUST-STRENGTH, WIND-STRENGTH, WIND-DIRECTION-VARIABILTIY, FIRE-BREAK-WIDTH sliders control the directions of wind in the system, the gust strength, wind strength, the variabilty of wind direction, and breaks in fire spreading respectively.


When you run the model, how much of the forest burns with respect to the other variables. If you run it again with the same settings, do the same trees burn? How similar is the burn from run to run? Hows does increased beetle-percent impact rate of spreading (we counted through the number of ticks as a unit of time).


Students can use the model to answer these following questions: a. What happens if all variables are set to lowest condition/level? b. How does wind direction and strength impact fire spreading patterns? c. What happens as the percentage of beetle kill increases? d. How is the rate (based on number of ticks) of fire spreading impacted by increased beetle kill, alone? e. How is the rate (based on number of ticks)of fire spreading impacted by wind speed and direction, alone? f. How is the rate (based on number of ticks)of fire spreading impacted by both high beetle kill and wind strength? g. How could this model/program be improved? h. How can computer modeling help fire & forest ecologists?


Wind conditions could be improved upon - feel free to edit and modify this Model. We would appreciate feedback and comments on how to make this model more effective and accurate to simulate real-ecological systems.


Unburned trees are represented by green patches; burning trees are represented by turtles. Two breeds of turtles are used, "fires" and "embers". When a tree catches fire, a new fire turtle is created; a fire turns into an ember on the next turn. Notice how the program gradually darkens the color of embers to achieve the visual effect of burning out.

The neighbors4 primitive is used to spread the fire.

You could also write the model without turtles by just having the patches spread the fire, and doing it that way makes the code a little simpler. Written that way, the model would run much slower, since all of the patches would always be active. By using turtles, it's much easier to restrict the model's activity to just the area around the leading edge of the fire.

See the "CA 1D Rule 30" and "CA 1D Rule 30 Turtle" for an example of a model written both with and without turtles.


  • Percolation
  • Rumor Mill



If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:


Copyright 2015 Christina Belardo & Kali Nicholas.


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was developed at the MIT Media Lab using CM StarLogo. See Resnick, M. (1994) "Turtles, Termites and Traffic Jams: Explorations in Massively Parallel Microworlds." Cambridge, MA: MIT Press. Adapted to StarLogoT, 1997, as part of the Connected Mathematics Project.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

Comments and Questions

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

Click to Run Model

globals [
  initial-trees   ;; how many trees (green patches) we started with
  burned-trees    ;; how many have burned so far
  on-fire         ;; how many trees are currently on fire
  fire-break-orientation ;;the orientation of upcoming fire-breaks
  beetle-trees    ;; how many trees have been infested with beetles

breed [fires fire]    ;; bright red turtles -- the leading edge of the fire
breed [embers ember]  ;; turtles gradually fading from red to near black

to setup
  set-default-shape turtles "square"
  ;; make some green trees
  ;;KEEP - all of our trees in forest
  ask patches with [(random-float 100) < density] 
    [ set pcolor green ]
  ;; identify number of beetles in forest ecosystem
  ask patches with [ pcolor = green]
    [if (random-float 100) < beetle-percent [ set pcolor brown ]]
  ;; make a column of burning trees
  ;ask patches with [pxcor = min-pxcor]
  ;  [ ignite ]
  ;; select a random point in trees for burn source - for now center of patch
  ask patch 0 0 [ ignite ]
  ;; set tree counts
  set initial-trees count patches with [pcolor = green or pcolor = brown]
  set burned-trees 0
  set beetle-trees count patches with [pcolor = brown]

to go
  if not any? turtles  ;; either fires or embers
    [ stop ]
  ask fires
    [ ask neighbors4 with [pcolor = green or pcolor = brown]
        [ ignite ]
      set breed embers ]
  set on-fire count patches with [pcolor = red]

;;;;;;;;;;;;;;;;;;;;;;;;;; we removed these [upper and lower lines]

;;to go
  if not any? turtles  ;; either fires or embers
    [ stop ]

to forty-five
   set fire-break-orientation 45

to horiz
  set fire-break-orientation 90

to neg-forty-five
  set fire-break-orientation 135

to vert
  set fire-break-orientation 180

; Creates a fire-break, 30 units long and fire-break-width units wide
; If the wind is blowing, the fire-breaks is automatically built
; orthoganal to the wind.  Otherwise, it is build in the direction specified
; via the user interface buttons.

to fire-break
  if mouse-inside? and mouse-down?
    if wind-strength > 0
      set fire-break-orientation wind-direction + 90
    let width-rpt fire-break-width
    print width-rpt
    let length-rpt 30
    let start-patch patch mouse-xcor mouse-ycor
    repeat width-rpt
      let l 0
      repeat length-rpt
        if is-patch? start-patch
          ask start-patch 
          [let next-p patch-at-heading-and-distance fire-break-orientation l
            if is-patch? next-p [ask next-p [ set pcolor red - 4]]
        set l (l + 1)
      if is-patch? start-patch
        ask start-patch [set start-patch patch-at-heading-and-distance (fire-break-orientation - 90) 1]

to consume
ask fires
  ;; if there is wind, blow an ember in the direction of the
  ;; wind, according to the strength
  ifelse wind-strength > 0
  ;; get the direction, taking into account variability
  let dir (wind-direction + (((random wind-direction-variability) * 2) - wind-direction-variability))
  ;; get the wind strength, taking into account variability
  let str (wind-strength + (random gust-strength))
  ;; Verify that we are landing the ember on a valid patch
  ;; If so, ignite it
  let p patch-at-heading-and-distance dir str
  if is-patch? p
  ask p [ if ( pcolor = green and random 10 < 3 ) [ ignite ]]
  ask p [ if pcolor = brown [ ignite ]]
  ;; burn local forest, taking into account wind direction
  let dir-min wind-direction - (45 - random 10) ;
  ;; if dir-min < 0 [set dir-min 360 + dir-min]
  let dir-max wind-direction + (45 + random 10);
  if dir-max > 360 [
  set dir-max dir-max - 360
  set dir-min dir-min - 360
  ask neighbors with [pcolor = green or pcolor = brown]
  ;; if this patch is within our direction window, then burn it
  let corrected-dir towards myself
  ifelse corrected-dir >= 180
  [ set corrected-dir corrected-dir - 180 ]
  [ set corrected-dir corrected-dir + 180 ]
  if (corrected-dir >= dir-min) and (corrected-dir <= dir-max) [ignite]
  ;; burn local forest, in all directions if there is no wind
  ask neighbors4 with [pcolor = green or pcolor = brown] [ ignite ]
  set breed embers

;; creates the fire turtles

to ignite  ;; patch procedure
  sprout-fires 1
    [ set color red ]
  set pcolor black
  set burned-trees burned-trees + 1

;; achieve fading color effect for the fire as it burns

to fade-embers
  ask embers
    [ set color color - 0.3  ;; make red darker
      if color < red - 3.5     ;; are we almost at black?
        [ set pcolor color
          die ] ]

; Copyright 2015 Christina Belardo and Kali Nicholas 
; See Info tab for full copyright and license.

There is only one version of this model, created over 9 years ago by Mike Borowczak.

Attached files

No files

Parent: Fire Ecology with Pine Beetle Kill

This model does not have any descendants.

Graph of models related to 'Child of Fire Ecology with Pine Beetle Kill'