Social Contagion

No preview image

1 collaborator

Default-person Stephen Cranney (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.4 • Viewed 224 times • Downloaded 6 times • Run 0 times
Download the 'Social Contagion' 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 demonstrates the spread of a social contagion through a network. This model largely relies on the coding framework of the "virus on a network" model, and can be viewed as derivative. Conceptually, the significant differences are 1) this model includes controls for random as well as network-related spread, 2) per the social contagion model, how many ties are infected affects both susceptibility and recovery rates, and 3) the concept of immunity is not in this model.

HOW IT WORKS

Each time step (tick), a certain number of nodes (TOTAL-SPREAD) are exposed to the contagion. How many are exposed via random selection and how many are exposed through networks is determined by the COLD_PROP slider, which gives the proportion of exposures via randomness as opposed to through networks. Susceptible nodes (colored green), if chosen to be exposed, will be infected with a probability given by the VIRUS-SPREAD-CHANCE slider.

Only every so often (determined by the VIRUS-CHECK-FREQUENCY slider) do the nodes check whether they are infected. For most social contagion models this is simply set to 1. When the virus has been detected, there is a probability that the virus will be removed (determined by the RECOVERY-CHANCE slider), this is weighted by the number of infected neighbors the person has, which is in turn weighted by an ADOPT-WEIGHT, which represents the number of percentage points higher risk the person incurs per infected connection. Similarly, the RETENTION-WEIGHT represents the number of percentage points lower risk of recovering for each infected link they have.

Note that if the model tries to expose more nodes than there are available uninfected nodes, an error will occur. Also note that if the weighted retention probabilities drop below zero, no individuals will recover.

HOW TO USE IT

Using the sliders, initialize the different starting parameters.

The network that is created is based on proximity (Euclidean distance) between nodes. A node is randomly chosen and connected to the nearest node that it is not already connected to. This process is repeated until the network has the correct number of links to give the specified average node degree.

The INITIAL-OUTBREAK-SIZE slider determines how many of the nodes will start the simulation infected with the virus.

Then press SETUP to create the network. Press GO to run the model. The model will stop running once the virus has completely died out.

The different sliders (discussed in "How it Works" above) can be adjusted before pressing GO, or while the model is running.

The NETWORK STATUS plot shows the number of nodes in each state over time.

THINGS TO NOTICE

Try to figure out what the optimal network parameters are for social contagion-type growth.

THINGS TO TRY

Set the initial population to one thousand and start with 1 infected node. What characteristics are needed for one "thought leader" to start something that everybody adopts?

EXTENDING THE MODEL

This model relies on raw number and raw percentages in its parameters. If, for example, the weights have diminishing returns this can be easily adjusted and modelled.

RELATED MODELS

Virus, Disease, Preferential Attachment, Diffusion on a Directed Network, Virus on a Network

NETLOGO FEATURES

Links are used for modeling the network. The layout-spring primitive is used to position the nodes and links such that the structure of the network is visually clear.

CITATIONS

The virus model this model is based on is cited below.

Stonedahl, F. and Wilensky, U. (2008). NetLogo Virus on a Network model. http://ccl.northwestern.edu/netlogo/models/VirusonaNetwork. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

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 turtle is infectious
  virus-check-timer   ;; number of ticks since this turtle's last virus-check
  infected_neighbors   ;; number of neighbors who are infected
]

to setup
  clear-all
  setup-nodes
  set cold_prop .8
  set virus-check-frequency 1
  ask turtles [set infected_neighbors 0]
  set total_spread 10
  set retention_weight 1
  set adopt_weight 1

  setup-spatially-clustered-network
  ask n-of initial-outbreak-size turtles
    [ become-infected ]
  ask links [ set color white ]
  reset-ticks
end 

to setup-nodes
  set-default-shape turtles "circle"
  create-turtles number-of-nodes
  [
    ; for visual reasons, we don't put any nodes *too* close to the edges
    setxy (random-xcor * 0.95) (random-ycor * 0.95)
    become-susceptible
    set virus-check-timer random virus-check-frequency
  ]
end 

to setup-spatially-clustered-network
  let num-links (average-node-degree * number-of-nodes) / 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-nodes)) 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 ]
  ]
    countinfneighb
  spread-virus-networks
  spread-virus-cold
  do-virus-checks
  tick
end 

to countinfneighb
  ask turtles [
  set infected_neighbors count link-neighbors with [infected? ] ]
end 

to become-infected  ;; turtle procedure
  set infected? true
  set color red
end 

to become-susceptible  ;; turtle procedure
  set infected? false
  set color blue
end 

to spread-virus-cold
  ask n-of (total_spread * cold_prop) turtles with [infected? = false]
        [ if random-float 100 < (virus-spread-chance + (adopt_weight * infected_neighbors))
            [ become-infected ] ]
end 

to spread-virus-networks
  ask n-of (total_spread * (1 - cold_prop)) turtles with [infected_neighbors > 0 and infected? = false]
        [ if random-float 100 < (virus-spread-chance + (adopt_weight * infected_neighbors)) ;relationship with probability itself is additive, not multiplicative for weights.
            [ become-infected ] ]
end 

to do-virus-checks
  ask turtles with [infected? and virus-check-timer = 0]
  [ifelse infected_neighbors = 0
    [if random 100 < recovery-chance
      [ become-susceptible ]]
    [if random 100 < (recovery-chance - (retention_weight * infected_neighbors))
      [ become-susceptible ]]
    ]
end 

There is only one version of this model, created over 5 years ago by Stephen Cranney.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.