Fire Benchmark

No preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

(This model has yet to be categorized with any tags)
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 4.0pre8 • Viewed 241 times • Downloaded 29 times • Run 0 times
Download the 'Fire Benchmark' modelDownload this modelEmbed this model

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


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 result ]
patches-own [ fire counts ]

to benchmark
  random-seed 362
  reset-timer
  setup
  repeat 100 [ go ]
  set result timer
end 

to benchmark-__fire
  random-seed 362
  reset-timer
  setup
  repeat 100 [ __fire ]
  set result timer
end 

to setup
  ca
  ask patches [
    set fire 0
    if pxcor > 1 + min-pxcor
    [if (random 100) < density
      [set pcolor green]]
    if pxcor = 1 + min-pycor
      [set pcolor red set fire 1]
  ]
  set initial-trees count patches with [pcolor = green]
  set burned-trees 0
end 

to go
  if (count patches with [burning?]) = 0
    [ stop ]
  ask patches  [
    if pcolor = green
    [ set counts (sum [fire] of neighbors4) ] ]
  ask patches [
    ifelse pcolor = green [
      if counts > 0
      [set fire 1
        set pcolor red
        set burned-trees burned-trees + 1 ]]
    [ if burning?
      [ set pcolor pcolor - 0.3] ]
  ]
  tick
end 

to-report burning?  ;; patch procedure
  report (pcolor > (red - 4)) and (pcolor < (red + 1))
end 

to-report percent-burned
  ifelse initial-trees > 0
    [ report (burned-trees / initial-trees) * 100 ]
    [ report 0 ]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Fire Benchmark Download this version
Uri Wilensky over 14 years ago Fire Benchmark Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.