Covid-19 and Health System Capacity

Covid-19 and Health System Capacity preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Tags

covid-19 

Tagged by Antônio Ralph Medeiros de Sousa over 5 years ago

sars-cov-2 

Tagged by Antônio Ralph Medeiros de Sousa over 5 years ago

virus_spread 

Tagged by Antônio Ralph Medeiros de Sousa over 5 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.0 • Viewed 1073 times • Downloaded 52 times • Run 0 times
Download the 'Covid-19 and Health System Capacity' 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 model simulates the epidemic dynamics of a direct-transmitted virus that causes acute respiratory disease among a closed population of susceptible humans. The focus of this model is the transmission dynamics of Sars-CoV-2 that causes COVID-19, but it can be applied to other respiratory infections.

From this model, it is possible to observe how the introduction of some infected individuals in a population that is totally susceptible can generate an epidemic that, depending on how fast it spreads and the severity of cases, leads to the collapse of health system.

By manipulating the different parameters of the model, the user will be able to observe how the epidemic evolves in the population, the level of overwhelm in the health system and how mitigation measures (or suppression) and case detection could reduce the growth of the epidemic curve and reduce mortality.

HOW IT WORKS

The world is divided into three environments: Interaction-zone (gray area), Hospital (pink area) and Quarantine (green area).

The turtles represent the human population. All turtles in the interaction-zone can become infected and transmit the virus at rates that will depend on the selected parameters.

The dynamics of the transmission model is SEIR (Susceptible - Exposed - Infected - Recovered). Susceptible individuals can be exposed to the virus and enter a latency period in which the virus begins to replicate in the host's body, but cannot yet be transmitted. After that, the infectious period begins, in which the infected individual can infect susceptible people, even without showing clinical symptoms of the disease. The evolution of the infection may be different among individuals in the population, with only a certain proportion of those infected having symptoms. Among these, some will need medical and hospital care due to the worsening of the disease, especially those belonging to the risk group. Individuals who need to be hospitalized will be moved to the hospital, as long as it is not full. As an outcome, the individual may recover and become immune or die (in the most severe cases).

A certain proportion of infected individuals can be identified and moved to the quarantine, where they can keep or be moved to the hospital, remaining in one of these environments until the outcome of the disease occurs. If recovered, the individuals will return to interaction-zone. When the individual dies, he is removed from the world.

The presence of the virus in the population is represented by the colors of individuals. Four colors are used: Susceptible = white; Exposed = yellow; Infected = red; Recovered / immune = blue.

The HEALTH SYSTEM graph shows the daily number of individuals needing to be hospitalized and the capacity of the health system to serve patients. The POPULACIONAL STATUS graph shows the percentage of individuals in the population who are in the condition of susceptible, infected or recovered and immune. Three monitors show data on mortality and one monitor estimates the basic number of reproduction (R0).

The R0 used here is the same proposed by Uri Wilenski for the “epiDEM basic” and “epiDEM Travel and Control” models. In this case, the R0 obtained at the end of the simulation represents an estimate of the average number of secondary infections generated by an infected individual throughout their infectious period.

Each time-step can be considered to be a day.

When there are only susceptible or immune individuals in the world the simulation stops.

HOW TO USE IT

The SETUP button will create individuals according to parameter values chosen by the user. The epidemic will start with the introduction of a few infected individuals in the population.

Once the simulation has been setup, push the START SIMULATION button to run the model. This button runs the simulation continuously until it be pushed again or the virus is no longer circulating between individuals.

Below is a brief explanation of the slides of the models:

INITIAL-POPULATION (100 – 1000): The initial number of humans in the simulation.

INITIAL-INFECTED (1 – 10): The initial number of infected people in the population.

TRANSMISSION-RATE (0.01 – 1): The probability that an infected individual will infect a susceptible individual during an infectious interaction.

RISK-GROUP (0 - 1): Proportion of individuals belonging to the risk group (ex: elderly, diabetics, immunosuppressed).

SYMPTOMATIC-PROPORTION (10 - 100): Percentage of infected individuals who will present clinical symptoms of the disease.

RECOVERY-TIME (7 – 30): Average time in days that individuals will take to recover from the infection.

HOSPITAL-CAPACITY (5 - 20): Maximum number of individuals that the hospital will be able to attend simultaneously (equivalent to the number of beds).

DAYS-TO-START-CONTROL-MEASURES (1 - 60): Time in days for the start of mitigation / suppression measures after the start of the epidemic.

PROPORTION-OF-POPULATION (0 - 1): The proportion of the population following the recommendations to reduce contagion.

PROTECTION-LEVEL (0.01 – 0.99): Degree of the effectiveness of the measures adopted by the population.

ISOLATE-INFECTED? (switch): When 'ON' a certain daily proportion of infected people will be identified and quarantined.

INFECTED-DETECTION (0.01 - 10): Daily percentage of detection and isolation of infected individuals in the population.

THINGS TO NOTICE

Note the relationship between the proportion of susceptible, infected and recovered over time. See how this changes depending on the selected parameters.

Note that mortality rates vary according to the denominator used. Here the total population, the infected population, and the symptomatic population are used to calculate the different mortality rates. The final values will be influenced by the relationship between the number of patients needing hospitalization and the capacity of the health system to serve these individuals.

Note that the parameters that control the latency period, the time for the appearance of symptoms, and the chance of death among symptomatic patients can only be changed directly in the model code. For the latency period, an average of 3 days was considered, which can randomly vary according to a Poisson distribution. Symptoms can appear two days after the latency period (assuming an average incubation period of 5 days). Among the severe cases, the average mortality considered here is: Risk group = 7% if hospitalized and 60% if not hospitalized; No risk group = 1% if hospitalized and 20% if not hospitalized. These values also represent means of a random Poisson distribution.

THINGS TO TRY

Try to identify in which situations the health system could provide treatment to all patients and in which situations the capacity for care would be extrapolated.

Observe as the different levels of mitigation measures and the time is taken to start these measures can influence the final results of the simulation.

EXTENDING THE MODEL

It is possible to model the dynamics of transmission through links, thus creating a network of interactions between agents. In this way, individuals closer to an infected person (as family members or friends) would have a greater chance of being infected by the virus.

The application of demographic parameters and an explicit geographical spatialization of the model could bring greater realism and, perhaps, a few analytical reliability. This will obviously require a greater number of agents and simulations that demand greater computational power. In the current format, this model lends itself only to didactic purposes.

NETLOGO FEATURES

In this model, the potential infectious contact between humans occurs based on a Moore Neighborhood pattern. This means that the infectious individual will select a susceptible individual (if any) from the eight adjacent patches.

RELATED MODELS

epiDEM Basic, epiDEM Trave and Control, HIV and Virus.

During the simulation, when the hospital reaches the limit of patients, the label "CROWDED" will appear. This was based on the "El Farol" model.

CREDITS AND REFERENCES

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Medeiros-Sousa, Antônio Ralph (2020). Covid-19 and Health System Capacity. School of Public Health, University of São Paulo, Brazil. Contact: aralphms@usp.br

Please cite the NetLogo software as:

Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Comments and Questions

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

Click to Run Model

globals [
  interaction-zone         ;; The patches representing the area of social interactions in the world
  quarantine               ;; The patches representing the humans are in quarantine
  hospital                 ;; The patches representing the hospital with severe cases of the disease
  upper-border             ;; The borders of interaction-zone
  lower-border
  crowded-patch            ;; The patch where the "CROWDED" label appears
  patients                 ;; Infected people being trated in the hospital
  count-infected           ;; Cumulative number of infected people
  count-symptomatic        ;; Cumulative number of infected and symptomatic people
  r0                       ;; The number of secondary infections that arise due to a single infective introduced in a wholly susceptible population
  s0                       ;; Initial population of susceptible people
  hospital-patch           ;; The patch where the "HOSPITAL" label appears
  quarantine-patch         ;; The patch where the "QUARANTINE" label appears
]

breed [humans human]

humans-own
[susceptible?             ;; If true, the human is susceptible.
 exposed?                 ;; If true, the human is infected but in latent period
 infected?                ;; If true, the human is infected and infectious
 immune?                  ;; If true, the human is immune
 symptomatic?             ;; If true, the infected human is symptomatic
 hospitalized?            ;; If true, the infected and symptomatic human will be hospitalized
 protect?                 ;; If true, the human is protecting himself from infection
 need-hospital?           ;; If true, an infected and symptomatic human will need a hospital
 isolated?                ;; If true, an infected human will be isolated in quarantine
 risk-population?         ;; The proportion of the population at risk of severe disease (i.e. old people, pre-existing chronic disease)
 latent-period            ;; The latent period of the virus
 viremic-time             ;; The time in days that individuals will be infectious and can transmit the virus to others
 ]


;;;;;
;;; SETUP PROCEDURES
;;;;;

to setup
  clear-all
  setup-globals
  setup-host
  reset-ticks
end 

to setup-globals
  ;; creating interaction-zone patches
  set interaction-zone patches with [(pxcor >= min-pxcor and pycor < int (max-pycor - (max-pycor / 2)) and pycor > min-pycor)]
  ask interaction-zone [ set pcolor gray ]

  ;; creating quarantine patches
  set quarantine patches with [(pxcor > (0.5 * min-pxcor) and pycor > int (max-pycor - (max-pycor / 2)) )]
  ask quarantine [set pcolor green ]

  ;; creating hospital patches
  set hospital patches with [(pxcor >= min-pxcor and pxcor <= (0.5 * min-pxcor) and pycor > int (max-pycor - (max-pycor / 2)))]
  ask hospital [set pcolor pink ]

  ;; creating border patches
  set upper-border patches with [(pycor = int (max-pycor - (max-pycor / 2)))]
  ask upper-border [ set pcolor gray ]
  set lower-border patches with [(pycor = min-pycor)]
  ask lower-border [ set pcolor gray ]

  ;; selecting patches where labels will appear
  ask patch (0.7 * min-pxcor) ( 0.8 * max-pycor) [
    set crowded-patch self
    set plabel-color black]
  ask patch (0.7 * min-pxcor) ( 0.95 * max-pycor) [
    set hospital-patch self
    set plabel "HOSPITAL"
    set plabel-color black]
  ask patch (0.3 * max-pxcor) ( 0.95 * max-pycor) [
    set quarantine-patch self
    set plabel "QUARANTINE"
    set plabel-color black]
end 

to setup-host
  ;; creating people and moving them to interaction-zone patches
  create-humans initial-people
  [ask humans [move-to one-of interaction-zone]
   set shape "person"
   set size 0.5
   set infected? false
   set immune? false
   set susceptible? true
   set exposed? false
   set risk-population? false
   set symptomatic? false
   set hospitalized? false
   set protect? false
   set need-hospital? false
   set isolated? false
   ]

   ;; selecting initial number of infected people
   ask n-of initial-infected humans [
    set susceptible? false
    set infected? true]
  ;; selecting people who will be less exposed to infection due to individual protection measures
  ask n-of (initial-people * proportion-of-population) humans [set protect? true]

  ;; selecting people who will belong to the risk group
  ask n-of (initial-people * risk-group) humans [set risk-population? true]

  ask humans [assign-color]
end 

to assign-color  ;; The colors for represent the virus circulation and individual status
    if susceptible? [ set color white ]
    if exposed? [ set color yellow ]
    if infected? [ set color red ]
    if immune? [ set color blue ]
end 

;;;;;
;;; GO PROCEDURES
;;;;;

to go
  ask crowded-patch [ set plabel "" ]
  move-humans
  if all? humans [ not exposed? and not infected? ] [stop]  ;; stopping the simulation

  ask humans with [exposed?] [become-viremic]
  ask humans with [infected?] [infect-others symptom]
  ask humans with [symptomatic?] [recovery-or-die]
  ask humans [if hospitalized? and immune? [move-to one-of interaction-zone]] ;; people who recovered at the hospital go back to interaction-zone
  ask humans with [symptomatic?] [check-for-hospital go-to-hospital]

  set patients count turtles-on hospital
  if patients > hospital-capacity [ask crowded-patch [ set plabel "CROWDED" ]] ;; If the hospital have more patients than it can handle, the label "CROWDED" will appear

  ;;Infected people who are detected will be quarantined (but only after the start of control measures).
  if isolate-infected? [ask humans with [infected? and not hospitalized?]
    [if ticks >= days-to-start-control-measures [
      if random 100 < infected-detection [
      move-to one-of quarantine
      set isolated? true]]]]

  ask humans-on quarantine [if immune? [move-to one-of interaction-zone set isolated? false]] ;; people who recovered in the quarantine go back to interaction-zone

  calculate-r0
  tick
end 

;; People move around the world randomly, but they don't move around in the quarantine and in the hospital patches.

to move-humans
    ask humans-on interaction-zone
    [rt random-float 360.0
    forward random-float 1
    assign-color]
    ask humans-on upper-border [
    move-to patch-at-heading-and-distance 180 1
    assign-color]
    ask humans-on lower-border [
    move-to patch-at-heading-and-distance 180 -1
    assign-color]
    ask humans-on hospital[
     assign-color ]
    ask humans-on quarantine [
      assign-color]
end 

;; Infected people can infect susceptible ones

to infect-others
 ;; selecting a susceptible target in neighbor patches
 let target-h (humans-on neighbors)
 let hosth one-of (target-h with [susceptible?])

  ;; The chance of a susceptible person becoming infected will depend on the transmission rate and whether or not he is protecting himself from the transmission.
  if hosth != nobody [
  ifelse not protect? [
   if random-float 1 < transmission-rate [
    ask hosth [
      set susceptible? false
      set exposed? true
      set count-infected count-infected + 1
    ] ] ]
      [ if ticks < days-to-start-control-measures [
      if random-float 1 < transmission-rate [
      ask hosth [
      set susceptible? false
      set exposed? true
      set count-infected count-infected + 1
      ] ] ]
      if ticks >= days-to-start-control-measures [
      if random-float 1 < (transmission-rate * (1 - protection-level)) [
      ask hosth [
      set susceptible? false
      set exposed? true
      set count-infected count-infected + 1
      ] ] ]
  ] ]
end 

;; A human who has been infected with the virus will become infectious after the latency period

to become-viremic
  set latent-period latent-period + 1
  if latent-period > random-poisson 3 [  ;; An average latency period of 3 days was considered here
     set infected? true
     set exposed? false
     ]
end 

;; A given proportion of infected people will become symptomatic

to symptom
  set viremic-time viremic-time + 1

  ;;It was considered that the first symptoms may appear in 2 days after the virus latency period, which means an incubation period of 5 days on average.
  if viremic-time = 2 [
  if random 100 < symptomatic-proportion [
    set symptomatic? true
    set count-symptomatic  count-symptomatic + 1
  ]]

  ;; asymptomatic people become immune after recovery time
    if viremic-time = recovery-time and not symptomatic? [
      set infected? false
      set immune? true
      ]
end 

;; Check if infected-symptomatic people need a hospital

to check-for-hospital
 ifelse risk-population? [
    if random 100 < 20 [  ;; For the people of the risk group, a 20% chance of needing a hospital was considered
      set need-hospital? true]]
   [if random 100 < 5 [   ;; For people who are not of risk group, a 5% chance of needing a hospital was considered
    set need-hospital? true ]]
end 

;; If the Hospital is not crowded, go to it.

to go-to-hospital
  set patients count turtles-on hospital
  if need-hospital? [
   if patients < hospital-capacity + 1 [
      move-to one-of hospital
      set hospitalized? true]]
end 

;; After a few days, infected symptomatic people may recover from illness or die
;; This will depend on the severity of the case (need-hospital?), whether or not the person is hospitalized, and whether or not he belongs to the risk group.

to recovery-or-die
  if need-hospital?
  [
  ifelse not hospitalized?
    [
   if viremic-time >= random-poisson recovery-time * 1.5  ;; severe cases will take 50% more time to recover
      [
     if risk-population?
        [
       ifelse random 100 < random-poisson 20 [    ;;people in the risk group who need a hospital and are not hospitalized have an average 20% chance of surviving
        set infected? false
        set symptomatic? false
        set immune? true
        set need-hospital? false]
       [ die ]]
     if not risk-population?
        [
       ifelse random 100 < random-poisson 60      ;;people who are not in the risk group who need a hospital and are not hospitalized have an average 60% chance of surviving
          [
        set infected? false
        set symptomatic? false
        set immune? true
        set need-hospital? false]
        [ die ]]]]

  [if viremic-time >= random-poisson recovery-time * 1.5
      [
    if risk-population?
        [
       ifelse random 100 < (100 - random-poisson 7)  ;; people who are the risk group and who are hospitalized have an average 93% chance of surviving
          [
       set infected? false
       set symptomatic? false
       set immune? true
       set need-hospital? false]
       [ die ]]
    if not risk-population?
        [
       ifelse random 100 < (100 - random-poisson 1)    ;; people who are not in the risk group and who are hospitalized have an average 99% chance of surviving
          [
       set infected? false
       set symptomatic? false
       set immune? true
       set need-hospital? false]
       [ die ]]]]]

  if not need-hospital?  ;; Infected-symptomatic people who do not need a hospital will always recover from infection
  [
    if viremic-time >= random-poisson recovery-time
    [
      set infected? false
      set symptomatic? false
      set immune? true
       ]]
end 


;; This R0 is a numerical estimate of the basic reproduction number, as proposed by Uri Wilensky.
;; For more information on how this R0 equation was obtained, see the models 'epiDEM basic' and 'epiDEM travel and control'.

to calculate-r0
  set s0 initial-people - initial-infected

  if ((initial-people - count turtles with [ susceptible? ]) != 0 and (count turtles with [ susceptible? ] != 0))   ;; Prevent from dividing by 0
  [
    set r0 (ln (s0 / count turtles with [ susceptible? ]) / (initial-people - count turtles with [ susceptible? ]))
    set r0 r0 * s0 ]
end 

There is only one version of this model, created over 5 years ago by Antônio Ralph Medeiros de Sousa.

Attached files

File Type Description Last updated
Covid-19 and Health System Capacity.png preview Preview for 'Covid-19 and Health System Capacity' over 5 years ago, by Antônio Ralph Medeiros de Sousa Download

This model does not have any ancestors.

This model does not have any descendants.