COVID_19 Spread

COVID_19 Spread preview image

1 collaborator

Default-person Anamaria Berea (Author)

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.4 • Viewed 10775 times • Downloaded 189 times • Run 0 times
Download the 'COVID_19 Spread' 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

unzip error

An error occurred while extracting files. Multiple times, after new downloads.

Posted about 4 years ago

zip file

Hi, CRC and data errors occur when unzipping the model file.

Posted about 4 years ago

Zip file is corrupted (Question)

As others have mentioned, the zip file is corrupted. Would be great if someone could redo it.

Posted about 4 years ago

Zip files

hey guys, sorry, not sure what to do about those zip files; it's downloading fine for me.

Posted about 4 years ago

Could you try rizipping it and posting it again? (Question)

I've tried downloading several times and tried repairing it with WinRar but I get "bad checksum" every time. Perhaps rezipping it and posting it again would fix the problem?

Posted about 4 years ago

unzip error solved (kind of)

Solved, running I still get 'An error occurred while extracting files' The file extracted looks OK, a 28.1kB text file eg turtles-own [ sick? ;; if true, the turtle is infectious remaining-immunity ;; how many weeks of immunity the turtle has left sick-time ;; how long, in days, the turtle has been infectious age ] ;; how many weeks old the turtle is globals [ %infected ;; what % of the population is infectious %immune ;; what % of the population is immune lifespan ;; the lifespan of a turtle chance-reproduce ;; the probability of a turtle generating an offspring each tick chance-recover ;; the probability of recovery at each tick carrying-capacity ;; the number of turtles that can be in the world at one time immunity-duration ;; how many weeks immunity lasts number-dead ] ;; how many turtles die ;; The setup is divided into four procedures to setup clear-all setup-constants setup-turtles etc etc But opening with Netlogo 6.1.1. NetLogo can't open the model '/home/garry/Downloads/COVID_19_Spread(1)/COVID_19_Spread.nlogo' Unable to open the model with current format: '/home/garry/Downloads/COVID_19_Spread(1)/COVID_19_Spread.nlogo' ++Solution++ A partial workaround is to 'Run in NetLogo Web', and by fiddling up & down bars and window sizes, find Export:NetLogo. That gives a 26.3kB file, that does open in NetLogo 6.1.1, and runs well. I noticed the infectiousness slider was wierd. It doesn't seem to make any difference to a run. Max dead in 40 weeks. And FWIW, I changed Increment = 1, but value 465.59999999999997. And I changed Units = % -&rt; Units = <nul&rt;, no difference.

Posted about 4 years ago

No of deaths (Question)

Why does the model result in so many deaths?

Posted about 4 years ago

Clarifications before sharing (e.g. What is the unit of movement?) (Question)

Really appreciate the great work! I want to write an article in Chinese to introduce this model to readers in Taiwan and to discuss how might changing our collective behaviors (the input parameters) impact the outcomes we face during this crisis. But before writing it, I'd like to clarify my understanding: 1. As the range of basic reproduction number of COVID-19 is around 1.4~3.9, I assumed that the "infectiousness" parameter is referring to BRN, and set it at the upper bar. Is my assumption correct? 2. Based on my limited trials, I found that lowering the movement of the agents and decreasing the population density together is the most effective strategy to control COVID-19, and is consistent with social-distancing & self-quarantine that is being recommended by most of the experts that I've heard of. I wonder if this is consistent with your findings? 3. While the default movement is 5, I found that the range of the slider is set between 0.25 and 1. What is its unit and how is it calculated? Is it relative or definite? 4. The death numbers are strikingly high in so many scenarios. To what extent would this reflect reality? (Don't want to make my readers who actually go run the model panic...) Would highly appreciate it if anyone could clear my confusion!

Posted about 4 years ago

corrections

Hi, You can unzip the model via Terminal, please use: unzip \*.zip Other corrections: use ( ifelse random-float 1 < chance-recover ) instead of ( ifelse random-float 100 < chance-recover ). This change could provide more accurate numbers.

Posted about 4 years ago

Can't get it to run (Question)

I've copied the code from the Code tab and pasted it into a new file NetLogo 6.1.1. (I can't unzip the zip file, I keep getting error messages that the zip file is corrupted.) When I run it, it says there is "Nothing named "number-people" has been defined." I tried creating a global named number-people but then it comes back and says "Nothing named "weather" has been defined" and I'm not sure how to fix this. I'm a novice with Netlogo. Any help would be appreciated.

Posted about 4 years ago

answer to Tom

tom Yes, the code from the code tab is only a small part of the ~26kB of the program. There's lots you don't see, that specifies the size of the window, the number and colour of the patches, how all the sliders and buttons & graphs etc work. BTW, the zipfile still doesn't work for me. Ubuntu18.4. the formatting in the discussion tab is atrocious, I'll try \\n for newlines, see if that helps. I can't do underscores So http://modelingcommons.org/browse/one_model/6227#model_tabs_browse_nlw (but replace spaces with underscores), \n Run NetLogo Web, \n Export:NetLogo\n find a 26.3kb text file, look at it as a text file with eg Notepad++. See all that extra code. Kind of makes some sense, but isn't really designed to be human readable. \n Later, open the file in NetLogo, it should run. If you want more familiarity with NetLog, https://www.complexityexplorer.org/courses find:Fundamentals of NetLogo

Posted about 4 years ago

reply to Garry (Question)

Garry—thanks! I'm on Win 10 and have almost no familiarity with linux so am struggling to decipher what you suggested. Would you be able to email me a copy of the file? My email is tom.goodell@lindenleadership.com. I agree, formatting in the discussion tab leaves lots to be desired. Also, thanks for the link to the complexity explorer courses! I'l check them out.

Posted about 4 years ago

reply to Adler Yang

1. "The death numbers are strikingly high" I think the code here : "ifelse random-float 100 < chance-recover" should be changed to ifelse random-float 1 < chance-recover 2. I think it's relative. "movement = 1", It means the person forward one step. In Netlogo, it's equal the length of one patch. In this particular model the "world" is set to be 34x34, so movement =1 means 1/34 the side of the world. 你要介紹我們台灣人 ? 這只是個簡單模型,不要太認真吧!

Posted about 4 years ago

Unzipping the file on Windows 10

For some reason, Windows really doesn't like the zip format for this file, presumably because it was zipped on a Mac and they don't like to play well together. It can be unzipped successfully on a Windows 10 machine using Ubuntu, following these steps: 1. Install the Ubuntu app using Microsoft Store, the default version, which should be 18.04 LTS or newer. 2. Open up the Ubuntu app 3. Install unzip using "sudo apt install unzip" 4. Navigate to the folder where you've downloaded the zip file using "cd /mnt/c/folder/folder/COVID-19/" replacing the folder/folder/COVID-19 part with your path 5. Unzip the file using "unzip COVID_19_Spread.zip"

Posted about 4 years ago

Change infectiousness doesn't change anything

The minimum of infectiousness is 140 (or 140 * 0.9) But the code here "if random-float 100 < infectiousness" will be always true. It means no matter how you change the infectiousness, the infected person will always infect whoever close to him. The other thing to notice: If you change weather setting, like change to hot-humid, it change the default infectiousness 340 to 340*0.9, but next time, you run the model again, the infectiousness become 340*0.9*0.9. The more times you run the model, the lower the infectiousness. So, remember set the infectiousness slider to the value you want every time before you run it.

Posted about 4 years ago

Reply: Unzipping the file on Windows 10

&rt;For some reason, Windows really doesn't like.... <new line&rt; I was using ubuntu 18.04, (actual, not virtual, or ubuntu app etc). Unzipping failed for me. Maybe as you say something to do with Mac.

Posted about 4 years ago

[SOLUTION] Use 7zip to unzip successfully on Windows

1. Successfully overcame the "unspecified error" while unzipping, by installing 7zip and using it to unzip the downloaded zip file. 2. However, the model is not running in the new 6.1.1 Netlogo, and so now trying to download 6.0.4 3. After installing 6.0.4, tried opening the file but error: "Expected 12 sections, this file has only 11." So, no luck! Probably best to view file in the Netlogo Web tab on this page... you can shift to "authoring mode" to adjust the size of the graph, and then run the model on the web.

Posted almost 4 years ago

Model Info... (Question)

How does this model work? I ran this model a couple of times and the weather doesn't affect the spread of the virus. The turtles all stop regardless of what the weather is.

Posted over 3 years ago

Click to Run Model

turtles-own
  [ sick?                ;; if true, the turtle is infectious
    remaining-immunity   ;; how many weeks of immunity the turtle has left
    sick-time            ;; how long, in days, the turtle has been infectious
    age ]                ;; how many weeks old the turtle is

globals
  [ %infected            ;; what % of the population is infectious
    %immune              ;; what % of the population is immune
    lifespan             ;; the lifespan of a turtle
    chance-reproduce     ;; the probability of a turtle generating an offspring each tick
    chance-recover       ;; the probability of recovery at each tick
    carrying-capacity    ;; the number of turtles that can be in the world at one time
    immunity-duration    ;; how many weeks immunity lasts
    number-dead ]        ;; how many turtles die

;; The setup is divided into four procedures

to setup
  clear-all
  setup-constants
  setup-turtles
  update-global-variables
  update-display
  reset-ticks
end 

;; We create a variable number of turtles of which 1 are infectious,
;; and distribute them randomly

to setup-turtles
  create-turtles number-people
    [ setxy random-xcor random-ycor
      set age random lifespan
      set sick-time 0
      set remaining-immunity 0
      set size .7 ;; easier to see
      get-healthy ]
  ask n-of 1 turtles
    [ get-sick ]
end 

to get-sick ;; turtle procedure
  set sick? true
  set remaining-immunity 0
end 

to get-healthy ;; turtle procedure
  set sick? false
  set remaining-immunity 0
  set sick-time 0
end 

to become-immune ;; turtle procedure
  set sick? false
  set sick-time 0
  set remaining-immunity immunity-duration
  ask my-links [ die ] ;; remove link to turtle who infected us, if there was one
end 

;; This sets up basic constants of the model.

to setup-constants
  set lifespan 80 * 52 * 7     ;; 80 times 52 weeks times 7 days = 50 years = 2600 weeks old = 18200 days
  set carrying-capacity 1089
  set chance-reproduce 0.34 ;; birth rate per 1000 people per week
  set immunity-duration 4 * 7 ;; 4 weeks for immunity duration
  if Weather = "Hot-Humid" [set infectiousness  .9 * infectiousness]
  if Weather = "Hot-Dry" [set infectiousness  .95 * infectiousness]
  if Weather = "Cold-Dry" [set infectiousness  .97 * infectiousness]
  if Weather = "Cold-Humid" [set infectiousness infectiousness]
end 

to go
  ask turtles [
    get-older
    move
    if sick? [ recover-or-die ]
    ifelse sick? [ infect ] [ reproduce ]
  ]
  update-global-variables
  update-display
  tick
  if ticks = 100 [stop]
end 

to update-global-variables
  if count turtles > 0
    [ set %infected (count turtles with [ sick? ] / count turtles) * 100
      set %immune (count turtles with [ immune? ] / count turtles) * 100 ]
end 

to update-display
  ask turtles
    [ if shape != turtle-shape [ set shape turtle-shape ]
      set label ifelse-value show-age? [ floor (age / 364) ] [ "" ]
      set color ifelse-value sick? [ red ] [ ifelse-value immune? [ grey ] [ green ] ]
      if age < 10 * 52 * 7 [set color blue]
      if age > 60 * 52 * 7 [set color yellow]
    ]
  stop-inspecting-dead-agents
  if watch-a-person? and subject = nobody
    [ watch one-of turtles with [ not hidden? ]
      clear-drawing
      ask subject [ pen-down ]
      inspect subject ]
  if not watch-a-person? and subject != nobody
    [ stop-inspecting subject
      ask subject
        [ pen-up
          ask my-links [ die ] ]
      clear-drawing
      reset-perspective ]
  ask patches [
  if Weather = "Hot-Humid" [set pcolor 68]
  if Weather = "Hot-Dry" [set pcolor 48]
  if Weather = "Cold-Dry" [set pcolor 38]
  if Weather = "Cold-Humid" [set pcolor 108]
  ]
end 

;;Turtle counting variables are advanced.

to get-older ;; turtle procedure
  ;; Turtles die of old age once their age exceeds the
  ;; lifespan (set at 80 years in this model).
  set age age + 1
  if age > lifespan [ die ]
  if age > 60 * 52 * 7 [ set chance-recover .93]
  if age < 60 * 52 * 7 [ set chance-recover .97]
  if immune? [ set remaining-immunity remaining-immunity - 1 ]
  if sick? [ set sick-time sick-time + 1 ]
end 

;; Turtles move about at random.

to move ;; turtle procedure
  rt random 100
  lt random 100
  fd movement
end 

;; If a turtle is sick, it infects other turtles on the same patch.
;; Immune turtles don't get sick.

to infect ;; turtle procedure
  ask other turtles-here with [ not sick? and not immune? ]
    [ if random-float 100 < infectiousness
      [ get-sick
        if self = subject             ;; if its the watched turtle getting sick
          [ create-link-with myself   ;; create a link with the one that infected it
            [ set color red
              set thickness .3 ] ] ] ]
end 

;; Once the turtle has been sick long enough, it
;; either recovers (and becomes immune) or it dies.

to recover-or-die ;; turtle procedure
  if age > 60 * 52 * 7 [ set chance-recover .93]
  if age < 60 * 52 * 7 [ set chance-recover .97]
  if sick-time > duration                        ;; If the turtle has survived past the virus' duration, then
    [ ifelse random-float 100 < chance-recover   ;; either recover or die
      [ become-immune ]
      [ set number-dead number-dead + 1
        die ]]
end 

;; If there are less turtles than the carrying-capacity
;; then turtles can reproduce.

to reproduce
  if count turtles < carrying-capacity and random-float 100 < chance-reproduce
    [ hatch 1
      [ set age 1
        lt 45 fd 1
        pen-up ;; in case we're hatched from the watched turtle
        get-healthy ] ]
end 

to-report immune?
  report remaining-immunity > 0
end 

to startup
  setup-constants ;; so that carrying-capacity can be used as upper bound of number-people slider
end 



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

There are 7 versions of this model.

Uploaded by When Description Download
Anamaria Berea about 4 years ago Updated Info Tab Download this version
Anamaria Berea about 4 years ago Fixed some bugs Download this version
Anamaria Berea about 4 years ago Updated with tracking for deaths Download this version
Anamaria Berea about 4 years ago Includes updated parameters for climate and movement restriction of agents Download this version
Anamaria Berea about 4 years ago Includes Age Diff and Weather Climate Download this version
Anamaria Berea about 4 years ago Updated with weather patterns and age difference Download this version
Anamaria Berea about 4 years ago Initial upload Download this version

Attached files

File Type Description Last updated
COVID_19 Spread.png preview COVID_19 screenshot about 4 years ago, by Anamaria Berea Download

This model does not have any ancestors.

Children:

Graph of models related to 'COVID_19 Spread'