Fire (evolved version)

Fire (evolved version) preview image

1 collaborator

Default-person Katerina Benisi (Author)

Tags

fire 

Tagged by Katerina Benisi 9 months ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.3.0 • Viewed 141 times • Downloaded 3 times • Run 0 times
Download the 'Fire (evolved version)' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

globals [
  initial-trees
  burned-trees
  ;; how many trees (green patches) we started with
]
breed [fires fire]    ;; bright red turtles -- the leading edge of the fire
breed [embers ember]

to setup
  clear-all
  ;; make some green trees
  ask patches with [(random-float 100) < Density]
    [ set pcolor green ]
    ;; make a column of burning trees at the left-edge
    if Starting_point_of_fire = "Center"  [ask patches [
    if pxcor = 0 and pycor < 5 and pycor > 1
    [ set pcolor red ]
  ]
  ]
  if Starting_point_of_fire = "Left side" [ask patches with [pxcor = min-pxcor]
    [ set pcolor red ]]
  ;; keep track of how many trees there are
  set initial-trees count patches with [pcolor = green]
  reset-ticks
end 

to go
  ;; stop the model when done
  if all? patches [pcolor != red]
      [ stop ]


  ;; each burning tree (red patch) checks its 4 neighbors.
  ;; If any are unburned trees (green patches), change their probability
  ;; of igniting based on the wind direction
  ask patches with [pcolor = red] [
    ;; ask the unburned trees neighboring the burning tree
    ask neighbors4 with [pcolor = green] [
      let probability Propability_of_spread

      ;; compute the direction from you (the green tree) to the burning tree
      ;; (NOTE: “myself” is the burning tree (the red patch) that asked you
      ;; to execute commands)
      let direction towards myself

      ;; the burning tree is north of you
      ;; so the south wind impedes the fire spreading to you
      ;; so reduce the probability of spread
      if (direction = 0 ) [
        set probability probability - South_wind_speed ]

      ;; the burning tree is east of you
      ;; so the west wind impedes the fire spreading to you
      ;; so reduce the probability of spread
      if (direction = 90 ) [
        set probability probability - West_wind_speed ]

      ;; the burning tree is south of you
      ;; so the south wind aids the fire spreading to you
      ;; so increase the probability of spread
      if (direction = 180 ) [
        set probability probability + South_wind_speed ]

      ;; the burning tree is west of you
      ;; so the west wind aids the fire spreading to you
      ;; so increase the probability of spread
      if (direction = 270 ) [
        set probability probability + West_wind_speed ]
      if random 100 < probability [
        set pcolor red ;; to catch on fire
        ;; if big jumps is on, then sparks can fly farther
        if Low_humidity_rates [
          let target patch-at (West_wind_speed / 5) (South_wind_speed / 5)
          if target != nobody and [ pcolor ] of target = green [
            ask target [
              set pcolor red ;; to ignite the target patch
            ]
          ]
        ]
      ]
    ]
    set pcolor red - 3.5;; once the tree is burned, darken its color
  ]

  tick   ;; advance the clock by one “tick”
end 

to Spread_fire_with_mouse
  if mouse-down? [
    ask patch mouse-xcor mouse-ycor [
  set pcolor red
    ]
    display
  ]
end 

; Copyright 2006 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created 9 months ago by Katerina Benisi.

Attached files

File Type Description Last updated
Fire (evolved version).png preview Preview for 'Fire (evolved version)' 9 months ago, by Katerina Benisi Download

This model does not have any ancestors.

This model does not have any descendants.