Disease, Social Distancing, Economic Impact

Disease, Social Distancing, Economic Impact preview image

1 collaborator

Default-person Alex Brown (Author)

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 637 times • Downloaded 69 times • Run 0 times
Download the 'Disease, Social Distancing, Economic Impact' 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?

A model of an infectious disease within a community.

People move about randomly, and if they run into a person who is sick, they have a chance of getting sick themselves. The illness runs on average two weeks, and has a 2% death rate. These processes are all stochastic, so somebody could die on day 2 of the illness, or could have it for a month

Here is what makes this model unique:

I have seen a couple of models online which illustrate the effects of social distancing on the spread of a disease, but they typically did this by social distancing the entire population, which to me seems like a bit of an unnecessary oversimplification. For this model, I'm interested in breaking down social distancing into two of its components: 1. How many people are distancing? Is it half the population? 75%? 10%? 2. How aggressively are they distancing? Are they literally staying in one place? or are they just being more cautious, going out less?

This model allows us to explore how varying 1 and 2 affect the outcome of the entire community. Is social distancing useless unless most people do it? Is social distancing useless unless it's extreme? Can we effect a meaningful change in outcome by having only a small proportion of citizens social distance?

Additionally, for fun, I've included the variable "economic output", which measures, in an incredibly simplistic way, the productivity of our little society. Essentially, the productivity of [healthy person who isn't distancing] > [healthy person who is distancing] > [sick person] > [dead person].

I think this is an interesting variable because it shows how a preemptive decrease in productivity (by increasing the proportion of people social distancing), can increase the aggregate productivity of the economy over the course of the disease when compared to a society that took less extreme preventative measures.

HOW IT WORKS

&&

HOW TO USE IT

(what rules the agents use to create the overall behavior of the model)

I'll go through the variables and what is a good range for them to be set at:

num-people = This is the number of total people in the community, for this size grid, I think 500 is a decent starting point. Less people -> disease has harder time spreading, more people -> disease spreads more easily

init-infected = This is how many initial cases the community has. You can set it as low as you want

Transmissibiity = if a healthy person runs into a sick person, what proportion of the time do they get sick? This number seems to actually be pretty high for COVID, so I've been setting it between .4 and 1.

num-people-social-distancing = of the total number of people, how many of them are socially distancing? Play around with this one, you start to be able to really see the impact once it's over 60% of the population. Also try it with zero! REMEMBER: this number must be lower than num-people

sociability-of-non-distancers = how much do non social distancers move around? The higher this number, the larger their movements. Try different numbers for this.

sociability-of-distancers = how much do social distancers move around? This number should be pretty low, I think generally, below 1. Play around with it, but just remember that it should be lower than sociability-of-non-distancers.

NOTE: the sociability of an individual does not change if he becomes infected. Distancers will continue to distance even if they become infected, but they will change color to red. HOWEVER, people do not continue to social distance if they become immune (this only affects the economic output)

Once there are no more active infections in the community, people stop social distancing.

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

To begin building this, I modified code for an SIR model by Paul Smaldino

Comments and Questions

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

Click to Run Model



globals [max-infected
  cumulative-output]


turtles-own[
  infected?
  immune?
  distanced?
  dead?
]

to setup
  clear-all
  setup-turtles
  setup-infected
  setup-distancers
  set max-infected (count turtles with [infected?])
  set cumulative-output (0)
  reset-ticks
end 

to setup-turtles
  create-turtles num-people [
    set color white
    set shape "person"
    set size 2
    set infected? false
    set immune? false
    set distanced? false
    set dead? false
    setxy random-pxcor random-pycor
  ]
end 

to setup-distancers
  ask n-of num-people-distancing turtles [
    set color blue
    set distanced? true
  ]
end 

to setup-infected
  ask n-of init-infected turtles [
   set color red
   set infected? true
  ]
end 

to go
  ;;stop if everyone or noone is infected
  ;;if (count turtles with [infected? and not dead?] = 0)
  ;;or (count turtles with [infected?] = num-people)
  if (ticks > 365)
  [stop]

  infect-susceptibles
  recover-infected
  death
  recolor
  move-normal
  move-distancers
  calculate-max-infected
  calculalate-cumulative-output
  tick

  ;;  sociability-of-non-distancers / Sociability-of-Distancers

  repeat ( 1 ) [
  infect-susceptibles
  recover-infected
  death
  recolor
  move-normal
  calculate-max-infected
  calculalate-cumulative-output
  tick
  ]
end 

to infect-susceptibles ;; S -> I
  ask turtles [
    let infected-neighbors (count other turtles with [color = red] in-radius 2)
    if (random-float 1 <  1 - (((1 - transmissibility) ^ infected-neighbors)) and not immune?)
    [set infected? true]
  ]
end 

to recolor
  ask turtles with [infected? and not dead?]
  [ set color red]
end 

to move-normal

  ask turtles with [not dead? and not distanced?] [
    right random 360 ;;get a new random heading
    forward  sociability-of-non-distancers
  ]
end 

to move-distancers
  ask turtles with [distanced? and not dead?][
    right random 360
    forward Sociability-of-Distancers
  ]
  ask turtles with [dead?][

    forward 0
  ]
end 

to recover-infected ;;I -> R

  ;;avg case length is 2 weeks.
  ;;should have 50% chance of becoming immune at 2 weeks
  ;;if we are saying each tick equals 1 day,
  ;;daily odds of recovering should be (1-x)^14=.5, x= 0.0483


  ask turtles with [infected? and not dead?]
  [
    if random-float 1 < 0.0483
    [
      set infected? false
      ifelse are-survivors-immune?
      [
        set immune? true
        set color gray
        set distanced? false
      ]
      [
        set color white
      ]
    ]
  ]
end 

to death
  ;;avg case length is 2 weeks.
  ;;2% of infected die,
  ;;if we are saying each tick equals 1 day,
  ;;and 2% of sick patients should be dead at 2 weeks
  ;;daily mortality should be (1-x)^14=.98, x= 0.00144201
  ask turtles with [infected?]
  [
    if random-float 1 < 0.00144201
    [set dead? true
    set color pink
    ]
  ]
end 

to calculate-max-infected
  let x (count turtles with [infected? and not dead?])
  if x > max-infected
  [set max-infected x]
  if x = 0
  [ask turtles with [distanced?][
    set distanced? false
    set color white
    ]
  ]
end 

to calculalate-cumulative-output
  let y ((count turtles with [infected? and not dead?] * .5) + (count turtles with [not infected? and not distanced?] * 2) + (count turtles with [not infected? and distanced?]))
  set cumulative-output (cumulative-output + y)
end 

to-report total-adjusted-output
  report cumulative-output / (num-people * 2 * (ticks + 1))
end 

to-report calculate-daily-output
  report (((count turtles with [infected? and not dead?] * -1) + (count turtles with [dead?] * -5) + (count turtles with [not infected? and not distanced?] * 2) + (count turtles with [not infected? and distanced?] * 1.5)) / (num-people * 2))
end 

to-report max-infected-prop
  report max-infected / num-people
end 

to-report prop-dead
  let y (count turtles with [dead?])
  report y / num-people
end 

to-report prop-uninfected
  report (count turtles with [not infected? and not immune?]) / num-people
end 

There are 2 versions of this model.

Uploaded by When Description Download
Alex Brown over 5 years ago People stop distancing once nobody is sick Download this version
Alex Brown over 5 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Disease, Social Distancing, Economic Impact.png preview The Curve over 5 years ago, by Alex Brown Download

This model does not have any ancestors.

This model does not have any descendants.