Infectious Disease Outbreak (COVID-19)-Social Distancing

Infectious Disease Outbreak (COVID-19)-Social Distancing preview image

1 collaborator

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


Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 170 times • Downloaded 4 times • Run 0 times
Download the 'Infectious Disease Outbreak (COVID-19)-Social Distancing' 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 impact of social distancing (SD) on infectious disease outbreak dynamics in a population. In particular, it allows users to explore the effects of different social distancing spaces and the percentage of people who practice SD on the infectious disease outbreak dynamics.


The model starts with a human population of 600 persons in which one person (orange color) is infected and the rest of the people are susceptible (green color). The infected case passes the disease to one of the susceptible people within a radius of 1.5 at a transmission rate of 90%. The infected people are able to transmit the disease for 14 days. By the 15th day of being infected, the infected people either die (disappear from the model) at a mortality of 20% or recover and become immunized (blue color).

Buttons, Sliders, and Switches:

  • The "Set up/Reset" button is self-explanatory. So are the buttons of "Run/Pause" and "Run a day".

  • The "Watch 1 Infected Case" button allows you to focus on a single infected person. You may see this person eventually recover or die.

  • The slider "social distancing" determines the space that people need to maintain when practicing SD. People do not practice social distancing when "social distancing" is 0.0. When "social distancing" is greater than 0, people who practice SD maintain a corresponding distance from another person, if possible.

  • The slider "%-People-practicing-SD" determines the likelihood that people practice SD. No one practices SD when "%-People-practicing-SD" is 0.0.


  1. First choose the desired value for "social distancing" and "%-People-practicing-SD".

  2. Click on "Set up/Reset", then "Run/Pause".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.

  3. Observe the infection changes in the population in the plot and monitors.

  4. Use "Run one day" to run the model 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 to explore:

  1. How far should people stay away from each other to decrease infection if the disease is passed to other people within a radius of 1.5?

  2. How many percents of people should practice social distancing to significantly flatten the infection curve?


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-Social Distancing
  • Infectious Disease Outbreak-Vaccination


Dr. Lin Xiang ( created 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-Social Distancing. Department of STEM Education, University of Kentucky, Lexington, KY.

Comments and Questions

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

Click to Run Model

;; This model is developed by Dr. Lin Xiang at the University of Kentucky. Contact:
;; If you see this page rather than a "download" button when downloading the model, click the "download" icon
;; in your browser to download this model file.

turtles-own [days]
globals [LM max-daily-cases]

to-report sick-time
  report round days / 30

to setup
  crt 600
  [set color 55

  ask one-of turtles
  [set color 25]

  set LM 0


to go
  if ticks > time * 10  [stop]

to social-ditancing
  ask turtles [
    ifelse random 100 < %-People-practicing-SD
    [ifelse any? other turtles in-cone Social-distancing 180
    [rt random-float 360]
      [fd 0.1]]
    [fd 0.1]

to add-1-case
  crt 1
  [set color 25

to transmission
  ask turtles with [color = 25]
  [let healthy-perosn one-of other turtles with [color = 55] in-radius 1.5
    if healthy-perosn != nobody
    [ask healthy-perosn
      [if random 100 < 90 [set color 25]]

to sickness
  ask turtles with [color = 25]
  [ set days days + 1
    if  days  >= 150
    [ifelse random 100 < 20
      [set LM LM + 1  die]
      [set color blue]]

to set-turtles
    set shape "person-1"
    set size 1.75
    set days 0
    setxy random-xcor random-ycor

to find-max-daily-cases
  if count turtles with [color = orange ] > max-daily-cases        ;Count the infectious. If it is greater than the current record of max daily cases
  [set max-daily-cases count turtles with [color = orange ]]       ;update the max daily case

There are 6 versions of this model.

Uploaded by When Description Download
lin xiang 13 days ago Add in max daily cases Download this version
lin xiang 11 months ago Fix time Download this version
lin xiang 11 months ago Add in both social distancing space and percentage of people who practice social distancing. Download this version
lin xiang 11 months ago Adjust the agent speed Download this version
lin xiang 11 months ago Adjust the speed Download this version
lin xiang 11 months ago Initial upload Download this version

Attached files

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

This model does not have any ancestors.

This model does not have any descendants.