Flatten the Curve -- COVID-19

Flatten the Curve -- COVID-19 preview image

2 collaborators

Default-person Arthur Hjorth (Author)
Default-person Māris Nartišs (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 1267 times • Downloaded 18 times • Run 0 times
Download the 'Flatten the Curve -- COVID-19' 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

Unreadable in NetLogo 6.1.1 (Question)

If I download this, unzip it and open it with NetLogo 6.1.1, it says it can't be opened. Also the .nlogo file contains only gibberish (^@^@^@^@^@). I am interested in the model, is there something wrong I am doing?

Posted 20 days ago

This web site needs some love

Yes, download option seems to give corrupted file. Also Info page complains about encoding (WTF?). A workaround — Click on „Run in NetLogo Web“, activate it, then on upper-right corner will be an export: NetLogo button. It will give you a .netlogo file that works (tested with 6.1.1).

Posted 20 days ago

Solved

Great, thanks, so, this is a general issue of the modelingcommons.org web app, then.

Posted 20 days ago

Love your additions, Māris

Thanks for improving the model! Guglielmo, I will write the NetLogo team and tell them there are problems with downloads. Hopefully it will be fixed soon.

Posted 19 days ago

Download issue is gone

I added a new slightly updated version (now includes tracking patients in a hospital) and the problem with model downloading is gone.

Posted 19 days ago

Can I make and distribute an Italian translation?

I would like to distribute this model in Italy, specially for schools. Do you agree?

Posted 18 days ago

This is just a model!

Yes, please do so! Keep in mind — I am a geographer and not an epidemiologist, thus it might be quite wrong. Otherwise — spread the word! More people see this, more they will understand how important is to stay at home.

Posted 18 days ago

Italian model available

I've just uploaded the translated model.

Posted 18 days ago

Click to Run Model

turtles-own [
  infected?
  infected-on
  sick?
  hospital?
  immune?
]
breed [people a-person]
globals [
  pen-color
  exp-risk
  exp-interaction
  max-sick-proportion
  max-hospitalization
  max-hospital-occupation
]

to setup
  ca
  create-people number-of-people [
    setxy random-xcor random-ycor
    set infected? false
    set sick? false
    set immune? false
    set color blue
    set shape "person"
  ]
  repeat count people * avg-relationships-per-person [
    ask one-of people [
      create-link-with min-one-of other people with [not member? self [link-neighbors] of myself] [distance myself]
    ]
  ]
  set exp-interaction 0
end 

to setup-experiment
  reset-ticks
  set max-sick-proportion 0
  set max-hospitalization 0
  set max-hospital-occupation 0
  if exp-interaction != probability-of-interaction [
    set pen-color 12 + (6 * probability-of-interaction) / 100
  ]
  ask people [
    set infected? false
    set immune? false
    set sick? false
    set hospital? false
    set infected-on 0
    set color blue
  ]
  set-current-plot "Infected"
  create-temporary-plot-pen (word "Interaction: " probability-of-interaction)
  set-plot-pen-color pen-color
  plot-pen-down
  set exp-interaction probability-of-interaction
  ask one-of people [
    set infected? true
    set color 45
    set infected-on ticks
  ]
end 

to go
  if not any? turtles with [sick?] and not any? turtles with [infected?] [
    plot-pen-up
    plotxy 1 0
    stop
  ]
  ask people with [(infected? or sick?) and not hospital?] [
    ask my-links with [random 100 < probability-of-interaction] [
      if random 100 < probability-of-infection [
        ask other-end [
          if not infected? and not immune? and not sick? [
            set infected? true
            set infected-on ticks
            set color 45
          ]
        ]
      ]
    ]
  ]
  let current-infection count people with [infected? or sick?] / number-of-people
  let cur-hospital-occupation count people with [hospital?]
  let cur-require-hospitalization floor ((count people with [sick?] * require-hospitalization-pcnt) / 100)
  set max-sick-proportion max (list max-sick-proportion current-infection )
  set max-hospitalization max (list max-hospitalization cur-require-hospitalization )
  set max-hospital-occupation max (list max-hospital-occupation cur-hospital-occupation)
  ; At the end of incubation period, person turns sick
  ask people with [infected? and (ticks - infected-on) > incubation-period] [
    set infected? false
    set sick? true
    set color red
  ]
  ; Recovery gives infinite immunity
  ask people with [sick? and (ticks - infected-on) > (recovery-time + incubation-period)] [
    set sick? false
    set immune? true
    set hospital? false
    set color gray
  ]
  ; Only some sick persons require hospitalization
  let cur-to-hospital 0
  if (cur-require-hospitalization - cur-hospital-occupation) > 0 [
    set cur-to-hospital cur-require-hospitalization - cur-hospital-occupation
  ]
  ask n-of cur-to-hospital people with [sick?] [
    if cur-hospital-occupation < hospital-beds [
      set hospital? true
      set color lime
      set cur-hospital-occupation cur-hospital-occupation + 1
    ]
  ]
  plotxy ticks current-infection
  tick
end 

There are 8 versions of this model.

Uploaded by When Description Download
Māris Nartišs 19 days ago Add simple hospitalization tracking Download this version
Māris Nartišs 20 days ago Fix compatability with NetLogo Web Download this version
Māris Nartišs 20 days ago Reverted to older version Download this version
Māris Nartišs 20 days ago Give users finer control over various model parameters Download this version
Arthur Hjorth 27 days ago Updated info Download this version
Arthur Hjorth 27 days ago Updated layout Download this version
Arthur Hjorth 27 days ago New Version Download this version
Arthur Hjorth 27 days ago Initial upload Download this version

Attached files

File Type Description Last updated
Flatten the Curve -- COVID-19.png preview Preview for 'Flatten the Curve -- COVID-19' 27 days ago, by Arthur Hjorth Download

This model does not have any ancestors.

This model does not have any descendants.