Mobility and virus propagation

Mobility and virus propagation preview image

1 collaborator

19344_1338329223422_4777790_n Javier Sandoval (Author)

Tags

virus-spread, mobility, covid-19 

Tagged by Javier Sandoval about 4 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 331 times • Downloaded 37 times • Run 0 times
Download the 'Mobility and virus propagation' 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?

This is a model that shows how the speed of spread of a virus changes according to the amount of immobile population and how it contributes to what has been colloquially called "flattening the curve."

HOW IT WORKS

There is a healthy population (green circles), of which a percentage does not move emulating the "stay at home" restriction and the rest moves randomly. A person in the mobile population is sick (red circle) with a virus that infects when it comes into contact with healthy people. These newly infected people in turn infect other healthy people. Infected people are removed from the screen, enter a hospital and occupy a bed. The time that passes between a person is infected and finally decides to hospitalize is random. After a certain time of occupying a bed, the person becomes immune, leaves the bed and reappears mobile on the screen (gray circle). This dynamic occurs in a context of a limited number of hospital beds. The simulation stops when there are no longer any sick people or when there are no more beds available.

HOW TO USE IT

1) Assign total population amount in the "population" slider. 2) Input the percentage of population that will remain fixed in "%fixed-population". 3) Input the total number of hospital beds in "beds". 4) Press the "setup" button to generate the assigned population. 5) Press the "go" button to start or pause the model.

THINGS TO NOTICE

Observe in the plot if at any time the number of sick population exceeds the number of available beds, which is an undesired scenario.

Observe how the curve "flattens" as the percentage of fixed people increases.

THINGS TO TRY

Try with different percentages of fixed people and compare the outputs of the amount of sick population. Test with these percentages until the number of sick population does not exceed the number of beds available, which is a desirable scenario.

CREDITS AND REFERENCES

This model was inspired by the Washington Post article titled Why outbreaks like coronavirus spread exponentially, and how to “flatten the curve” by Harry Stevens (https://www.washingtonpost.com/graphics/2020/world/corona-simulator/)

Comments and Questions

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

Click to Run Model

;::::::::::::::::::::::::::::::::::::::::::::::::::: V I R U S   P R O P A G A T I O N ::::::::::::::::::::::::::::::::::::::::::::::::::::::
;::::::::::::::::::::::::::::::::::::::::::::::::Código y diseño: Dr. Javier Sadoval Félix:::::::::::::::::::::::::::::::::::::::::::::::::::
;::::::::::::::::::::::::::::::::::::::::::::::::::::Contacto: jarquisol@gmail.com:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
globals [available-beds]
turtles-own
  [ sick?
    immune?
    mobile?
    time-sick
    time-remaining-to-decide-to-hospitalize]

to setup
  clear-all
  setup-turtles
  update-visualization
  set available-beds total-beds
  reset-ticks
end 

to go
  ask turtles [
    if mobile? [fd .3]
    if sick? [
      infect
      set time-sick time-sick + 1
      set time-remaining-to-decide-to-hospitalize time-remaining-to-decide-to-hospitalize - 1

    if time-remaining-to-decide-to-hospitalize = 0 [
      set available-beds available-beds - 1
      set hidden? true]
    ]

    if sick? and time-sick = 300 [
      set sick? false set immune? true
      if hidden? [set available-beds available-beds + 1]
      set hidden? false
      if mobile? = false [set mobile? true]
  ]]

  update-visualization
  if count turtles with [sick?] = 0 [
    user-message "There is no more sick population"
    stop]
  if available-beds = 0 [
    user-message "There are no more beds available"
    stop]
  tick
end 

to setup-turtles
  create-turtles population
    [ setxy random-xcor random-ycor
      set mobile? true
      set size 1
      set shape "circle"
      set color green
      set immune? false
      healthy ]
  ask n-of (population * (%fixed-population / 100))  turtles [set mobile? false]
  ask n-of 1 turtles with [mobile? = true]
    [ enfermarse
      set time-remaining-to-decide-to-hospitalize random 300]
end 

to update-visualization
  ask turtles [
    ifelse sick?
    [set color red ]
    [ifelse immune? [set color grey ] [set color green]]
  ]
end 

to healthy
  set sick? false
end 

to enfermarse
  set sick? true
  set time-sick time-sick + 1
end 

to infect
  if hidden? = false [
  ask other turtles-here with [ not sick? and not immune? ] [
    enfermarse
    set time-remaining-to-decide-to-hospitalize random 150
  ]]
end 

There is only one version of this model, created about 4 years ago by Javier Sandoval.

Attached files

File Type Description Last updated
Mobility and virus propagation.png preview Preview for 'Mobility and virus propagation' about 4 years ago, by Javier Sandoval Download

This model does not have any ancestors.

This model does not have any descendants.