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 over 2 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 124 times • Downloaded 15 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.)


Info tab cannot be displayed because of an encoding error

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 over 2 years ago by Javier Sandoval.

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.