Sylvatic Yellow Fever model

Sylvatic Yellow Fever model preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Tags

epidemic 

Tagged by Antônio Ralph Medeiros de Sousa over 4 years ago

mosquitoes 

Tagged by Antônio Ralph Medeiros de Sousa over 4 years ago

virus 

Tagged by Antônio Ralph Medeiros de Sousa over 4 years ago

yellow-fever 

Tagged by Antônio Ralph Medeiros de Sousa over 4 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.0 • Viewed 317 times • Downloaded 21 times • Run 0 times
Download the 'Sylvatic Yellow Fever model' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

globals [
  forest                  ;; The patches representing the forest
  urban                   ;; The patches representing the urban area
  border                  ;; The patches representing the border between urban and forest
  angle                   ;; Heading for individuals
  vaccinated-humans       ;; The initial number of immune (vaccinated) people
]

breed [u-mosquitoes u-mosquito]      ;; To create a urban mosquito species
breed [f-mosquitoes f-mosquito]      ;; To create a forest mosquito species
breed [humans human]                 ;; To create humans
breed [monkeys monkey]               ;; To create monkeys

u-mosquitoes-own
[susceptible?             ;; If true, the urban mosquito is susceptible
 exposed?                 ;; If true, the urban mosquito is infected but in latent period
 infected?                ;; If true, the urban mosquito is infected and infectious
 min-lifespan             ;; The minimum life span before die
 virus-incubation         ;; The incubation period of the virus in mosquitoes
]
f-mosquitoes-own
[susceptible?             ;; If true, the forest mosquito is susceptible
 exposed?                 ;; If true, the forest mosquito is infected but in latent period
 infected?                ;; If true, the forest mosquito is infected and infectious
 min-lifespan             ;; The minimum life span before die
 virus-incubation         ;; The incubation period of the virus in mosquitoes
]
humans-own
[susceptible?             ;; If true, the human is susceptible.
 exposed?                 ;; If true, the human is infected but in latent period
 infected?                ;; If true, the human is infected and infectious
 immune?                  ;; If true, the human is immune
 toxic-phase?             ;; If true, the human is in toxic-phase (severe disease)
 latent-period            ;; The latent period of the virus
 viremic-time             ;; The time in days that individuals will be infectious and can transmit the virus to mosquitoes
 toxic-phase-time         ;; The time in days that individuals will be in the toxic-phase
 walk-free?               ;; If true, the individual can walk through the forest
]
monkeys-own
[susceptible?             ;; If true, the monkey is susceptible.
 exposed?                 ;; If true, the monkey is infected but in latent period
 infected?                ;; If true, the monkey is infected and infectious
 immune?                  ;; If true, the monkey is immune
 toxic-phase?             ;; If true, the monkey is in toxic-phase
 latent-period            ;; The latent period of the virus
 viremic-time             ;; The time in days that individuals will be infectious and can transmit the virus to mosquitoes
 toxic-phase-time         ;; The time in days that individuals will be in the toxic-phase
]

;;;;
;;;SETUP PROCEDURES
;;;;

to setup
  clear-all
  setup-globals
  setup-host
  reset-ticks
end 

;; creating and assigning colors to patches

to setup-globals
  set border patches with [(pxcor =  0 and abs (pycor) >= 0)]
  ask border [ set pcolor pink ]
  set urban patches with [(pxcor < 0 and abs (pycor) >= 0)]
  ask urban [set pcolor gray ]
  set forest patches with [(pxcor > 0 and abs (pycor) >= 0)]
  ask forest [set pcolor green ]
end 

;; creating initial humans, monkeys, and mosquitoes

to setup-host
  create-humans initial-people
  [ask humans [move-to one-of urban]
   set shape "person"
   set size 1
   set infected? false
   set immune? false
   set susceptible? true
   set exposed? false
   set toxic-phase? false
   set walk-free? false
   if random-float 100 < vaccine-coverage [      ;;; assigning immunity to vaccinated people
    set susceptible? false
    set immune? true
    ]
   if random-float 100 < free-walkers     ;;; defining the people who can walk through the forest.
    [
      set walk-free? true
    ]
   assign-color
  ]
  set vaccinated-humans count humans with [immune?]

  create-u-mosquitoes initial-urban-mosquitoes
  [ask u-mosquitoes [move-to one-of urban]
   set shape "triangle"
   set size 0.3
   set infected? false
   set susceptible? true
   set exposed? false
   assign-color
  ]

  create-f-mosquitoes initial-forest-mosquitoes
  [ask f-mosquitoes [move-to one-of forest]
   set shape "square"
   set size 0.3
   set infected? false
   set susceptible? true
   set exposed? false
   if (random-float 100 < initial-infected-mosquitoes)  ;; defining initial number of infected forest-mosquitoes
    [
      set susceptible? false
      set infected? true
    ]
  assign-color
  ]

  create-monkeys initial-monkeys
   [ask monkeys [move-to one-of forest]
   set shape "circle"
   set size 0.5
   set infected? false
   set susceptible? true
   set immune? false
   set exposed? false
   set toxic-phase? false
   assign-color
   ]
end 

to assign-color  ;; The colors for represent the virus circulation and individual status
    if susceptible? [ set color white ]
    if exposed? [ set color red ]
    if infected? [ set color black ]
    if breed = humans or breed = monkeys [
      if immune? [ set color blue ]
      if toxic-phase? [ set color yellow ] ]
end 

;;;
;;; GO PROCEDURES
;;;

to go
  move-f-mosquitoes
  move-u-mosquitoes
  move-monkeys
  move-humans
  if all? turtles [ not exposed? and not infected? ] and all? humans [ not toxic-phase? ] and all? monkeys [ not toxic-phase? ] [stop]  ;; stopping the simulation
  ask f-mosquitoes with [infected?] [infect-primates]
  ask u-mosquitoes with [infected?] [infect-primates]
  ask monkeys with [infected?] [infect-mosquitoes stop-infect]
  ask humans with [infected?] [infect-mosquitoes stop-infect]
  ask f-mosquitoes with [exposed?] [extrinsic-incubation-period]
  ask u-mosquitoes with [exposed?] [extrinsic-incubation-period]
  ask monkeys with [exposed?] [become-viremic]
  ask humans with [exposed?] [become-viremic]
  ask f-mosquitoes [maybe-die]
  ask u-mosquitoes [maybe-die]
  ask monkeys with [toxic-phase?] [recovery-or-die]
  ask humans with [toxic-phase?] [recovery-or-die]
  tick
end 

to move-monkeys   ;; turtle procedure
  ask monkeys [
    rt random-float 360.0
    forward random-float monkey-mobility
    if xcor < 0 ;; outside forest
    [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
    if xcor > (max-pxcor - 0.1)  ;; at the edge of world
      [
        set angle random-float 180
        let new-patch2 patch-at-heading-and-distance angle (-1)
        if new-patch2 != nobody
      [
        move-to new-patch2
      ] ]
    assign-color
  ]
end 

to move-humans  ;; turtle procedure
  ask humans [
    rt random-float 360.0
    forward random-float human-mobility
    if xcor > 0 and not walk-free? ;; outside urban area
    [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (-1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
     if xcor > (max-pxcor / 2) and walk-free?  ;; Don't go too far in the woods
    [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (-1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
    if xcor < (min-pxcor + 0.1)  ;; at the edge of world
      [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
    assign-color
  ]
end 

to move-u-mosquitoes  ;; turtle procedure
 ask u-mosquitoes [
    rt random-float 360.0
    forward random-float 0.2
    if xcor > 0  ;; outside urban area
    [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (-1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
    if xcor < (min-pxcor + 0.1)  ;; at the edge of world
      [
        set angle random-float 180
        let new-patch2 patch-at-heading-and-distance angle (1)
      if new-patch2 != nobody
      [
        move-to new-patch2
      ] ]
    assign-color
  ]
end 

to move-f-mosquitoes  ;; turtle procedure
 ask f-mosquitoes [
    rt random-float 360.0
    forward random-float 0.2
    if xcor < 0  ;; outside forest
    [
      set angle random-float 180
      let new-patch patch-at-heading-and-distance angle (1)
      if new-patch != nobody
      [
        move-to new-patch
      ] ]
    if xcor > (max-pxcor - 0.1)  ;; at the edge of world
      [
        set angle random-float 180
        let new-patch2 patch-at-heading-and-distance angle (-1)
        if new-patch2 != nobody
      [
        move-to new-patch2
      ] ]
    assign-color
  ]
end 

to infect-mosquitoes  ;; turtle procedure
 let target-p (u-mosquitoes-on neighbors)
 let hostm one-of (target-p with [susceptible?])
 let target-p2 (f-mosquitoes-on neighbors)
 let hostm2 one-of (target-p2 with [susceptible?])
 if hostm != nobody [
  if  random-float 1 < mosquito-daily-biting-rate [
   if random-float 1 < u-mosq-transmission-competence [
    ask hostm [
      set susceptible? false
      set exposed? true
  ] ] ] ]
 if hostm2 != nobody [
  if  random-float 1 < mosquito-daily-biting-rate [
   if random-float 1 < f-mosq-transmission-competence [
    ask hostm2 [
      set susceptible? false
      set exposed? true
  ] ] ] ]
end 

to infect-primates  ;; turtle procedure
let target-m (humans-on neighbors)
 let hostp one-of (target-m with [susceptible?])
 let target-m2 (monkeys-on neighbors)
 let hostp2 one-of (target-m2 with [susceptible?])
 if breed = u-mosquitoes [
  if hostp != nobody [
    if  random-float 1 < mosquito-daily-biting-rate [
     if random-float 1 < u-mosq-infection-competence [
     ask hostp [
      set susceptible? false
      set exposed? true
    ] ] ] ]
 if hostp2 != nobody [
   if  random-float 1 < mosquito-daily-biting-rate [
    if random-float 1 < u-mosq-infection-competence [
    ask hostp2 [
      set susceptible? false
      set exposed? true
    ] ] ] ] ]
 if breed = f-mosquitoes [
  if hostp != nobody [
    if  random-float 1 < mosquito-daily-biting-rate [
     if random-float 1 < f-mosq-infection-competence [
     ask hostp [
      set susceptible? false
      set exposed? true
    ] ] ] ]
 if hostp2 != nobody [
   if  random-float 1 < mosquito-daily-biting-rate [
    if random-float 1 < f-mosq-infection-competence [
    ask hostp2 [
      set susceptible? false
      set exposed? true
    ] ] ] ] ]
end 

;; the incubation period in mosquitoes

to extrinsic-incubation-period  ;; turtle procedure
  set virus-incubation virus-incubation + 1
  if virus-incubation > 14 [
    if breed = u-mosquitoes [
      set exposed? false
      set infected? true
      ]
    if breed = f-mosquitoes [
      set exposed? false
      set infected? true
      ] ]
end 

;; the start of infectious period

to become-viremic  ;; turtle procedure
  set latent-period latent-period + 1
  if latent-period > 4 [
     set infected? true
     set exposed? false
     ]
end 

;; The end of infectious period

to stop-infect  ;; turtle procedure
  set viremic-time viremic-time + 1
  if breed = humans [
  if viremic-time > 6 [
    ifelse random 100 < 85 [
     set infected? false
     set immune? true
     ] [
      set infected? false
      set toxic-phase? true
      ] ] ]
  if breed = monkeys [
    if viremic-time > 6 [
      set infected? false
      set toxic-phase? true
      ] ]
end 

;; defining the individuals who will survive or die

to recovery-or-die  ;; turtle procedure
  set toxic-phase-time toxic-phase-time + 1
  if breed = humans [
  if toxic-phase-time > 7 [
    ifelse random 100 < 50 [
    set toxic-phase? false
    set immune? true
     ] [
        die ] ] ]
  if breed = monkeys [
  if toxic-phase-time > 10 [
    ifelse random 100 < 20 [
    set toxic-phase? false
    set immune? true
     ] [
        die ] ] ]
end 

;; defining a lifespan to mosquitoes

to maybe-die  ;; turtle procedure
  set min-lifespan min-lifespan + 1
  if min-lifespan > 15 [
  if random-float 1 < mosquito-mortality-rate [
   if breed = u-mosquitoes [
     hatch-u-mosquitoes 1 [
     set infected? false
     set susceptible? true
     set exposed? false
     move-to one-of urban
    ] ]
   if breed = f-mosquitoes [
     hatch-f-mosquitoes 1 [
     set infected? false
     set susceptible? true
     set exposed? false
     move-to one-of forest
    ] ]
    die ] ]
end 

There is only one version of this model, created over 4 years ago by Antônio Ralph Medeiros de Sousa.

Attached files

File Type Description Last updated
Sylvatic Yellow Fever model.png preview Preview for 'Sylvatic Yellow Fever model' over 4 years ago, by Antônio Ralph Medeiros de Sousa Download

This model does not have any ancestors.

This model does not have any descendants.