Social Capital and Social Networks

Social Capital and Social Networks preview image

1 collaborator

Default-person Keith Windsor (Author)

Tags

game theory 

Tagged by Keith Windsor 7 months ago

social capital 

Tagged by Keith Windsor 7 months ago

social networks 

Tagged by Keith Windsor 7 months ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 53 times • Downloaded 4 times • Run 0 times
Download the 'Social Capital and Social Networks' 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

globals [ capital-list  total-capital weighted-degree-list total-weighted-degree average-weighted-degree
  P1RProR P1RProNR P1RAntiR P1RAntiNR P2RProR P2RProNR P2RAntiR P2RAntiNR Connections Connected-People Dunbar Bond max-connected-capital ]

links-own [ capital happy? link-weighted-degree-list max-weighted-degree ]

turtles-own [ degree weight-list weighted-degree ]

;; %-Reaction-to-Pro-Behaviour is the probability of Player 2 reacting to pro-group action by Player 1, it is a social norm and applies to all people
;; Reaction to Anti-Behaviour decreases the degree to which social capital reduces the level of anti group action, it has the effect of increasing reaction to anti group action

to setup

  ;; set the initial values of every variable

  clear-all ;; clear all old settings

  ask patches [ set pcolor white]  ;; makes the background white

  ;; set up the network

  create-turtles People [ set color black set shape "person"  ] ;; this sets the group size and the people characteristics

  set connected-people ( 2 + ceiling ( ( People - 2 ) * ( Interdependence / 10 ) ) ) ;; sets the number of people with connections based on the level of Atraction

  set connections (  ceiling ( ( connected-people - 1 ) * ( Interdependence / 10 ) ) ) ;; sets the number of Connections for Connected People based on the level of Attraction

  ask n-of connected-people turtles [ create-links-with n-of connections other turtles ] ;; creates the Connections between Connected People and other People

  set max-connected-capital ( count turtles with [ count my-links > 0 ] - 1 ) * 10 ;; sets the maximum group social capital based on the number of connected people rather than
  ;; all the people in the group, some of whom may not be connected

  repeat 30 [ layout-spring turtles links 0.2 18 1 ] ;; spreads out the network to improve presentation

  ;; set the reward table values

  set P1RProR 1 set P1RProNR -2 set P1RAntiR -1 set P1RAntiNR 2 set P2RProR 1 set P2RProNR 2 set P2RAntiR -1 set P2RAntiNR -2

  ;; set the maximum level of bonding capital for a person following Rbin Dunbar's 150 theory

  set Dunbar (ifelse-value
   People < 6 [ People * 10 ]
   People > 5 and People < 16 [ 50 + ( ( People - 5 ) * 6.6 ) ]
   People > 15 and People < 50 [ 116 + ( ( People - 15 ) * 4.4 ) ]
               [ 263 + ( ( People - 50 ) * 2.9 ) ])

  set Bond Interdependence * Dunbar / ( People * 10 )

  ;; set up the social capital measure using link capital

  ask links [ set capital random Bond + 1
    set thickness capital / 40 set color black set shape "capital"]

  ;; sets the initial capital of each link and link characteristics

  set capital-list [ capital ] of links ;; creates a list of all the link capitals

  set total-capital 2 * sum capital-list / count turtles ;; total-capital is the average of the total link capital per person which is the average weighted degree and group social capital

  ;; set up the social capital measure using turtle degree and link weight

  ask turtles [ set degree count my-links set weight-list [ capital ] of my-links

    set weighted-degree sum weight-list

    set size (1 + weighted-degree / ( 2 * count turtles ) ) ] ;; sets the degree and weighted-degree of each turtle

  set weighted-degree-list [ weighted-degree ] of turtles ;; lists the weighted degrees of all the turtles
  set total-weighted-degree sum weighted-degree-list ;; calculates the total weighted degree of all the turtles combined
  set average-weighted-degree total-weighted-degree / count turtles ;; calculates the average weighted degree which is the social capital of the group

  ;; set up the link view of the weighted degree of the people at each end

  ask links [ set link-weighted-degree-list [ weighted-degree ] of [ both-ends ] of self

  set max-weighted-degree max [ link-weighted-degree-list ] of self ]

  reset-ticks
end 

to go

  every 0.05 [

  if count links = 0 [ set average-weighted-degree 0 set total-capital 0 plot total-capital ask turtles [ die ] stop  ] ;; stops the run if social capital is zero

    ask links [ repeat ( capital ) [ decide reset ] ] ;; Player 1 decides whether to act pro-group or anti-group based on probable rewards

   ;; and the change in social capital for each pair is based on rewards for both Player 1 and Player 2

  ask one-of turtles with [ degree > 0 ] [ grow ] ;; people decide whether to add or subtract connections to other people based on their level of social capital

  repeat 30 [ layout-spring turtles links 0.2 18 1 ]

  set max-connected-capital ( count turtles with [ degree > 0 ] - 1 ) * 10 ;; sets the maximum capital of the number of connected people rather than
  ;; all the people in the group, some of whom may be disconnected

  ;; set the NEW values of turtle variables and re-calculate group capital based on people attributes

  ask turtles [
    set degree count my-links
    set weight-list [ capital ] of my-links
    set weighted-degree sum weight-list
    set size (1 + weighted-degree / ( 2 * count turtles ) )
  ]
  set weighted-degree-list [ weighted-degree ] of turtles
  set total-weighted-degree sum weighted-degree-list
  set average-weighted-degree total-weighted-degree / count turtles


  ;; set the NEW values of link capital and re-calculate group social capital based on link attributes

  set capital-list [ capital ] of links
  set total-capital 2 * sum capital-list / count turtles

  ;; reset the link view of the weighted degree of the people at each end

  ask links [ set link-weighted-degree-list [ weighted-degree ] of [ both-ends ] of self

  set max-weighted-degree max [ link-weighted-degree-list ] of self ]



  tick ] ;; go again
end 

to decide

  ;; Player 1 decides whether to act pro or anti Player 2

  ;; set the current pro and anti reaction probabilities
  let ProR ( Reaction-to-Pro-Behaviour / 100 )
  let ProNR 1 - ProR
  let AntiR (1 - ( Capital / ( Reaction-to-Anti-Behaviour * 10 ) ) ) ;; increasing Reaction to Anti Behaviour lessens the reduction impact of higher Capital on AntiR
  let AntiNR 1 - AntiR

  ;; calculate the current pro and anti rewards for Player 1
  let P1RPro ProR * P1RProR + ProNR * P1RProNR
  let P1RAnti AntiR * P1RAntiR + AntiNR * P1RAntiNR

  ;; Player 1 decides on pro or anti group action
  ifelse P1RPro >= P1RAnti  [ set happy? true ]  [ set happy? false ] ;; happy attribute equals do pro, not happy equals do anti
end 

to reset

  ;; based on P1 decision, calculate the increase or decrease in capital for Player 1 plus Player 2, the change in individual link capital
  let ProR ( Reaction-to-Pro-Behaviour / 100 )
   ;; let ProNR 1 - ProR only needed if reward table changed
  let AntiR 1 - ( capital / ( Reaction-to-Anti-Behaviour * 10 ) )
   ;; let AntiNR 1 - AntiR only needed if reward table changed

  ifelse happy? = true

  [ if max-weighted-degree < Dunbar [ set capital capital + ( ProR * 0.01 ) ] ] ;; set new capital for pro action if people at each end have not exceeded capacity
  ;; different equation required if reward table revised
  ;; ( ProR * ( P1RProR + P2RProR ) + ProNR * ( P1RProNR + P2RProNR ) )

  [ set capital capital + ( AntiR * -0.01 ) ] ;; set new capital for anti action, different equation required if reward table revised
  ;; ( AntiR * ( P1RAntiR + P2RAntiR ) + AntiNR * ( P1RAntiNR + P2RAntiNR ) )

  ask links [ if capital >= 10 [ set capital 10 ] ] ;; restricts the capital of a link to the maximum possible
  ask links [ set thickness capital / 40  ] ;; sets the size of the link to match new capital
end 

to grow

 ;; people decide whether to create new connections or break old ones based on their personal level of social capital

 ;; individual person decides whether to add a connection

 if ( weighted-degree / degree ) > ( 10 - ( ( Interdependence ) / 1.5 ) ) and weighted-degree < Dunbar [ create-link-with one-of other turtles
    [ set capital random Interdependence + 1 set thickness capital / 40 set color red set shape "capital" ]
    set degree count my-links set size (1 + weighted-degree / ( 2 * count turtles ) ) ]

 ;; individual person decides whether to sever a connection

 if ( weighted-degree / degree ) <  ( ( 10 - Interdependence  ) / 1.5  ) and ( count my-links > 0 )
    [ ask one-of my-links  [ die ]
    set degree count my-links set size (1 + weighted-degree / ( 2 * count turtles ) ) ]
end 

There is only one version of this model, created 7 months ago by Keith Windsor.

Attached files

File Type Description Last updated
Social Capital and Social Networks.png preview Preview for 'Social Capital and Social Networks' 7 months ago, by Keith Windsor Download

This model does not have any ancestors.

This model does not have any descendants.