Getting Down On Dengue: Agent Based

Getting Down On Dengue: Agent Based preview image

1 collaborator

Mohit_dubey Mohit Dubey (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.1.0 • Viewed 428 times • Downloaded 59 times • Run 0 times
Download the 'Getting Down On Dengue: Agent Based' 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

gis/cubds00ag.asc not found (Question)

cannot run the model due to this error "gis/cubds00ag.asc not found"

Posted about 9 years ago

Click to Run Model

extensions [ gis sound ]
globals [ 
  surfacewater elevation slope aspect population    ; gis datasets
  rainfall                                          ; monthly rainfall amount in mm
  storms                                            ; number of storms each month
  land                                              ; patchset with elevation > 5
  year month evaporation max-infected max-tick
]

breed [mosquito mosquitoes ]
breed [human humans]
breed [water waters]
human-own [closest-human]
water-own [closest-water]
turtles-own [ infected? hungry? age fertility state duration recovered? immune?]

;This is an agent-based model of the spread of a single strain of Dengue Fever in Cuba.
;The model is comprised of two layers: GIS/Water layer and Agent layer.
;In the GIS/Water layer, monthly rainfall/evaporation data alongside GIS data for elevation and surface water are used to model the collection of standing water in Cuba.
;In the Agent layer, the mosquito population breeds around the standing water according to reproductive rules and infects the human population which is obtained from GIS population density data.


; UNITS
; land area for Cuba: 109,884 km²   land above sea-level = 11,951 patches
; 1 patch = 9 square kilometers
; evaporation = 3.53965 mm/day (source: "Tropical Forest Ecology : A View from Barro Colorado Island" http://bit.ly/1lbez17)

to setup
  clear-all
  cd
  
  set population gis:load-dataset "gis/cubds00ag.asc"
  set surfacewater gis:load-dataset "gis/CUB_water_areas_dcw.shp"
  gis:set-drawing-color blue
  gis:fill surfacewater 1
  gis:set-world-envelope gis:envelope-of population
  
  if elevation = 0 [
    set elevation gis:load-dataset "gis/cuba_lores.asc"
    set land patches with [gis:raster-sample elevation self > 5 ]
    
    ; use sobel convolution filter to calculate delta-x and delta-y
    let horizontal-gradient gis:convolve elevation 3 3 [ 1 1 1 0 0 0 -1 -1 -1 ] 1 1
    let vertical-gradient gis:convolve elevation 3 3 [ 1 0 -1 1 0 -1 1 0 -1 ] 1 1
    set slope gis:create-raster gis:width-of elevation gis:height-of elevation gis:envelope-of elevation
    set aspect gis:create-raster gis:width-of elevation gis:height-of elevation gis:envelope-of elevation
    
    ; calculate slope and aspect (from Netlogo GIS Gradient example)
    let x 0
    repeat (gis:width-of slope)
    [ let y 0
      repeat (gis:height-of slope)
      [ let gx gis:raster-value horizontal-gradient x y
        let gy gis:raster-value vertical-gradient x y
        if ((gx <= 0) or (gx >= 0)) and ((gy <= 0) or (gy >= 0))
        [ let s sqrt ((gx * gx) + (gy * gy))
          gis:set-raster-value slope x y s
          ifelse (gx != 0) or (gy != 0)
          [ gis:set-raster-value aspect x y atan gy gx ]
          [ gis:set-raster-value aspect x y 0 ] ]
        set y y + 1 ]
      set x x + 1 ]
    gis:set-sampling-method aspect "bilinear"
    gis:paint elevation 100
  ]

  ask turtles [ set evaporation 129]
  set rainfall 266
  set storms 3
  set year 0
  set month "jan"
  ask patches [
    let value gis:raster-sample population self if (value <= 0 or value >= 0) 
    [ set pcolor scale-color red gis:raster-sample population self 0 400 ]
  ]
     
  ask patches gis:intersecting surfacewater
  [ sprout 1
    [ set color blue
      set breed water ]]

  ask patches gis:intersecting surfacewater  [
    sprout 4 [ set breed mosquito 
      set age random 30
      ifelse random 100 < initial-infected-rate [ set infected? true] [set infected? false ]
      set fertility random 3
      ]]
  
  ask patches with [gis:raster-sample elevation self > 25 ]
     [if random  (30000) = 1 [ 
         sprout ( .6 * (rainfall))  [set color blue   set breed water ]]]
   
   ask mosquito [ if gis:raster-sample elevation patch-here < 10 [die]]
   
   ask patches with [gis:raster-sample elevation self < 5 ] [ set pcolor white ]
   
   human-spawn
   
   set m-velocity .00141455
   set infection-rate 75
   set biting-rate 83
   
   set max-infected 0
   set max-tick 0
   
   reset-ticks
end 

to go
  
  tick

  if count human with [ infected? = true ] > max-infected [ set max-infected count human with [ infected? = true ] set max-tick ticks]
  
   ; Have water face downslope and move forward (from Netlogo GIS Gradient example)
   ask water [
     forward .1
     let h gis:raster-sample aspect self
     ifelse h >= -360
        [ set heading subtract-headings h 180 ]
        [ die ] 
    ]

  ask mosquito [ if hungry? = false [ face min-one-of water [distance myself]]]
  ask mosquito [ if hungry? = true [ face min-one-of human [distance myself]]]
  
  ask mosquito [ forward m-velocity ]
  
  ; handle monthly rainfall and evaporation
  if ticks = 31 [ set rainfall 238 set month "feb" set evaporation 144 ] 
  if ticks = 59 [ set rainfall 178 set month "mar" set evaporation 195 ] 
  if ticks = 90 [ set rainfall 153  set storms 4 set month "apr"  set evaporation 209 ] 
  if ticks = 120 [ set rainfall 534  set storms 6 set month "may" set evaporation 179 ] 
  if ticks = 151 [ set rainfall 854 set storms 9 set month "jun" set evaporation 183 ] 
  if ticks = 181 [ set rainfall 518 set storms 8 set month "jul" set evaporation 188 ] 
  if ticks = 212 [ set rainfall 770 set month "aug" set evaporation 189 ] 
  if ticks = 243 [ set rainfall 541 set storms 7 set month "sep" set evaporation 155 ] 
  if ticks = 273 [ set rainfall 386 set storms 6 set month "oct" set evaporation 142 ]
  if ticks = 304 [ set rainfall 124 set storms 4 set month "nov" set evaporation 117 ]
  if ticks = 334 [ set rainfall 245 set month "dec" set evaporation 110 ]
  if ticks = 365 [ reset-ticks set rainfall 266 set evaporation 129 set storms 3 set month "jan" set year year + 1]
  
  rain
  
  human-life
  
  infect 
  
  move-humans
  
  source-reduce
end 

to rain
  
  evaporate
  
  ask patches with [gis:raster-sample elevation self > 25 ]
  [  if random  (30000) = 1 [
      sprout ( .6 * (rainfall))
      [set color blue
        set breed water 
        ;sound:play-note "Rain" 60 rainfall / 10 2
        ;sound:play-sound "rain.wav"  ]
      ]
     ]
  ]
  
 mosquito-spawn
end 

to evaporate
  
  if count water > (evaporation / 30) [ask n-of (evaporation / 30) water [die]]
  ask water [ if gis:raster-sample elevation patch-here < 10 [die]]
end 

to mosquito-spawn
  
  ask mosquito [set age age + 1 ]
  
  ask patches [ if count mosquito-here > 0 and count human-here > 0 and random 100 < biting-rate [ ask mosquito-here [set hungry? false set fertility fertility + 1 ]]]
  
  ; hatch four mosquitoes around water and after eating
  ask patches [if count water-here > 0 and count mosquito-here > 0  [
      ask mosquito-here [ if age > 12 and hungry? = false and fertility < 6 [ 
          hatch 4 [ 
            set breed mosquito 
            set hungry? true
            set infected? false
            set age 0 
            set fertility 0]
      ]
     ]
    ]
  ]
  
  ask mosquito [ if age > 37 [die]]
   
  ask mosquito [ if gis:raster-sample elevation patch-here < 10 [die]]
end 

to human-life
  
  ask human [set age age + 1 ]
  
  if random 1000 < 11 
    [ crt 1 
      [ set breed human
        set age 0
        set color red 
        set duration 0
        set recovered? false
        ifelse random 100 < immunized [ set immune? true ] [set immune? false ] ]]
  
  if random 1000 < 8
    [ ask n-of 1 human [ die]]
  
  ask human [ if age > 25000 [die]]
end 

to human-spawn
  
  ; generate population based on population density map
  ask land [ sprout ((gis:raster-sample population self ) / 100)
    [ set color red
      set breed human
      set age random 20000
      set infected? false 
      set duration 0
      set recovered? false
      ifelse random 100 < immunized [ set immune? true ] [set immune? false ]
    ]
  ]
end 

to infect
  
  ask patches [ if count mosquito-here > 0 and count human-here > 0 and random 100 < infection-rate [ask human-here [if infected? = true [ ask mosquito-here [set infected? true ]]]]]
  ask patches [ if count mosquito-here > 0 and count human-here > 0 and random 100 < infection-rate [ask mosquito-here [if infected? = true [ ask human-here [if immune? = false [ set infected? true ]]]]]]
  ask human [ if infected? = true [ set duration duration + 1 
  if duration > 15 [ ifelse random 100 < 95 [set infected? false set duration 0 set recovered? true set immune? true ] [die] ]]]
end 

to source-reduce
  
  ask patches [ if count water-here > 0 and count human-here > 0 and random 100 < source-reduction [ask water-here [die] ]] ;sound:play-drum "Hand Clap" 10
end 

to move-humans
  
  if human-mobility > 0 [
    let mRadius human-mobility * world-width
    ask links [die]
    ask n-of (mobility-per-tick / 100 * count human) human [
      let swap-partner one-of other human in-radius mRadius
      if swap-partner != nobody [
         create-link-with swap-partner
         let mX xcor let mY ycor
         setxy [xcor] of swap-partner [ycor] of swap-partner
         ask swap-partner [setxy mX mY]
      ]
    ]
  ]
end 

There is only one version of this model, created over 10 years ago by Mohit Dubey.

Attached files

File Type Description Last updated
Getting Down On Dengue: Agent Based.png preview Preview for 'Getting Down On Dengue: Agent Based' over 10 years ago, by Mohit Dubey Download

This model does not have any ancestors.

This model does not have any descendants.