COVID-19 SEIRD Farmworkers

COVID-19 SEIRD Farmworkers preview image

1 collaborator

Default-person Lorena Morejon (Author)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 516 times • Downloaded 40 times • Run 0 times
Download the 'COVID-19 SEIRD Farmworkers' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


COVID-19 SEIRD MODEL: EFFECTS OF VARIOUS CONTROL MEASURES RELEVANT TO MIGRANT AND SEASONAL FARMWORKER COMMUNITIES

In the United States, racial and ethnic minority groups also have disproportionately higher rates of hospitalization and death, likely attributable to differences in economic and social conditions of these groups in certain contexts. Throughout the course of the pandemic, so-called “essential workers” have maintained in-person work, putting them at greater risk of exposure to the virus. Agricultural workers, particularly those who are undocumented, face unique challenges in the COVID-19 pandemic.

WHAT IS IT?

This model is based on the NetLogo epiDEM Basic model by Yang and Wilensky and the Covid-19 and Health System Capacity model by Medeiros-Sousa. It simulates the epidemic dynamics of an infectious disease in a closed population. While this model focuses on SARS-CoV-2, the virus that causes COVID-19, it can be applied to other infections spread through respiratory droplets. In addition to providing insight into the case of farmworker communities, this model may also be used to better understand the epidemiology of COVID-19 in general and in other populations with health disparities.

From this model, it is possible to observe how the introduction of some infected humans in a susceptible population can generate an epidemic that, depending on how fast it spreads and the severity of cases, can overwhelm the healthcare system and lead to many deaths.

By manipulating the different parameters of the model, the user will be able to observe how the epidemic evolves in the population and how various control measures could reduce the growth of the epidemic curve and reduce mortality.

HOW IT WORKS

Humans wander around the world in random, mobility-controlled motion. The world is divided into three environments:

INTERACTION-ZONE: The gray area includes patches representing the region of social interactions in the world. It is defined by an upper and lower border. If enabled, white patches representing high-touch-areas will be randomly generated within the interaction-zone such that humans on these patches have a higher probability of exposure to the virus. HOSPITAL: The pink area labeled "HOSPITAL" includes patches representing where patients with severe disease are treated. If the hospital has more patients than it can handle, the label "AT CAPACITY" will appear. QUARANTINE: The cyan area labeled "QUARANTINE" includes patches representing where infected humans may be isolated upon detection.

The dynamics of the transmission model is SEIRD (Susceptible - Exposed - Infected - Recovered - Deceased). Upon coming into contact with an infected human, by being in any of the eight surrounding neighbors of the infected human or in the same location, a susceptible human has a chance of exposure. Susceptible humans exposed to the virus enter a latent 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 human can infect susceptible humans, even without showing clinical symptoms of the disease.

The evolution of the infection may vary depending upon several factors, including the development of symptoms and the presence of underlying medical conditions (i.e. belonging to the risk group). As an outcome, an infected human has a probability of recovering or dying after reaching the end of their recovery time period.

The colors of the humans indicate the state of their health. Five colors are used: white humans are susceptible, yellow humans are exposed, red humans are infected, green humans are recovered, and black dots are deceased. Once recovered, the human is assumed to be permanently immune to the virus.

At the end of the simulation, the r0 reflects the estimate of the basic reproduction number, the number of secondary infections generated by an infected human throughout their infectious period. This closely follows the Kermack McKendrick mathematical derivation that r0 = betas0 / gamma = nln(s0/s(t)) / (n - s(t))), where n is the total population, s0 is the initial number of susceptibles, and s(t) is the total number of susceptibles at time t.

HOW TO USE IT

The USE-NEW-SEED button allows the user to use a seed created by the NEW-SEED reporter. The USE-SEED-FROM-USER button allows the user to reproduce a run by entering a seed. The SETUP button creates humans according to the parameter values chosen by the user. Once the model has been setup, push the GO button to run the model. GO starts the model and runs it continuously until GO is pushed again. Before starting a new run, push the CLEAR button to clear the world, graphs, monitors, and previous seeds.

Note that in this model each time-step can be considered to be in days.

What follows is a summary of the sliders and switches in the model.

INITIAL-POPULATION (100 – 1000): The initial number of humans in the simulation. INITIAL-INFECTED (1 – 10): The initial number of infected humans in the population. INITIAL-RECOVERED (0 - 5): The initial number of recovered humans in the population. SYMPTOMATIC (10 - 100): Percentage of infected humans who will present clinical symptoms of the disease. RISK-GROUP-PROPORTION (0 - 1): Proportion of humans belonging to the risk group (ex: elderly, diabetics, immunosuppressed). TRANSMISSION-RATE (0.01 – 1): The probability that an infected human will infect a susceptible human during an infectious interaction. RECOVERY-TIME (7 – 30): Average time in days that humans will take to recover from the infection. BARRIERS-TO-HEALTHCARE (0 - 1): The ability of humans to access the hospital, where 0 = complete access (no barriers) and 1 = no access (extreme barriers) HEALTHCARE-QUALITY (0 - 1): The quality of healthcare received by patients in the hospital, from poor = 0 to excellent = 1 HOSPITAL-CAPACITY (1 - 20): Maximum number of patients 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 control measures after the start of the epidemic. PROTECTION-LEVEL (0 – 1): Degree of the effectiveness of the measures adopted by the population. FOLLOWING-MEASURES-PROPORTION (0 - 1): The proportion of the population following the control measures to reduce transmission. MOBILITY (0-1): How much distance humans move throughout the model space, where 0 = no movement and 1 = maximum movement. INFECTED-DETECTION (0 - 20): Daily percentage of detection and isolation of infected humans in the population. ISOLATE-INFECTED? (switch): When ‘ON’, the percentage of infected humans specified by INFECTED-DETECTION will be identified and isolated in quarantine. HIGH-TOUCH-AREAS? (switch): When 'ON', randomized clusters of high-touch areas (in white) will appear in the interaction-zone. DISINFECT? (switch): When 'ON' the probability of infection for a human in a high-touch-area is reduced.

A number of graphs are also plotted in this model.

POPULATIONS: This plots the number of humans in the population who are in the condition of susceptible, exposed, infected, recovered, or deceased over time. CUMULATIVE INFECTED, RECOVERED, AND DECEASED: This plots the percentage of humans in the population who are in the condition of infected, recovered, or deceased over time. HEALTH SYSTEM: This plots the daily number of humans needing to be hospitalized and the capacity of the health system to serve patients.

The following monitors are included in the model.

R0: This is an estimate of the basic reproduction number, only comparable to the Kermack McKendrick's definition if the initial number of infected were 1. MORTALITY (% TOTAL): This is a measure of the percentage of deaths among the initial total population of humans. MORTALITY (% INFECTED): This is a measure of the percentage of deaths among humans who were Iinfected. MORTALITY (% SYMPTOMATIC): This is a measure of the percentage of deaths among humans who were symptomatic. POPULATION: This reports the number of humans in the population. SUSCEPTIBLE: This reports the number of susceptible humans. EXPOSED: This reports the number of exposed humans. INFECTED: This reports the number of infected humans. RECOVERED: This reports the number of recovered humans. DECEASED: This reports the number of deceased humans. FOLLOWING MEASURES: This reports the number of humans following control measures. RISK GROUP: This reports the number of humans at higher risk for severe disease and death. SYMPTOMATIC: This reports the cumulative number of symptomatic infections. HIGH-TOUCH CONTACT INFECTIONS: This reports the number of humans infected from contact with a high-touch area.

THINGS TO NOTICE

Note the relationship between the number of susceptible, exposed, infected, recovered, and deceased over time. Note the relationship between the cumulative infections and recoveries as a percentage of the total population over time. See how these change depending on the selected parameters.

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

Note that the parameters that control the latent 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 latent period, an average of 3 days was considered, which can randomly vary according to a Poisson distribution. Symptoms can appear two days after the latent 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.

Whenever there's a spread of the disease that reaches most of the population, we say that there was an epidemic. As mentioned previously, the basic reproduction number indicates the number of secondary infections that arise as a result of introducing one infected human in a totally susceptible population, over the course of the infected human's contagious period (i.e. while the human is infected). If it is greater than 1, an epidemic occurs. If it is less than 1, then it is likely that the disease spread will stop short, and we call this an endemic.

THINGS TO TRY

Try running the model by varying one slider at a time.

For example: Adjust the initial-population slider to see how more sparse, rural areas are affected as opposed to densely populated cities. Adjust the init-recovered slider (immunity is assumed) to see what outcomes would look like if a vaccine was available, and how many humans getting vaccinated it would take to see the effects of “herd immunity”. Adjust the transmission rate and recovery time to see how these factors influence the shape of the graphs.

Try to identify in which situations the health system could provide treatment to all patients and in which situations the capacity for care could be extended. Adjust the mobility slider to see how many humans “social distancing” it takes to “flatten the curve”.

Observe how the different levels of control measures and the time taken to start these measures can influence the final results of the simulation.

Notice the POPULATIONS graph and the CUMULATIVE INFECTED, RECOVERED, AND DECEASED graph. What are the relationships between the two?

EXTENDING THE MODEL

Try to change the behavior of the humans once they are infected. For example, once infected, the human might move slower, have fewer contacts, isolate him or herself etc. Try to think about how you would introduce such a variable.

In this model, we assume that the population is closed. Can you think of ways to include demographic variables such as births, deaths, and travel to mirror more of the complexities of real-world scenarios?

Try to model the dynamics of transmission through links, creating a network of interactions between agents. In this way, humans closer to an infected human (such as family members or friends) would have a greater chance of being infected by the virus.

Create more specific parameters to address barriers-to-healthcare and healthcare-quality. How can these be quantified in a useful way?

NETLOGO FEATURES

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

Notice that R0 calculated in this model is a numerical estimate to the analytic R0. In the special case of one infective introduced to a wholly susceptible population (i.e., the Kermack-McKendrick assumptions), the numerical estimations of R0 are very close to the analytic values.

RELATED MODELS

APPENDIX: OVERVIEW, DESIGN CONCEPTS, DETAILS (ODD) PROTOCOL

MODEL DESCRIPTION The computer software Netlogo is used to implement a data-driven ABM for human infectious diseases spread by respiratory droplets, such as COVID-19. The following sections provide a more detailed description of the model occording to the ODD format, which is the standard for ABMs.

PURPOSE The purpose of the model is to create an ABM of an infectious disease spread in a closed population, with particular relevance to farmworker communities. This model is designed to be transferable to other human populations.

ENTITIES, STATE VARIABLES, AND SCALES * Agents/Individuals: The model has one type of agent. The agents represent humans being modeled. The state variables for each agent include susceptible, infected, recovered, exposure-protected, and risk group status.
* Spatial Units: Each grid cell or patch in Netlogo represents approximately 450 square feet of land. * Environment: The model environment is divided into three environments: Interaction-zone (gray area), Hospital (pink area) and Quarantine (cyan area). There is an option to include high-touch areas (white) within the interaction-zone. Time is an environmental variable within the model. Each time step in the model represents 24 hours (1 day).

PROCESS OVERVIEW AND SCHEDULING The model proceeds in discrete time steps that represent days. The model runs until all agents are either recovered or deceased. Each time step, following submodels are run: move-humans, touch-surface, become-infectious, infect-others, develop-symptoms, check-for-hospital, go-to-hospital, recover-or-die, and calculate-r0. Submodels are described in the "Submodels" section.

DESIGN CONCEPTS * Basic Principles: The infection part of the model is based on an SEIRD (susceptible, exposed, infected, recovered, and deceased), an adaptation of the widely used SIR model in infectious disease modelling. When a susceptible agent comes into contact with an infected agent, there is a probability that the susceptible agent will become exposed to the disease. The value for the basic reproductive number (R0), the expected number of individuals infected by one infectious individual in a completely susceptible population, will be calculated. The model takes a simplistic approach to agent movement, with random motion that can be controlled by adjusting mobility. Unless designated to enter quarantine or the hospital, agents will move within the interaction zone. * Emergence: The emerging result from the model is the progress of infection. Based on the types of agents that are initially infectious and other agents who come in contact with these agents, patterns can emerge for how an outbreak will spread. For example, if a human is protecting itself from exposure by following control measures, the probability of a human becoming infected will be lower, leading to a smaller outbreak. Designation of infected humans to quarantine when sick can also impact how the outbreak occurs. * Adaptation: The current version of the model does not involve adaptation. Agents reproduce observed behaviors based on a set of rules given to them. For example, if an agent becomes sick, entry into quarantine or the hospital will depend on selected parameters. Agents do not adapt their behavior by deciding to quarantine or go to the hospital. * Sensing: As they move through the environment, infected agents will sense if other agents close to them are susceptible. * Interaction: The model assumes direct interaction or close proximity between agents. If a susceptible agent is in any of the eight surrounding neighbors of the infected agent or if the two agents occupy the same space (on the same Netlogo patch), it is assumed that they have had some type of interaction which may lead to the infection of the susceptible agent. * Stochasticity: Stochasticity is seen in the spread of the infectious disease through the population. When an infectious agent comes into contact with a susceptible agent, there is a probability that determines whether the susceptible agent will become exposed. Once exposed, the length of time the agent will remain exposed before becoming infected is determined by Poisson probability distribution. Similarly, the length of time an agent stays infectious is determined by Poisson probability distribution. * Observation: For every run of the model, data is collected on the number of agents who are susceptible, exposed, infected, recovered, and deceased at each time step. The output is colelcted at every time step to see how the infection changes over time. Data is collected on the symptomatic status and risk group status. The symptomatic status is only collected the time step that an agent becomes infected.

INITIALIZATION The world was setup by designating a large interaction zone in the lower portion of the world, a hospital in the upper left portion of the world, and a designated quarantine region in the upper right portion of the world. If high-touch-areas are included, these white patches can be considered shared housing. Agents are added to the world based on the initial size of the population. Agents are randomly distributed throughout the interaction zone. A given number of agents are assigned to susceptible, infected, or recovered status based on selected parameters. Agents are also assigned to become symptomatic, follow control measures (where the agent's chance of exposure is decreased) and to pertain to the risk group (where the agent's chance of severe disease and death is increased) based on the respective proportions designated for each parameter.

INPUT DATA The model does not use input data to represent time-varying processes.

SUBMODELS * Move-humans: In the model, agents move randomly. The distance traveled by the agents is determined by the mobility parameter. * Touch-surface: When an agent is on a patch that is designated as a high-touch-area, the individual has an increased probability of exposure depending on the choice to disinfect. * Become-infectious: An agent who has been exposed the virus will become infectious after the latent period. * Infect-others: When an infected agent comes into contact with a susceptible agent, the infected agent will determine if they will infect the susceptible agent based on the transmission rate and whether the susceptible agent is protected from exposure by following control measures. If the infected agent infects the susceptible agent, the susceptible agent will change their health status from susceptible to exposed. * Develop-symptoms: A given proportion of infected agents will become symptomatic two days after the end of the virus latent pariod. Asymptomatic agents will recover after the recovery time. * Check-for-hospital: The simulation will check if infected, symptomatic humans need a hospital. For the agents of the risk group, a 20% chance of needing a hospital was considered. For agents who are not of risk group, a 5% chance of needing a hospital was considered. * Go-to-hospital: Based on whether the hospital is at capacity and barriers to healthcare, an agent with severe disease may be hospitalized. * Recover-or-die: An agent will use a Poisson probability distribution to determine the number of time steps it will stay infected before it recovers. Similarly, based on severity of the disease, hospitalization, and risk group status, an agent will use a Poisson probability distribution (taking into account healthcare quality as relevant) to determine the chance of recovery. Once an agent has recovered they cannot become infected again. * Calculate-r0:; The basic reproductive number (R0) is calculated based on the Kermack McKendrick mathematical derivation that R0 = betaS(0)/ gamma = Nln(S(0) / S(t)) / (N - S(t)), where N is the total population, S(0) is the initial number of susceptibles, and S(t) is the total number of susceptibles at time t. At the end of the simulation, the R0 reflects the estimate of the basic reproduction number, the number of secondary infections generated by an infected human throughout their infectious period.

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 area where humans are in quarantine
  hospital                 ;; The patches representing the hospital, where patients are treated
  upper-border             ;; The borders of interaction-zone
  lower-border
  num-patients             ;; Number of humans with severe disease being treated in the hospital
  count-symptomatic        ;; Cumulative number of infected humans that are symptomatic
  r0                       ;; The number of secondary infections that arise due to a single infective introduced in a wholly susceptible population
  s0                       ;; Initial population of susceptible humans
  at-capacity-patch        ;; The patch where the "AT CAPACITY" label appears
  hospital-patch           ;; The patch where the "HOSPITAL" label appears
  quarantine-patch         ;; The patch where the "QUARANTINE" label appears
  num-clusters             ;; Number of patch clusters to form the high-touch areas
]

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
 recovered?               ;; If true, the human is recovered
 deceased?                ;; If true, the human died
 protect?                 ;; If true, the human is protecting himself from infection by following measures
 exposure-from-touch?     ;; If true, the human came in contact with the virus from touching contaminated surface
 symptomatic?             ;; If true, the infected human is symptomatic
 isolated?                ;; If true, an infected human will be isolated in quarantine
 severe?                  ;; If true, an infected human will have severe infection
 hospitalized?            ;; If true, the infected, symptomatic human will be hospitalized
 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
 infectious-period        ;; The time in days that humans will be infectious and can transmit the virus to others
]

patches-own
[
  high-touch-areas       ;; Patches contain high-touch-areas
   ]

;;;
;;; SLIDERS AND SWITCHES
;;;

;;; INITIAL-POPULATION (100 – 1000): Initial number of humans
;;; INITIAL-INFECTED (1 – 10): Initial number of infected humans
;;; INITIAL-RECOVERED (0 - 5): Initial number of recovered humans
;;; SYMPTOMATIC (10 - 100): Percentage of infected humans who will be symptomatic
;;; RISK-GROUP-PROPORTION (0 - 1): Proportion of humans in risk group (ex: elderly, underlying medical condition)
;;; TRANSMISSION-RATE (0.01 – 1): Probability that an infected human will infect a susceptible human
;;; RECOVERY-TIME (7 – 30): Average time in days for humans to recover
;;; BARRIERS-TO-HEALTHCARE (0 - 1): Ability to access hospital, where 0 = complete access and 1 = no access
;;; HEALTHCARE-QUALITY (0 - 1): Quality of healthcare, from poor = 0 to excellent = 1
;;; HOSPITAL-CAPACITY (5 - 20): Maximum number of patients in the hospital simultaneously
;;; DAYS-TO-START-CONTROL-MEASURES (1 - 60): Time in days to start control measures
;;; PROTECTION-LEVEL (0 – 1): Degree of the effectiveness of control measures adopted by the population
;;; FOLLOWING-MEASURES-PROPORTION (0 - 1): Proportion of the population following control measures
;;; MOBILITY (0-1): Distance humans move, where 0 = no movement and 1 = maximum movement
;;; INFECTED-DETECTION (0.01 - 10): Daily percentage of detection and isolation of infected humans
;;; ISOLATE-INFECTED? (switch): When ‘ON’, specified percentage of infected humans will be identified and isolated in quarantine
;;; HIGH-TOUCH-AREAS? (switch): When 'ON', randomized clusters of high-touch areas (in white) will appear in the interaction-zone
;;; DISINFECT? (switch): When 'ON' the probability of infection for a human in a high-touch-area is reduced

;;;
;;; SEED PROCEDURES
;;;

;; Use a seed created by the NEW-SEED reporter

to use-new-seed
  let my-seed new-seed            ;; generate a new seed
  output-print word "Generated seed: " my-seed  ;; print it out
  random-seed my-seed             ;; use the new seed
  reset-ticks
end 

;; Use a seed entered by the user

to use-seed-from-user
  loop [
    let my-seed user-input "Enter a random seed (an integer):"
    carefully [ set my-seed read-from-string my-seed ] [ ]
    ifelse is-number? my-seed and round my-seed = my-seed [
      random-seed my-seed ;; use the new seed
      output-print word "User-entered seed: " my-seed  ;; print it out
      reset-ticks
      stop
    ] [
      user-message "Please enter an integer."
    ]
  ]
end 

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

to clear
  clear-all
end 

to setup
  clear-globals
  clear-ticks
  clear-turtles
  clear-patches
  clear-drawing
  clear-all-plots
  setup-globals
  setup-humans
  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 ]

  ;; setup patches so that they aren't present without high-touch-areas on
  set num-clusters 2

  ask n-of num-clusters patches
  [
  if high-touch-areas?
  [ ask n-of 8 patches in-radius 2  ;; cluster 8 patches in interaction zone close to each other
    [
      set pcolor white      ;; color patches white - high-touch-areas represented
    ]
  ]
  ]

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

  ;; 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 at-capacity-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-humans
  ;; creating humans and moving them to interaction-zone patches
  create-humans initial-population
  [ask humans [move-to one-of interaction-zone]
   set shape "person"
   set size 0.5
   set susceptible? true
   set exposed? false
   set infected? false
   set recovered? false
   set deceased? false
   set protect? false
   set exposure-from-touch? false
   set symptomatic? false
   set isolated? false
   set severe? false
   set hospitalized? false
   set risk-population? false
   ]

   ;; selecting initial number of infected humans
   ask n-of initial-infected humans [
    set susceptible? false
    set infected? true
    set recovered? false]

    ;; selecting initial number of recovered humans
   ask n-of initial-recovered humans [
    set susceptible? false
    set infected? false
    set recovered? true]

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

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

  ask humans [assign-color]
end 

to assign-color  ;; The colors represent the status of the human
    if susceptible? [ set color blue ]
    if exposed? [ set color yellow ]
    if infected? [ set color red ]
    if recovered? [ set color green ]
    if deceased? [ set color black ]
end 


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

to go
  ask at-capacity-patch [ set plabel "" ]
  move-humans
  if all? humans [ not exposed? and not infected? ] [stop]  ;; stopping the simulation
  ask humans [touch-surface]
  ask humans with [exposed?] [become-infectious]
  ask humans with [infected?] [infect-others develop-symptoms]
  ask humans with [symptomatic?] [check-for-hospital go-to-hospital recover-or-die]

  set num-patients count turtles-on hospital
  if num-patients >= hospital-capacity [ask at-capacity-patch [ set plabel "AT CAPACITY" ]] ;; if the hospital has more patients than it can handle, the label "AT CAPACITY" will appear

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

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

  ask humans-on hospital [if recovered? [move-to one-of interaction-zone set hospitalized? false]] ;; humans who recovered at the hospital go back to interaction-zone
  ask humans-on hospital [if deceased? [move-to one-of interaction-zone set hospitalized? false]] ;; humans who died at the hospital go back to interaction-zone

  ask humans with [deceased?] [ set shape "dot"]

  calculate-r0
  tick
end 

;; Humans move around the world, but they don't move around in quarantine and in the hospital (i.e. movement is simply due to humans entering and exiting these regions, not humans within these regions moving)

to move-humans
  ask humans-on interaction-zone

  [ ifelse protect?

  [ if ticks < days-to-control-measures  ;; if human is protect? but control measures have not been implemented yet, human will move normally
   [rt random-float 360.0
    forward 1
    assign-color]
  if ticks >= days-to-control-measures  ;; if human is protect? and control measures have been implemented, human will alter movement according to mobility
  [rt random-float 360.0
    forward mobility
    assign-color]]

    [rt random-float 360.0 ;; if human is not protect? human will move unrestricted regardless of whether control measures have been implemented
    forward 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 

;; Infection can occur to humans who touch high-touch areas and aren't protecting themselves from exposure

to touch-surface
  let touching-humans (turtles-on patch-here)
  with [ not infected? and not recovered? ]

if pcolor = white

 [  ask touching-humans

   [ ifelse protect?

    ;; if human is taking measures to protect from exposure (ex: wearing gloves, not touching uncovered face)
    [  ifelse disinfect?
       [ if random-float 100 < 1     ;; 1% chance of exposure when touching surface with disinfection
         [ set susceptible? false
           set exposed? true
           set exposure-from-touch? true
         ]
       ]
       [ if random-float 100 < 5    ;; 5% chance of exposure when touching surface with no disinfection
          [ set susceptible? false
            set exposed? true
            set exposure-from-touch? true
         ]
       ]
     ]

    ;;if human is not taking measures to protect
    [  ifelse disinfect?
       [ if random-float 100 < 5     ;; 5% chance of exposure when touching surface with disinfection
         [ set susceptible? false
           set exposed? true
           set exposure-from-touch? true
         ]
       ]
       [ if random-float 100 < 20    ;; 20% chance of exposure when touching surface with no disinfection
          [ set susceptible? false
            set exposed? true
            set exposure-from-touch? true
         ]
       ]
     ]
  ]
 ]
end 

;; A human who has been exposed the virus will become infectious after the latent period

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

;; Infected humans can infect susceptible ones

to infect-others
 ;; selecting a susceptible target in neighbor patches
 let nearby-target (humans-on neighbors)
 let nearby-host one-of (nearby-target 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 nearby-host != nobody [
  ifelse not protect? [
   if random-float 1 < transmission-rate [
    ask nearby-host [
      set susceptible? false
      set exposed? true ]
    ] ]
      [ if ticks < days-to-control-measures [
      if random-float 1 < transmission-rate [
      ask nearby-host [
      set susceptible? false
      set exposed? true ]
      ] ]
      if ticks >= days-to-control-measures [
      if random-float 1 < (transmission-rate * (1 - protection-level)) [
      ask nearby-host [
      set susceptible? false
      set exposed? true ]
      ] ]
  ] ]
end 

;; A given proportion of infected humans will become symptomatic

to develop-symptoms
  set infectious-period infectious-period + 1

  ;; considering that the first symptoms may appear 2 days after the virus latent period, incubation period will be 5 days on average
  if infectious-period = 2 [
  if random 100 < symptomatic [
    set symptomatic? true
    set count-symptomatic  count-symptomatic + 1 ]]


  ;; asymptomatic humans become recovered after recovery time
    if infectious-period = recovery-time and not symptomatic? [
      set infected? false
      set recovered? true
      set deceased? false
      ]
end 

;; Check if symptomatic humans need a hospital

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

;; If hospital is not at capacity and can travel to hospital (take into account barriers to health), go to it

to go-to-hospital
   set num-patients count turtles-on hospital
   if num-patients < hospital-capacity * (1 - barriers-to-healthcare)
    [ move-to one-of hospital
      set hospitalized? true]
end 

;; Symptomatic humans may recover from illness or die
;; This will depend on the severity of the case, whether or not the person is hospitalized, and whether or not he belongs to the risk group

to recover-or-die
  if severe?
  [
  ifelse not hospitalized?
    [
   if infectious-period >= random-poisson recovery-time * 2  ;; severe cases will take twice as long to recover
      [
     if risk-population?
        [
       ifelse random 100 < random-poisson 20 [    ;;people in the risk group with severe infection who are not hospitalized have an average 20% chance of surviving
        set infected? false
        set symptomatic? false
        set severe? false
        set recovered? true]
       [ set deceased? true ]]
     if not risk-population?
        [
       ifelse random 100 < random-poisson 60  [   ;;people not in the risk group with severe infection who are not hospitalized have an average 60% chance of surviving
        set infected? false
        set symptomatic? false
        set severe? false
        set recovered? true]
        [ set deceased? true ]]]]

  [if infectious-period >= random-poisson recovery-time * 1.5
      [
    if risk-population?
        [
       ifelse random 100 < (100 - random-poisson 7) * healthcare-quality ;; people in the risk group who are hospitalized have an average 93% chance of surviving (assuming full healthcare quality)
          [
       set infected? false
       set symptomatic? false
       set severe? false
       set recovered? true]
       [ set deceased? true ]]
    if not risk-population?
        [
       ifelse random 100 < (100 - random-poisson 1) * healthcare-quality   ;; people not in the risk group who are hospitalized have an average 99% chance of surviving (assuming full healthcare quality)
          [
       set infected? false
       set symptomatic? false
       set severe? false
       set recovered? true]
       [ set deceased? true ]]]]]

  if not severe?  ;; infected, symptomatic people who do not need a hospital will always recover from infection
  [
    if infectious-period >= random-poisson recovery-time
    [
      set infected? false
      set symptomatic? false
      set recovered? true
       ]]
end 

;; This R0 is a numerical estimate of the basic reproduction number, as proposed by Uri Wilensky (see epiDEM basic and epiDEM travel and control)

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

  if ((initial-population - 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-population - count turtles with [ susceptible? ]))
    set r0 r0 * s0 ]
end 

;;;
;;; TO REPORT PROCEDURES
;;;

to-report num-susceptible
  report (count turtles with [susceptible?])
end 

to-report num-exposed
  report (count turtles with [exposed?])
end 

to-report num-infected
  report (count turtles with [infected?])
end 

to-report num-recovered
  report (count turtles with [recovered? and not deceased?])
end 

to-report num-deceased
  report (count turtles with [deceased?])
end 

to-report total-mortality
  report ((count turtles with [deceased?]) / initial-population) * 100
end 

to-report infected-mortality
  report ((count turtles with [deceased?]) / (initial-population - count turtles with [susceptible?])) * 100
end 

to-report symptomatic-mortality
  report ((count turtles with [deceased?]) / count-symptomatic) * 100
end 

to-report infected-from-touch
  report (count turtles with [exposure-from-touch?])
end 

There is only one version of this model, created over 4 years ago by Lorena Morejon.

Attached files

File Type Description Last updated
COVID-19 SEIR-D Model Paper.pdf pdf An Agent-Based SEIR-D Model of COVID-19: Effects of Risk Factors and Control Measures Relevant to Farmworker Communities over 4 years ago, by Lorena Morejon Download
COVID-19 SEIRD Farmworkers.png preview Preview for 'COVID-19 SEIRD Farmworkers' over 4 years ago, by Lorena Morejon Download
COVID-19 SEIRD PowerPoint Presentation.pdf pdf Powerpoint Presentation over 4 years ago, by Lorena Morejon Download

This model does not have any ancestors.

This model does not have any descendants.