Infectious Disease Outbreak (COVID-19)--HealthCare, Isolation and Quarantine

Infectious Disease Outbreak (COVID-19)--HealthCare, Isolation and Quarantine preview image

1 collaborator

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

Tags

covid19 

Tagged by lin xiang almost 5 years ago

quarantine 

Tagged by lin xiang almost 4 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 705 times • Downloaded 39 times • Run 0 times
Download the 'Infectious Disease Outbreak (COVID-19)--HealthCare, Isolation and Quarantine' modelDownload this modelEmbed this model

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


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: lin.xiang@uky.edu
;;
;; 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[day infected susceptible hospitalized symptom]
Globals [RM LM num-beds x y max-daily-cases]
breed [persons person]
breed [doctors doctor]

to-report hospital   ;label the divider patches
  report patches with [ pycor < max-pycor and pycor > 16 and pxcor > min-pxcor and pxcor < max-pxcor]
end 

to-report susceptible-people     ;call all suscepitble people
  report turtles with [infected = false and susceptible = true and symptom = false and hospitalized = false]
end 

to-report carriers   ;call all people who are infected but have not shown symptoms
  report turtles with [infected = true and susceptible = false and symptom = false and hospitalized = false]
end 

to-report infected-with-symptom   ;call all people who are infected and have shown symptoms
  report turtles with [infected = true and susceptible = false and symptom = true]
end 

to-report patients   ;call all people who are infected and have shown symptoms and have been hospitalized
  report turtles with [infected = true and susceptible = false and symptom = true and hospitalized = true]
end 

to-report current-patients
  report count patients
end 

to-report recovered-people   ;call all people who have recovered
  report turtles with [infected = false and susceptible = false and symptom = false]
end 

to-report available-beds ; availble inpatient beds
  report num-beds - count persons with [pcolor = 9.9]
end 


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

to setup
  clear-all
  setup-patches
  setup-turtles
  reset-ticks
end 

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 patches with [ pycor = 16 ] [set pcolor 116]  ;setup boundary
  ask hospital  [set pcolor 9.9]    ;set hospital area
end 

to setup-turtles

  create-persons Population-size
  [set color 68
    set size 1.75
    set shape "person-1"
    set day 0
    set infected false
    set susceptible true
    set hospitalized false
    set symptom false
    set-position
  ]

 set num-beds Population-size * 0.05
  set x -21
  set y 18

   create-doctors 1
  [ set color 37
    set size 3
    set shape "person doctor"
    setxy 22.5 26.5
  ]
end 

to set-position  ;set people position
  setxy random-xcor random-ycor
  if pcolor != 0 [set-position]
end 

to set-beds   ;set hispital bed positions
   setxy x y
   if any? other turtles-here [
    (ifelse
      x < 21 [set x x + 3]
      x = 21 [set x -21 set y y + 3])
      set-beds]

   set x -21
   set y 18
end 

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

to go

  if ticks >= Days [stop]

  move
  transmission
  sickness
  isolation
  ifelse Hospitalization? [hospitalization-recovery-death][recovery-death]
  find-max-daily-cases
  tick
end 

to move
  ask persons with [hospitalized = false and shape = "person-1"]    ;Keep patients and isolated people from moving
  [ifelse [pcolor] of patch-ahead 1 = 0 [forward Mobility rt random 360] [set heading heading - random 180]]
end 

to add-a-carrier
  create-persons 1
  [set size 1.75
    set shape "person-1"
    set color 68
    set infected true
    set susceptible false
    set symptom false
    set hospitalized false
    set-position]
end 

to transmission       ;set up transmission
  ask persons with [infected = true and shape = "person-1"]  ;shape of "person" excludes the isolated carriers
  [let healthy-person one-of other turtles in-radius 1.5 with [susceptible = true]
    if healthy-person != nobody
    [ask healthy-person [
      if random 100 < 90  ;transimission rate is 90%
      [set infected true set susceptible false set symptom false]]]  ;susceptible people first become carriers.
  ]
end 

to sickness     ;process of developing symptoms
  ask persons with [infected = true]
  [
    ifelse Show-carriers? = true    ;allow switch to show and hide carriers
    [ifelse symptom = false [set color gray][set color orange]]
    [ifelse symptom = false [set color 68][set color orange]]

    set day day + 1  ;accumulate days
    if random 100 < (10 * day - 30) [set symptom true set color orange]   ; The infected people show symptoms after 3 days and the chance increase 10% every day after.

  ]
end 

to watch-a-sick-person ; can be either a carrier or a sick person
  watch one-of persons with [infected = true]
end 

to hospitalization-recovery-death
  ask persons with [infected = true and symptom = true]  ; call sick people
  [if available-beds > 0 [
    set shape "patient"
    set hospitalized true
    set-beds]

  if day >= 15
    [ifelse hospitalized = true
      [ifelse random 100 < 20 * 0.5
          [set LM LM + 1 die  ]
          [set infected false set hospitalized false set susceptible false set symptom false set color blue set shape "person-1" set-position]]
      [ifelse random 100 < 20
          [set LM LM + 1 die  ]
          [set infected false set hospitalized false set susceptible false set symptom false set color blue set shape "person-1" set-position]]
      ]
  ]
end 

to recovery-death
   ask persons with [infected = true and symptom = true]
     [if day >= 15
      [ifelse random 100 < 20
          [set LM LM + 1 die  ]
          [set infected false set hospitalized false set susceptible false set symptom false set color blue set shape "person-1" set-position]]
      ]
end 

to isolation
  ask persons with [infected = true and symptom = true and hospitalized = false]
      [if random 100 < %-isolated [set shape "house"]]
  ask carriers
      [if random 100 < %-quarantined [set shape "house"]]
end 

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
end 

There are 6 versions of this model.

Uploaded by When Description Download
lin xiang almost 3 years ago Minor adjustment Download this version
lin xiang almost 3 years ago fix typos Download this version
lin xiang over 3 years ago Fix info typos Download this version
lin xiang almost 4 years ago Add in max daily cases Download this version
lin xiang almost 5 years ago Fix the info Download this version
lin xiang almost 5 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Infectious Disease Outbreak (COVID-19)--HealthCare, Isolation and Quarantine.png preview Preview for 'Infectious Disease Outbreak (COVID-19)--HealthCare, Isolation and Quarantine' almost 5 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.