Recruiting Movement Supporters

Recruiting Movement Supporters preview image

1 collaborator

Default-person David Knoke (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.3.0 • Viewed 7 times • Downloaded 1 time • Run 0 times
Download the 'Recruiting Movement Supporters' 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

;;  Recruiting Movement Supporters
;;  David Knoke and Tiffany Wu, University of Minnesota
;;  Last changed on August 3, 2024

extensions [nw ]         ;; Use NetLogo network extensions
breed [peoples people]   ;; Agents are called people

peoples-own              ;;  Attributes of people
[
  received?              ;; if true, the person accepted an invitation to attend a social movement event
]


globals [   ;; Globals enable counting the numbers of peoples with each of three colors
  initial-blue
  initial-red
  initial-green
  recruitpct
  resistpct
  neutralpct
]

to setup
  clear-all
  ask patches [set pcolor white]
  setup-peoples
  ask peoples [set size 4]
  ask peoples [set color blue]
  setup-spatially-clustered-network
  ask n-of N-Initiators peoples
    [ receive-invitation ]
  ask links [ set color black ]     ;; Make link color black
  setup-resist
  reset-ticks
end 

to setup-peoples
  set-default-shape peoples "person"    ;;  Sets people shape to person
  create-peoples N-of-people            ;;  Create number of people
  [
    setxy (random-xcor * 0.90) (random-ycor * 0.90)    ;; Don't put people close to the edges
  ]
end 

to setup-spatially-clustered-network
  let num-links (Average-people-degree * N-of-people) / 2

  ;; Generate links as before
  while [count links < num-links]
  [
    ask one-of peoples
    [
      let choice (min-one-of (other peoples with [not link-neighbor? myself]) [distance myself])
      if choice != nobody [ create-link-with choice ]
    ]
  ]

  ;; Ensure the network is a single connected component
  let components nw:weak-component-clusters
  while [length components > 1]  ;; While there's more than one component
  [
    let component1 item 0 components
    let component2 item 1 components

    ;; Connect a random agent from the first component to a random agent from the second
    ask one-of component1 [ create-link-with one-of component2 ]

    ;; Update the list of components
    set components nw:weak-component-clusters
  ]

  repeat 10
  [
    layout-spring peoples links 0.3 (world-width / (sqrt N-of-people)) 1
  ]
end 

;; Use Resistance-threshold slider to set the probability for an experiment (0 to 100)
;; Assign a resistance probability (0 to 100) to every person; persons above the threshold value are resisters who turn red

to setup-resist
  ask peoples with [color = blue] [
    if random 100 <= Resistance-threshold [set color red]
  ]
end 

to go
  if not any? peoples with [color = blue and any? link-neighbors with [color = green]]
    [ stop ]
  spread-invitation
  tally
  tick
end 

to receive-invitation
  set received? true
  set color green
end 

to spread-invitation
  ask peoples with [color = green]
    [ ask link-neighbors with [color = blue]    ;;   CHANGE ONLY BLUE TO GREEN    color 1 = green
            [ receive-invitation ] ]
end 

;; Report mean network measures

to-report mean-closeness-centrality
  report mean [ nw:closeness-centrality ] of peoples
end 

to-report mean-shortest-path-length
  report mean [ nw:mean-path-length ] of peoples
end 

to-report mean-clustering-coefficient
  report mean [ nw:clustering-coefficient ] of peoples
end 

to-report mean-betweenness
  report mean [ nw:betweenness-centrality ] of peoples
end 

to tally
  set recruitpct count (peoples with [color = green]) / (count peoples) * 100
  set resistpct count (peoples with [color = red]) / (count peoples) * 100
  set neutralpct count (peoples with [color = blue]) / (count peoples) * 100
end 

There is only one version of this model, created 3 days ago by David Knoke.

Attached files

File Type Description Last updated
Recruiting Movement Supporters.png preview Preview for 'Recruiting Movement Supporters' 3 days ago, by David Knoke Download

This model does not have any ancestors.

This model does not have any descendants.