AIDs/HIV Chained Distribution

AIDs/HIV Chained Distribution preview image

1 collaborator

Default-person AIDSroko LLC (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.4 • Viewed 573 times • Downloaded 57 times • Run 0 times
Download the 'AIDs/HIV Chained Distribution' 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

turtles-own
[
  infected?           ;; if true, the person is infectious
  resistant?          ;; if true, the person can't be infected
  virus-check-timer   ;; number of ticks since this person's last virus-check
]

to make-movie

  user-message "First, save your new movie file (choose a name ending with .mov)"
  let path user-new-file
  if not is-string? path [ stop ]  ;; stop if user canceled

  setup
  movie-start path
  movie-grab-view
  while [ count turtles < 2000 ]
    [ go
      movie-grab-view ]

  ;; export the movie
  movie-close
  user-message (word "Exported movie to " path)
end 

to setup
  __clear-all-and-reset-ticks
  setup-nodes
  setup-spatially-clustered-network
  ask n-of initial-outbreak-size turtles
    [ become-infected ]
  ask links [ set color white ]
  update-plot
end 

to setup-nodes
  set-default-shape turtles "square"
  crt number-of-people
  [
    setxy (random-xcor * 0.9) (random-ycor * 0.9)
    become-susceptible
    set virus-check-timer random virus-check-frequency
  ]
end 

to setup-spatially-clustered-network
  let num-links (average-node-degree * number-of-people) / 2
  while [count links < num-links ]
  [
    ask one-of turtles
    [
      let choice (min-one-of (other turtles with [not link-neighbor? myself])
                   [distance myself])
      if choice != nobody [ create-link-with choice ]
    ]
  ]
  ; make the network look a little prettier
  repeat 10
  [
    layout-spring turtles links 0.3 (world-width / (sqrt number-of-people)) 1
  ]
end 

to go
  if all? turtles [not infected?]
    [ stop ]
  ask turtles
  [
     set virus-check-timer virus-check-timer + 1
     if virus-check-timer >= virus-check-frequency
       [ set virus-check-timer 0 ]
  ]
  spread-virus
  do-virus-checks
  tick
  update-plot
end 

to become-infected  ;; turtle procedure
  set infected? true
  set resistant? false
  set color yellow
end 

to become-susceptible  
  set infected? false
  set resistant? false
  set color green
end 

to become-aids 
  set infected? false
  set resistant? true
  set color red
  ask my-links [ set color gray - 2 ]
end 

to spread-virus
  ask turtles with [infected?]
    [ ask link-neighbors with [not resistant?]
        [ if random-float 100 < virus-spread-chance
            [ become-infected ] ] ]
end 

to do-virus-checks
  ask turtles with [infected? and virus-check-timer = 0]
  [
    if random 100 < recovery-chance
    [
      ifelse random 100 < gain-resistance-chance
        [ become-aids ]
        [ become-susceptible ]
    ]
  ]
end 

to update-plot
  set-current-plot "HIV+ Status"
  set-current-plot-pen "Condom Usage"
  plot (count turtles with [not infected? and not resistant?]) / (count turtles) * 100
  set-current-plot-pen "HIV+ Infected"
  plot (count turtles with [infected?]) / (count turtles) * 100
  set-current-plot-pen "AIDS / Mature"
  plot (count turtles with [resistant?]) / (count turtles) * 100
  set-current-plot "Usage"
  plot (count turtles with [not infected? and not resistant?])
  set-current-plot "HIV+"
  plot (count turtles with [infected?])
  
  plot 1
end 

There is only one version of this model, created almost 6 years ago by AIDSroko LLC.

Attached files

File Type Description Last updated
AIDs/HIV Chained Distribution.png preview Preview for 'AIDs/HIV Chained Distribution' almost 6 years ago, by AIDSroko LLC Download

This model does not have any ancestors.

This model does not have any descendants.