Infectious Disease Outbreak (COVID-19)

Infectious Disease Outbreak (COVID-19) preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)



Tagged by lin xiang 6 months ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.0 • Viewed 685 times • Downloaded 8 times • Run 0 times
Download the 'Infectious Disease Outbreak (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.)


This model simulates the infectious disease outbreak dynamics, such as COVID-19, related to the factors of population density, transmission rate, mortality rate, and individual mobility in two populations. It can be used to compare various infectious disease outbreak scenarios, such as outbreaks in a bigger or smaller city, grounding, different levels of transmission rate, etc.


The model starts with two isolated human populations in which all people are healthy but susceptible (green color) to the incoming pathogen. Once an infected case (orange color) appears in the population, it will pass the disease to one of the susceptible people nearby (within a radius of 1.5) at the defined transmission rate. The infected people are able to transmit the disease for 14 days. By the 15th day of being infected, the people either die (disappears from the model) at the defined mortality rate, or recover and become immunized (blue color).


  1. The left and right populations can be set as different sizes using the sliders. Given they occupy the same size of the area, the larger is the population size, the higher is the population density.

  2. The mobility of the left and right populations can be set differently to simulate the self-isolating or a rough social distancing in the two populations .

  3. The transmission rate and mortality equally apply to the people in both populations.

  4. Each tick in the model is regarded as a day. The model is initially set to stop on the 180th day. Change the number in "Time" if you want to run the model for a longer or shorter time.

  5. Use the button "Watch an infected person" to follow an infected person.

  6. Use the button "Add/Remove Divider" to separate or connect two populations.

  7. Use the button "run one day" to run the model for only one tick. This button is useful for examining the dynamic in a controlled way and collecting day-by-day data.


There are so many things you can try in this model. Here are only very a few quick ideas:

  1. Can you use the model to simulate the outbreak in a bigger city, a smaller town, a rural area? How fast the disease spread in these places?

  2. Can you use the model to simulate the disease caused by a pathogen that is highly infectious and very deadly, moderate infectious but not very deadly, or other combinations of these two factors?

  3. How will the disease spreading be affected when mobility is decreased, for example, conduct self-isolating, play social distancing?

  4. When can you get a flat but longer-lasting curve? What does it mean for a community?

  5. Before we get an effective vaccine or medicine for the pathogen, how can we minimize the number of deceased individuals in this model?


Find this model series at

  • Infectious Disease Outbreak-Basic Phenomenon
  • Infectious Disease Outbreak-Transmission and mortality
  • Infectious Disease Outbreak-Population Comparison
  • Infectious Disease Outbreak-HealthCare, Isolation and Quarantine
  • Infectious Disease Outbreak-Vaccination


Dr. Lin Xiang creates this module at the University of Kentucky in 2020. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2020). Infectious Disease Outbreak-Population Comparison. Department of STEM Education, University of Kentucky, Lexington, KY.

Comments and Questions

Good Model

The idea of splitting the model to show two parallel populations is a very good idea. It helps in a way to treat the model as a controlled experiment, with policies implemented on one side and without policies on the other side. Presently you have considered only one policy option which is restriction on mobility. You may also consider quarantine and isolation as additional policy options. Best,

Posted 6 months ago


Yes, we do a series of six models of COVID-19. One of them shows quarantine and isolation at here

Posted 5 months ago

Click to Run Model

Globals [RM LM current-distance]

to-report divider   ;label the divider patches
  report patches with [ abs pxcor <= 1 and abs pycor < max-pycor]

to-report left-population     ;call all the turtles at the left
  report turtles with [xcor <= 0]

to-report right-population     ;call all the turtles at the right
  report turtles with [xcor > 0]

;;;;;;;;;;;;;;;;;;;;main setup procedures;;;;;;;;;;;;;;

to setup

to setup-patches

  ask patches with [ abs pxcor = max-pxcor ] [set pcolor 116]   ;setup boundary
  ask patches with [ abs pycor = max-pycor ] [set pcolor 116]   ;setup boundary
  ask divider  [set pcolor 47]    ;set divider

to setup-turtles
  create-turtles Right-population-size         ;set up the right population
  [set color 68
    set size 1.75
    set shape "person"
    setxy 2 + random-float 43 25 - random-float 50   ;randomize turtle positions at right

  create-turtles Left-population-size         ;set up the left population
  [set color 68
    set size 1.75
    set shape "person"
    setxy (-1) * (2 + random-float 43) 25 - random-float 50   ;randomize turtle positions at left

;;;;;;;;;;;;;;;;;;;;main go procedures;;;;;;;;;;;;;;

to go

  if ticks >= time [stop]

  ask turtles with [pcolor = 47][set xcor xcor * 5]


to move
  ask left-population     ;control turtles' movement at the left
  [ifelse [pcolor] of patch-ahead 1 = 0 [forward Mobility-left rt random 360] [set heading heading - random 180]]

   ask right-population        ;control turtles' movement at the right
  [ifelse [pcolor] of patch-ahead 1 = 0 [forward Mobility-right rt random 360] [set heading heading - random 180]]

to add-an-infected-person-at-left
  create-turtles 1
  [set size 1.75
    set shape "person"
    set color orange
    setxy (-1) * (1 + random-float 39) 24 - random-float 47]

to add-an-infected-person-at-right
  create-turtles 1
  [set size 1.75
    set shape "person"
    set color orange
    setxy 1 + random-float 39 24 - random-float 47]

to transmission       ;set up transmission
  ask turtles with [color = orange]
  [let healthy-person one-of other turtles in-radius 1.5 with [color = 68]
    if healthy-person != nobody
    [ask healthy-person [
      if random 100 < Transmission-rate
      [set color orange]]]

to sickness     ;set up recovery or death
  ask turtles with [color = orange]
  [set days days + 1
    if days >= 15
    [ifelse random 100 < mortality
      [ifelse xcor >= 0 [set RM RM + 1][set LM LM + 1] die  ]
      [set color blue] ]

to watch-a-sick-person
  watch one-of turtles with [color = orange]

There are 4 versions of this model.

Uploaded by When Description Download
lin xiang 6 months ago fix formatting Download this version
lin xiang 6 months ago Include the model in the model series Download this version
lin xiang 6 months ago Add some clarifications Download this version
lin xiang 6 months ago Initial upload Download this version

Attached files

File Type Description Last updated
Infectious Disease Outbreak (COVID-19).png preview Preview for 'Infectious Disease Outbreak (COVID-19)' 6 months ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.