SEIR-Model-Antivirals

No preview image

4 collaborators

Default-person Anna Mummert (Author)
Roger Estep (Team member)
Robert Hughes (Team member)
Jessica Shiltz (Team member)

Tags

antivirals 

Tagged by Anna Mummert over 8 years ago

disease control 

Tagged by Anna Mummert over 8 years ago

gamma distribution 

Tagged by Anna Mummert over 8 years ago

gamma distributionA 

Tagged by Anna Mummert over 8 years ago

gamma distributionB 

Tagged by Anna Mummert over 8 years ago

gamma distributiond 

Tagged by Anna Mummert over 8 years ago

gamma distributiont 

Tagged by Anna Mummert over 8 years ago

infectious disease model 

Tagged by Anna Mummert over 8 years ago

seir model` 

Tagged by Anna Mummert over 8 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.4 • Viewed 3087 times • Downloaded 248 times • Run 0 times
Download the 'SEIR-Model-Antivirals' 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

Case Study "Modeling Seasonal Influenza"

This model is part of a suite of infectious disease models, including SEIR-Model-Base-Seasonal, SEIR-Model-Vaccination-Seasonal, SEIR-Model-Antivirals, SEIR-Model-Isolation, and SEIR-Model-Periodic-Transmission. These five models are part of the case study "Modeling Seasonal Influenza", 2016, by Marcia Harrison-Pitaniello, Jessica Shiltz, Rober Hughes, Roger Estep, and Anna Mummert published by the National Center for Case Study Teaching in Science (http://sciencecases.lib.buffalo.edu/cs/).

Posted over 8 years ago

Click to Run Model

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

globals 
[ 
  maximum-infectious           ;; The maximum number of infectious individuals at one simulation tick.  
  tick-at-maximum-infectious   ;; The first tick when the maximum number of infectious individuals is realized.  
  number-infectious-vector     ;; Vector of the number of infectious individuals at each simulation tick.  
  
  incubation-alpha             ;; Alpha parameter for the gamma distribution used in calculating incubation-time.
  incubation-lambda            ;; Lambda parameter for the gamma distribution used in calculating incubation-time.
  infectious-alpha             ;; Alpha parameter for the gamma distribution used in calculating infectious-time.
  infectious-lambda            ;; Lambda parameter for the gamma distribution used in calculating infectious-time.
  antiviral-effect-alpha       ;; Alpha parameter for the gamma distribution used in calculating antiviral-effect-time.
  antiviral-effect-lambda      ;; Lambda parameter for the gamma distribution used in calculating antiviral-effect-time.  
  
  number-vaccinated
]

turtles-own
[ 
  susceptible?                 ;; If true, the individual is a member of the susceptible class.  
  exposed?                     ;; If true, the individual is a member of the exposed (incubation) class.
  infectious?                  ;; If true, the individual is a member of the infectious class.
  recovered?                   ;; If true, the individual is a member of the recovered class.
  antiviral-treated?           ;; If true, the individual has received the antiviral.  
  
  incubation-length            ;; How long the individual has been in the exposed class, increasing by 1 each tick. This is compared against the incubation-time, selected from a gamma-distribution.
  incubation-time              ;; The randomly chosen gamma-distribution value for how long the individual will be in the exposed class.
  infectious-length            ;; How long the individual has been in the infectious class, increasing by 1 each tick. This is compared against the infectious-time, selected from a gamma-distribution.
  infectious-time              ;; The randomly chosen gamma-distribution value for how long the individual will be in the infectious class.
  antiviral-effect-time        ;; The randomly chosen gamma-distribution value for the benefit, in reduced days of infectiousness, of receiving the antiviral.
  
  total-contacts               ;; A count of all contacts of the individual.
]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Setup Procedures ;;;;

to setup
  clear-all
  setup-gamma-distributions
  setup-population
  reset-ticks 
end 

to setup-gamma-distributions            ;; The calculation from mean and standard deviation (in days) to the alpha and lambda parameters required for the gamma-distributions (in ticks).  
  set incubation-alpha (average-incubation-period * ticks-per-day)^ 2 / (incubation-standard-deviation * ticks-per-day)^ 2    
  set incubation-lambda (average-incubation-period * ticks-per-day) / (incubation-standard-deviation * ticks-per-day)^ 2      
  set infectious-alpha (average-infectious-period * ticks-per-day)^ 2 / (infectious-standard-deviation * ticks-per-day)^ 2    
  set infectious-lambda (average-infectious-period * ticks-per-day) / (infectious-standard-deviation * ticks-per-day)^ 2   
  set antiviral-effect-alpha (average-antiviral-effect-period * ticks-per-day)^ 2 / (antiviral-effect-standard-deviation * ticks-per-day)^ 2    
  set antiviral-effect-lambda (average-antiviral-effect-period * ticks-per-day) / (antiviral-effect-standard-deviation * ticks-per-day)^ 2      
end 

to setup-population
  create-turtles initial-population   
  [
    setxy random-xcor random-ycor       ;; All individuals are placed on random patches in the world.
    
    set susceptible? true               ;; All individuals are set as susceptible.
    set exposed? false      
    set infectious? false       
    set recovered? false   
    set antiviral-treated? false      
     
    set shape "person"
    
    set total-contacts 0
    
    ask turtle 0                        ;; Individual 0 begins as infectious.  Its infectious-time is selected from the gamma distribution and infectious-length set to 0.  
    [
      set susceptible? false
      set infectious? true
      set infectious-time random-gamma infectious-alpha infectious-lambda
      set infectious-length 0
    ]
    
   set number-infectious-vector [ 1 ]   ;; The number-infectious-vector vector is initiallized.  
   set number-vaccinated 0
   assign-color
  ]
end 

to assign-color
  if susceptible?
    [ set color white ]
  if exposed?
    [ set color yellow ]
  if infectious?           
    [ set color red ]      
  if recovered?            
    [ set color lime ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Go Procedure ;;;;

to go
  if all? turtles [ susceptible? or recovered? ]          ;; The simulation ends when no individuals are infected (exposed or infectious).  
    [ stop ]                                                                                 
  
  ask turtles                                                                        
    [ move ]
    
  ask turtles with [ infectious? ]                        ;; Infectious individuals might expose susceptible neighbors.  If infectious individuals have been infectious for infectious-time ticks, they will recover. 
    [ expose-neighbors 
      chance-of-recovery ]                              
  
  ask turtles with [ infectious? ]                        ;; Some infectious individuals are given the antiviral.  
    [ chance-of-receiving-antiviral ] 
       
  ask turtles with [ exposed? ]                           ;; If exposed individuals have been in the exposed class for incubation-time ticks, they will become infectious.
    [ chance-of-becoming-infectious ]  
     
  ask turtles 
    [ assign-color 
      count-contacts ]

  compute-maximum-infectious  
  
  tick
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Nested Functions ;;;;

to move                                                                                         ;; Individuals turn a random angle between -40 and 40 degrees then step forward 1 unit.  
  right (random 80) - 40
  forward 1
  if not can-move? 1 [ right 180 ]                                                              ;; If an individual is at the world's boundary, it turns around.
end 

to count-contacts                                                                               ;; Contacts are defined as other individuals within a 1 unit radius.  
  set total-contacts total-contacts + count other turtles in-radius 1
end 

to expose-neighbors
  ask other turtles in-radius 1 with [ susceptible? ]                                           ;; Susceptible individuals who come into contact with an infectious individual will become infected with probability transmission-chance.
    [ 
      if random-float 100 < transmission-chance                                            
        [ 
          set susceptible? false  
          set exposed? true                                                                   
          set incubation-time random-gamma incubation-alpha incubation-lambda                   ;; A newly exposed individual selects an incubation-time from the gamma-distribution and its incubation-length is set to 0.          
          set incubation-length 0                                                          
        ]             
    ]                                                              
end       

to chance-of-becoming-infectious                                                                ;; When an infected individual has been in the exposed class longer than its incubation-time, it will become infectious.  
  set incubation-length incubation-length + 1
  if incubation-length > incubation-time                                     
  [                                                                          
    set exposed? false
    set infectious? true                                                      
    set infectious-time random-gamma infectious-alpha infectious-lambda                         ;; A newly infectious individual selects an infectious-time from the gamma-distribution and its infection-length is set to 0.
    set infectious-length 0                                                 
  ]
end 

to chance-of-recovery                                                                           ;; When an infectious individual has been in the infectious class longer than its infection-time, it will recover.
  set infectious-length infectious-length + 1
  if infectious-length > infectious-time                                     
  [                                                                          
    set infectious? false
    set recovered? true
  ]
end 

to chance-of-receiving-antiviral                                                                ;; Once each day, infectious individuals who have not been infectious too long will receive the antiviral with probability antiviral-treatment-chance. 
  if ( ticks / ticks-per-day mod 1 = 0 and ( infectious-length / ticks-per-day < latest-antivirals-given ) )
  [ if random-float 100 < antiviral-treatment-chance  
    [            
      set antiviral-treated? true                                           
      set shape "default" 
                                     
      set antiviral-effect-time random-gamma antiviral-effect-alpha antiviral-effect-lambda     ;; An individual receiving the antiviral selects a antiviral-effect-time from the gamma-distribution and its infectious-time is reduced by that amount.
      set infectious-time infectious-time - antiviral-effect-time 
    ]
  ]
end     

to compute-maximum-infectious                                                                   ;; A vector of the number of infectious individuals at each tick is stored.  The maximum and time of the maximum are computed.  
  set number-infectious-vector lput count turtles with [infectious?] number-infectious-vector
  set maximum-infectious max number-infectious-vector
  set tick-at-maximum-infectious position maximum-infectious number-infectious-vector   
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

There is only one version of this model, created over 9 years ago by Anna Mummert.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.