Brush Fire Covid Model

Brush Fire Covid Model preview image

1 collaborator

Army_coat_pix R. Wade Schuette (Author)

Tags

epidemic 

"Alternative to SIR model for pandemic curve"

Tagged by R. Wade Schuette about 3 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 352 times • Downloaded 25 times • Run 0 times
Download the 'Brush Fire Covid Model' modelDownload this modelEmbed this model

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


WHAT IS IT?

Model showing another way besides an SIR model to model spread of an epidemic, using a brush fire as an example. This illustrates the complexity of possible outcomes that might match, say Covid-19 case rates show on the Johns Hopkins dashboard. https://coronavirus.jhu.edu/data/new-cases

HOW IT WORKS

Three parameters can be set with sliders -- 1) the percent of land ( green ) covered by dry brush ( brown), 2) the odds that a patch will catch fire if any adjacent patch is on fire. amd 3) The number of ticks that any patch "burns" before the fire on it goes out.

The random-seed used to generate the actual landscape and performance can be reused automatically or set to a given value, if desired, to replay a prior run.

HOW TO USE IT

Set the sliders to whatever you like. 51 and 51 and 3 are nice starting values. Set replay to ON

The random-seed used to generate the actual landscape can be reused by setting the switch, allowing the user to see the impact of the sliders versus random effectson the outcome ( the "epidemic curve" ).

The "speed" value can be left at 6 and just controls how fast the display runs if you don't use the slider at the very top.

Press Setup to restart with new values, press GO-ONCE to advance on tick, press GO to run continuously until the fire goes out, or press GO again to pause the run.

If you want and you are running locally versus on the web, press SNAPSHOT to save an image of your run with the parameters encoded in the name.

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

values 33125-51-51-3 match the picture posted. values 2110948-51-51-3 are interesting.

to set a specific random seed:

  • shut off replay
  • turn on ask-for-seed
  • click SETUP, it will ask for the seed, type it in
  • turn off ask-for-seed
  • turn on replay
  • click GO

EXTENDING THE MODEL

NETLOGO FEATURES

RELATED MODELS

There are other covid and fire models in the commons.

CREDITS AND REFERENCES

Copyright (c) 2021 R. Wade Schuette

Comments and Questions

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

Click to Run Model

globals
  [
     stopFlag
     maxTicks
     burnTime
     peakCaseCount
     newSeed
     couldGet
     didGet
     pctSusGot

  ]

patches-own
  [
      burnedTicks
  ]

to setup
  ;; persist the last random seed across the clear-all command
  if newSeed = 0 [ set newSeed 33125 ]
  let saveseed newSeed
  clear-all
  set newSeed saveseed

  set stopFlag false
  set maxTicks 100
  set burnTime burnTicks
  set peakCaseCount 0

  ;; ============= allow replay of interesting saved prior cases  =============
  if ( replay = false )
    [  ifelse askforseed? = true [
       set newSeed read-from-string user-input "Enter a new random integer:"
       print ( word "User entered new random seed: " newSeed )
      ]
      [
        set newSeed  random 12345678
        print ( word "Computer picked a new random seed: " newSeed )
      ]
    ]
  ;;=========================================
  random-seed newSeed
  print ( word "Using random seed: " newSeed )

  ask patches
    [
        ;; set pcolor brown ;; <<<<<<<<<<<<<<
        ;; becomes

        ifelse (random 101 <   pctDryBrush )
            [ set pcolor brown ]
            [ set pcolor green  ]


        set burnedTicks 0
    ]

   set couldGet count patches with [pcolor = brown ]
   print ( word couldGet " patches are brown ")
  ;;========================================
  ask patch 0 0
    [
        set pcolor red
    ]
  reset-ticks
end 

to go

  let nodisp "no-display"
  let disp "display"

  if (stopFlag = true)
  [
    ;;set couldGet count patches with [pcolor = brown ] ;;done in setup above
    set  didGet  count patches with [pcolor = black ]
    set pctSusGot floor (100 * didGet / couldGet )
    print (word "Of " couldGet " brown patches, " didGet " burned, or " pctSusGot " percent.")
    stop
  ]
  ;;=========================================

  every ( 1 / speed )
  [
    ;;========================================
     if not netlogo-web? [
     run nodisp
  ]

    ;;========================================
      ask patches with [pcolor = brown]
      [
        if any? neighbors with [ pcolor = red and burnedTicks > 0 ]
          [
              ;; flip a coin
              if ( random 101 < oddsCatchIfExposed )
                [
                   set pcolor red
                   set burnedTicks 0
                ]
          ]
      ]

      ;;=========================================

      ask patches with [pcolor = red ]
      [
          set burnedTicks ( burnedTicks + 1 )
          if ( burnedTicks > burnTime )
             [
                 set pcolor black
             ]
      ]
      ;;=========================================
      if not netlogo-web? [
       run disp
      ]
      let activeCaseCount  count patches with [pcolor = red ]
    if (activeCaseCount > peakCaseCount ) [ set peakCaseCount activeCaseCount ]
      ;;=========================================

      tick
      if ( ticks >= maxTicks )
         [
            set stopFlag true
            print (word "Maximum time has run out at time " ticks)
         ]
      if (0 = count patches with [pcolor = red] )
         [
            print ( word "The fire burned out at time " ticks)
            set stopFlag true
         ]
  ]
end 

to snapthat

  ifelse netlogo-web? [
    print "snapshot only works if the model is downloaded"
  ]
  [
    let fname (word "brush-" newSeed "-" oddsCatchIfExposed "-" pctDryBrush "-" burnTicks ".png" )
    print (word "Saving file " fname )
    let savecommand "export-interface fname"
    run savecommand
  ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
R. Wade Schuette about 3 years ago fixed so it will run on web Download this version
R. Wade Schuette about 3 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Brush Fire Covid Model.png preview Preview for 'Brush Fire Covid Model' about 3 years ago, by R. Wade Schuette Download

This model does not have any ancestors.

This model does not have any descendants.