STI

No preview image

1 collaborator

Default-person Landon Basham (Author)

Tags

(This model has yet to be categorized with any tags)
Model group LS426_2013 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.3 • Viewed 265 times • Downloaded 31 times • Run 0 times
Download the 'STI ' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model simulates the spread of sexually transmitted infections (STIs) throughout a population. These populations can include members of any sexual orientation; therefore, this model serves to demonstrate how an infection/disease can permeate through a population even if it only starts with one person (regardless of the sexual orientation or gender of that initial patient zero).

Although STIs may be transmitted through avenues other than sexual behavior, as in drug needles, childbirth, or breastfeeding, this model focuses on the sexual interactions, as they are most common form of transmission.

The model examines the effects of infection transmission through different demographic percentages. The user can select the size of the initial population, the initial percentage of heterosexual people, and the initial percentage of homosexual people (the remainder of the population will be bisexual). In doing so, users can observe any potential patterns that emerge with different populations.

HOW IT WORKS

People in this model are color coded to indicate the gender of their preferred partner. Blue people are attracted to males, pink people are attracted to females, and purple people are attracted to either/both. As the individuals move around randomly, they may come across a potential sexual partner. If both partners are attracted to the gender of the other partner, there is a chance these two will have a sexual relationship; it is not guaranteed. If a couple is formed, they stay next to each other (stationary) for a pre-determined length of time and their respective patches turn gray in order to more easily identify them. If one partner in the couple is infected, the other partner is at risk for infection if both partners do not use condoms.

An infected person is denoted with the addition of a red dot on their body. If they happen to infect their partner, the partner will then have a red dot as well. The sexual relationship lasts for a limited time, and the two individuals move randomly about once again until they find another potential partner.

The model stops when the desired percentage of the population is infected.

HOW TO USE IT

Using sliders, determine the initial population, including percentages of representations of different sexual orientations. Users also determine the likelihood of an individual using a condom and the point at which the model should stop. Indicating a stop percentage allows the user to see who has (or has not) been infected after the determined percentage has been reached.

The SETUP button will generate a population based on the users determined values. Once the population is initialized, the user presses the SELECT button and clicks on an individual in the simulation to infect with a sexually transmitted infection. This allows the user to observe any patterns that arise from an initial _patient zero.

To start the simulation, the user should press the GO button. The simulation will run until the GO button is pressed again or the determined stop-percentage has been met, whichever happens first.

Monitors indicate the percentage of the total population that has been infected, as well as counts and percentages for some demographics. The graph shows the percentage of each sexual orientation that is infected.

Once the simulation has reached a stopping point, whether by pressing GO a second time or the stop-percentage has been met, the user can press the HIDE INFECTED button. This will only display the remaining members of the population who have yet to be infected. This information could be used when noticing any possible patterns. To return to the entire population, select the SHOW INFECTED button.

The user can affect the likelihood of safe sex being practiced, i.e. how likely an individual is to use a condom. If both partners use a condom, the model prevents the infection from being transmitted. However, if one partner chooses to use a condom while the other does not, the model simulates no use of a condom, and both parties are potentially at risk of infection. This could be explored and altered in possible extensions of this model.

THINGS TO NOTICE

If the INITIAL PEOPLE slider is set relatively high (300-500), you can easily notice that couples start forming on top of each other. It appears as though there are 3 or more individuals in a given sexual relationship, but in actuality, some individuals may be occupying the same patch and only one is visible.

All members of the population can become infected regardless of the qualities of the user-selected initial infector. Who is yet to be infected after the designated percentage of infected population has been met? Is this different with initial infectors of different genders and/or sexual orientations?

Before it was properly understood, HIV/AIDS (formerly known as Gay-Related Immune Deficiency) was thought of as a "gay" disease. Based on your observations of the model, comment on the likelihood of a disease only infecting persons of one particular sexual orientation.

THINGS TO TRY

After pressing the SELECT button, infect any individual you want and run the simulation. Keep the same variables and press the SETUP button again. This time SELECT an individual with a different orientation and/or gender. Try all possible initial individuals and look for any patterns that might emerge.

Adjust the sliders for %STRAIGHT and %GAY. Does the difference in distribution alter the outcomes at all?

EXTENDING THE MODEL

Symptoms of sexually transmitted infections aren_t always visible or known, and some STIs display symptoms differently in different genders. These factors impact how often a particular gender might choose to get tested or use protection in sexual encounters. To better simulate real-life behaviors, implement the chance that females have a high likelihood of experiencing symptoms, while males do not. If a person experiences symptoms, they can become treated and cured of the infection in some defined amount of time. You can also implement the condition that if a person thinks they are infected, they will definitely use protection. See how these changes impact the outcome of the model.

In different relationships, condom use may vary. Additionally, condoms are not always effective or properly used. To more accurately account for likelihood of condom use and consequent transmission of infections, create different condom-use tendencies for each sexual orientation and create a probability that a condom is ineffective.

The culture and sexual behavior habits might alter likelihood of transmission for couples depending on their sexual orientation, i.e. heterosexual vs. bisexual vs. homosexual. Choose different probabilities of transmission for couples of different sexual orientations. Notice if higher transmission rates and lower population percentages alters the outcomes.

NETLOGO FEATURES

n-of is used to divide the turtle population into genders and sexual orientations.

Every time-step (tick), a sliders value is checked against a global variable that holds the value of what the sliders value was the time-step before. If the sliders current value is different than the global variable, NetLogo knows to call procedures that adjust the populations tendencies. Otherwise, those adjustment procedures are not called.

The random-near function generates many small random numbers and adds them together to determine individual tendencies. This produces an approximately normal distribution of values.

RELATED MODELS

Disease Solo Virus AIDS

CREDITS AND REFERENCES

This model is inspired by the AIDS model from the Models Library. Special thanks to Dave Weintrop.

Comments and Questions

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

Click to Run Model

globals [
  %gay              ;; Percent of homosexual people in the population (set by slider)
  %bi               ;; Percent of bisexual people in the population (determined by slider)
  
  max-coupling-factor       ;; Maximum coupling tendency value
                            ;; Used as an upper bound for generating random chance of coupling
                            ;; (default is scale 0 - 10)
  max-condom-factor         ;; Maximum condom use value
                            ;; Used as an upper bound for generating random chance of using a condom
                            ;; (default is scale 0 - 10)
                            
  average-coupling-tendency ;; Average tendency of a person to couple with another person
  average-commitment        ;; Number of ticks a couple will stay together, on average
  ;average-condom-use       ;; Average frequency that a person uses protection (set by slider)
  
  slider-check-1    ;; Temporary variable to use to check for slider adjustments
                    ;; during the simulation and adjust model appropriately
  infection-chance ;; The chance out of 100 that an infected person will transmit infection during one week of couplehood
  ]

turtles-own [
  male?              ;; true or false for genders M or F
  orientation        ;; gay straight or bi
  
  infected?          ;; If true, the person is infected.
                     
  coupled?           ;; If true, the person is in a sexually active couple.
  partner            ;; The person that is our current partner in a couple.
  couple-length      ;; How long the person has been in a couple.
  
  commitment         ;; How long the person will stay in a couple-relationship.
  coupling-tendency  ;; How likely the person is to join a couple.
  condom-use         ;; The percent chance a person uses protection
                     ;; (determined by slider & normal distribution)
]

;;;
;;; SETUP PROCEDURES
;;;

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

to setup-globals
  
  set max-coupling-factor 10.0
  set max-condom-factor 11.0
  
  set slider-check-1 average-condom-use
  
  ;; In the AIDS model, these variables are set with sliders
  ;; For simplicity, we set them to predetermined values
  ;; Individual values in each turtle are still set using 
  ;; a random value following a normal distribution
  
  set average-coupling-tendency 5 ;should be less than max-coupling-factor
  set average-commitment 20
  set infection-chance 50 ;; %50 chance of being infected by having unprotected sex with infected partner
end 

to setup-people
  crt initial-people       ;; create the specified initial number of people
    [ 
      set male? true                ;; default person straight male... just like society -_-
      set orientation "straight"    ;; set sexual orientation
      setxy random-xcor random-ycor ;; place every person in a random position
      set coupled? false
      set partner nobody
      set infected? false 

      ;; The below variables may be different in each turtle, and the values
      ;; follow an approximately normal distribution
      assign-commitment
      assign-coupling-tendency
      assign-condom-use
      ]
    
   ;; set gender of turtles to be 50% male, 50% female
   
   ask n-of (initial-people / 2) turtles [set male? false ]
   
   ;; set orientations of turtles based on slider values
   
   set %gay (100 - %straight) * (%gay-in-pop / 100)
   set %bi (100 - %straight) * (1 - %gay-in-pop / 100)
  
   ask n-of (initial-people * (%bi / 100)) turtles [set orientation "bi"] 
   ;; when setting the second orientation, make sure to change only formerly straight turtles
   ask n-of (initial-people * (%gay / 100)) turtles with [orientation = "straight"] [set orientation "gay"]
  
   
   ask turtles [
     assign-color    ;; color is determined by orientation
     assign-shape    ;; shape is determined by gender and sick status
     set size 1.5
     ]
end 


;; Color of turtle indicates their mate gender preference
;; i.e. likes men is blue, likes women is pink, both is purple

to assign-color  ;; turtle procedure
  if likesboys? [ set color blue]
  if likesgirls? [ set color pink]
  if likesboys? and likesgirls? [set color violet]
end 


 ;; Set shape based on gender (male or female)
 ;; and whether or not infected (includes a red dot)

to assign-shape ;; turtle procedure
  ifelse infected?
  [ ifelse male?
    [set shape "male sick"]
    [set shape "female sick"]
  ]
  [ ifelse male?
    [set shape "male"]
    [set shape "female"]
  ]
end 



;;;
;;; SELECT PROCEDURE
;;;
;; User chooses an initial patient zero

to select
  let picked? false
   if mouse-down? [
    let candidate min-one-of turtles [distancexy mouse-xcor mouse-ycor]
    if [distancexy mouse-xcor mouse-ycor] of candidate < 1 [
        ask candidate [ 
          set shape word shape " sick"
          display
          set picked? true
          set infected? true ] ] ]
  if picked?
  [stop]
end  


;; People move about the simulation at random.

to move  ;; turtle procedure
  rt random-float 360
  fd 1
end 


;;;
;;; GO PROCEDURES
;;;

to go
  ;; stop when % of infected people reaches specified limit
  ;; allows user to examine what genders/orientations are last to be infected
  if (%infected > stop%) [ stop ] 
     
  check-sliders ;; check if any sliders impacting behavior have been changed
  
  ask turtles
    [ ifelse coupled?
        [ set couple-length couple-length + 1 ]
        [ move ] ;; move if not coupled
    ]

   ;; Any turtle can initiate mating if they are not coupled
   ;; (and random chance permits)
  ask turtles
    [ if not coupled? and (random-float max-coupling-factor < coupling-tendency)
        [ couple ] ]
  ask turtles [ uncouple ]
  ask turtles [ infect ]
  tick
end 



;; On each tick a check is made to see if sliders have been changed.
;; If one has been, the corresponding turtle variable is adjusted

to check-sliders
  
  if (slider-check-1 != average-condom-use)
    [ ask turtles [ assign-condom-use ]
      set slider-check-1 average-condom-use ]
end 


;; The following procedure assigns core turtle variables.  They use
;; the helper procedure RANDOM-NEAR so that the turtle variables have an
;; approximately "normal" distribution around the average values.

to assign-commitment  ;; turtle procedure
  set commitment random-near average-commitment
end 

to assign-coupling-tendency  ;; turtle procedure
  set coupling-tendency random-near average-coupling-tendency
end 

to assign-condom-use  ;; turtle procedure
  set condom-use random-near average-condom-use
end 


;; Helper procedure to approximate a "normal" distribution
;; around the given average value

;; Generate many small random numbers and add them together.
;; This produces a normal distribution of tendency values.
;; A random number between 0 and 100 is as likely to be 1 as it is to be 99.
;; However, the sum of 20 numbers between 0 and 5 is much more likely to be 50 than it is to be 99.

to-report random-near [center]  ;; turtle procedure
  let result 0
  repeat 40
    [ set result (result + random-float center) ]
  report result / 20
end 



;;;
;;; COUPLING/UNCOUPLING/INFECTING PROCEDURES
;;;


;; People have a chance to couple depending on their orientation,
;; their tendency to couple/have sex, and if they meet.
;; To better show that coupling has occurred, the patches below
;; the couple turn gray.

to couple  ;; turtle procedure 
  let potential-partner one-of (turtles-at -1 0) with [not coupled?] 
  if potential-partner != nobody
    [ 
      ;; check for sexual orientation compatibility 
      
      if ( ((male? and [likesboys?] of potential-partner) or 
            (not male? and [likesgirls?] of potential-partner ))      ;; if the partner is willing to mate
        and ( (likesboys? and [male?] of potential-partner) or 
              (likesgirls? and not [male?] of potential-partner ) ) ) ;; if the person in question is willing to mate
      [ 
      ;; normal coupling probability
      
      if random-float max-coupling-factor < [coupling-tendency] of potential-partner
      [ set partner potential-partner
        set coupled? true
        ask partner [ set coupled? true ]
        ask partner [ set partner myself ]
        ask partner [ set pcolor gray - 3]
        move-to patch-here ;; move to center of patch
        ask partner [move-to patch-here] ;; partner moves to center of patch
        set pcolor gray - 3 ]]
      ]
end 

;; If two persons are together for longer than either person's 
;; commitment variable allows, the couple breaks up.

to uncouple  ;; turtle procedure
  if coupled? 
    [ if (couple-length > commitment) or
         ([couple-length] of partner) > ([commitment] of partner)
        [ set coupled? false
          set couple-length 0
          ask partner [ set couple-length 0 ]
          set pcolor black
          ask partner [set pcolor black]
          ask partner [ set partner nobody ]
          ask partner [ set coupled? false ]
          set partner nobody ] ]
end 


;; Note that for condom use to occur, both people must want to use one.  If
;; either person chooses not to use a condom, infection is possible.  Changing the
;; primitive to AND in the third line will make it such that if either person
;; wants to use a condom, infection will not occur.

to infect  ;; turtle procedure
  if coupled? and infected? 
    [ if random-float max-condom-factor > condom-use or
         random-float max-condom-factor > ([condom-use] of partner)
        [ if random-float 100 < infection-chance
            [ ask partner [ set infected? true
                assign-shape
                ]  ]  ]  ]
end 



;;;
;;; REPORTER PROCEDURES
;;;

;; turtle procedures

to-report likesboys?
  ifelse ( (male? and orientation = "straight")
           or (not male? and orientation = "gay") )
  [report false] ;; straight men and lesbians don't like men
  [report true]  ;; everyone else likes men
end 

to-report likesgirls?
  ifelse ( (male? and orientation = "gay")
           or (not male? and orientation = "straight") )
  [report false] ;; gay men and straight women don't like women
  [report true]  ;; everyone else likes women
end 



;;;
;;; MONITOR PROCEDURES
;;;

to-report %infected
  ifelse any? turtles
    [ report (count turtles with [infected?] / count turtles) * 100 ]
    [ report 0 ]
end 

to-report %straight-infected
  ifelse any? turtles with [orientation = "straight"]
  [ report 100 * (count turtles with [infected? and orientation = "straight"]) / (count turtles with [orientation = "straight"]) ]
  [ report 0 ]
end 

to-report %bi-infected
  ifelse any? turtles with [orientation = "bi"]
  [ report 100 * (count turtles with [infected? and orientation = "bi"]) / (count turtles with [orientation = "bi"]) ]
  [ report 0 ]
end 

to-report %gay-infected
  ifelse any? turtles with [orientation = "gay"]
  [ report 100 * (count turtles with [infected? and orientation = "gay"]) / (count turtles with [orientation = "gay"]) ]
  [ report 0 ]
end 

to-report %F-infected
  ifelse any? turtles with [not male?]
  [ report 100 * count turtles with [infected? and not male?] / count turtles with [not male?] ]
  [ report 0 ]
end 

to-report %M-infected
  ifelse any? turtles with [male?]
  [ report 100 * count turtles with [infected? and male?] / count turtles with [male?] ]
  [ report 0 ]
end 


;;
;; Reporters for each combination of male/female gay/straight/bi
;; Not currently on display in the model (to avoid information overload),
;; but readily available if the user wishes to add monitors
;; to view additional demographic information
;;

to-report %M-straight-infected
  ifelse any? turtles with [male? and orientation = "straight"]
  [ report 100 * count turtles with [infected? and male? and orientation = "straight"] / count turtles with [male? and orientation = "straight"]]
  [ report 0 ]
end 

to-report %F-straight-infected
  ifelse any? turtles with [not male? and orientation = "straight"]
  [ report 100 * count turtles with [infected? and not male? and orientation = "straight"] / count turtles with [not male? and orientation = "straight"]]
  [ report 0 ]
end 

to-report %M-bi-infected
  ifelse any? turtles with [male? and orientation = "bi"]
  [ report 100 * count turtles with [infected? and male? and orientation = "bi"] / count turtles with [male? and orientation = "bi"]]
  [ report 0 ]
end 

to-report %F-bi-infected
  ifelse any? turtles with [not male? and orientation = "bi"]
  [ report 100 * count turtles with [infected? and not male? and orientation = "bi"] / count turtles with [not male? and orientation = "bi"]]
  [ report 0 ]
end 

to-report %M-gay-infected
  ifelse any? turtles with [male? and orientation = "gay"]
  [ report 100 * count turtles with [infected? and male? and orientation = "gay"] / count turtles with [male? and orientation = "gay"]]
  [ report 0 ]
end 

to-report %F-gay-infected
  ifelse any? turtles with [not male? and orientation = "gay"]
  [ report 100 * count turtles with [infected? and not male? and orientation = "gay"] / count turtles with [not male? and orientation = "gay"]]
  [ report 0 ]
end 

There is only one version of this model, created over 12 years ago by Landon Basham.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.