Leonardi Model 3

Leonardi Model 3 preview image

1 collaborator

Default-person Eleanor Anderson (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'Technology Use'
Model group MAM-2013 | Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.5 • Viewed 194 times • Downloaded 8 times • Run 0 times
Download the 'Leonardi Model 3' 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

extensions [table nw]

globals [social-influence material-influence team-radius]

breed [people person]
breed [expectations expectation]
breed [technologies technology]


people-own [usage understanding influencer persistence teams node-clustering-coefficient eigen-cent]
expectations-own [feature strength]
technologies-own [affordances]


directed-link-breed [holds hold]

undirected-link-breed [connections connection]

to setup
  ca  
  
  ; If auto-total-people is on, make sure the number of people expecting a, b and both doesn't exceed
  ;; the total number set. 
  ;; Populate the rest of the world (up to the total number set) with people with no expectations.

  ifelse auto-total-people != "off" and #-expecting-a + #-expecting-b + #-expecting-both > auto-total-people
  [ user-message (word "There are too many people. Turn auto-total off, or reduce the number of people expecting a, b or both.")]
  [ if auto-total-people != "off"
    [ set #-no-expectations auto-total-people - (#-expecting-a + #-expecting-b + #-expecting-both)]
  

  ;; create the total number of people who will be in the model
  ;; distribute them randomly around the world
  ;; format their size and shape
  ;; set their usage blank
  ;; format their color to reflect their usage
  ;; give them no team affiliations
  ;; give each of them a blank table that will hold their expectations about the technology
  
  create-people total-# 
  [ setxy random-pxcor random-pycor
    set shape "person"
    set size 1.6
    set usage []
    color-code usage .8 
    set teams []
    set understanding table:make ]  
  
  
  ;; for the number of people expecting only a, pick people with blank tables, and set their understanding of feature a to 1 
  ask n-of #-expecting-a people with [ table:length understanding < 1 ]
  [ table:put understanding "a" 1 ]
  
  ;; for the number of people expecting only b, pick people with blank tables, and set their understanding of feature b to 1 
  ask n-of #-expecting-b people with [ table:length understanding < 1 ]
  [ table:put understanding "b" 1 ]
  
  ;; for the number of people expecting a and b, pick people with blank tables, and set their understanding of 
  ;; features a and b to 1   
  ask n-of #-expecting-both people with [ table:length understanding < 1 ]
  [ table:put understanding "a" 1
    table:put understanding "b" 1 ] 
  
  
  ;; put people into a social network
  build-network
  calculate-centralities
  do-layout


  if add-#-eigenvector != "off"
  [ add-expectations 
    adjust-counts  ]


  ask people
  
  ;;  build a network of expectations to provide a visual representation of each person's table of understanding
  [ update-expectations 
    
    ;; if limited persistence is on, give people a persistence of 3
    ;; if it's off, give people a persistence that is extremely high   
    ifelse limited-persistence
    [ set persistence 3 ]
    [ set persistence 1000 ] ]

  ;; format the network of expectations
  ask expectations
  [ format-expectations ]
  


  ;; set up the technology 
  adopt-technology  

  set social-influence []
  set material-influence []


  reset-ticks

]
end 

to build-network
  ;; create a social network meant to mimic a workplace:
  ;; everyone is a member of one or more small teams (up to 4 teams comprised of 2-5 people each (??))
  ;; some people are also connected to others across the organization
  
  
  ;; set the network to be people and their connections
  nw:set-context people connections
  
  ;; decide how far away people should look for for team-members
  set-team-radius
  
  ;; ask people one at a time to each lead a small team (by asking a few neighbors to join)
  ;; until everyone is on at least one team
  while [any? people with [ teams = [] ] ]
  [ ask one-of people with [ teams = [] ]
    [ set teams (list who)
      ;show teams
      ask n-of (1 + random 4) other people in-radius team-radius with [length teams < 4]
      ;; [what happens if there isn't at least one other person already on less than 4 teams in your radius??]
      
      [set teams fput [who] of myself teams
        set teams (sentence teams)
        ;show teams 
      ] ] ]
  
  ;; create links between all the members of each team
  ;; by going through each potential team name (i.e. the who number of the leader) 
  ;; and asking everyone who has that name as one of their list of teams to link up
  let roll-call 0
  while [roll-call <= total-#]
  [ ;show roll-call
    ask people
    [ if member? roll-call teams
      [ if any? other people with [ member? roll-call teams and connection-neighbor? myself = false ]
        [create-connections-with other people with [member? roll-call teams and connection-neighbor? myself = false ] ] ] ]
    set roll-call roll-call + 1 ]
  
  ;; make sure everyone in the network is connected to one giant component
  fix-network
  
  ;; give the network small-world properties
  make-small
end 

to set-team-radius
  
  ;; start with people looking only within 1 patch of themselves
  set team-radius 1
  
  ;; increment the distance up until everyone has at least 4 potential team members
  while [ any? people with [count other people in-radius team-radius < 4] ]
  [ set team-radius team-radius + 1]
end 

to fix-network
  
  ;; if there is more than one component, ask one person at a time to make a connection 
  ;; with someone in another component until there is only one giant component
  
  ;show nw:weak-component-clusters
  if length nw:weak-component-clusters > 1
  [ while [ length nw:weak-component-clusters > 1 ]
    [ ask one-of people 
      [create-connection-with one-of people with [nw:distance-to myself = false] ] ] ]
  ;show nw:weak-component-clusters 
end 

to make-small
  
  ;; ask apprx 10% of peopel to create extra cross-world connections
  ask n-of (ceiling (total-# / 10) ) people
  [ create-connection-with one-of other people ]
    ;show "new link"
end 

to calculate-centralities
  ask people
  [ set eigen-cent nw:eigenvector-centrality ]
end 

to do-layout
  
  layout-tutte (people with [count connection-neighbors = 1]) connections 14 
end 

to update-expectations
  ;; ask people whose table of understandings doesn't match the visual representation of their expectations
  ask people with [table:length understanding != count out-hold-neighbors]
  
  ;; create a blank slate 
  [ ask out-hold-neighbors 
    [ die ]
  
  ;; build the network of expectations up from the understanding table  
  let instructions table:keys understanding
  while [instructions != []]
  [ hatch-expectations 1
    [ create-hold-from myself
      ask my-in-holds [hide-link] 
      set feature first instructions
      set strength [table:get understanding first instructions] of myself 
      set instructions but-first instructions  ] ] ]
  
  ask expectations
  [ format-expectations ] 
end 

to format-expectations
  
  ;; make expectations color, shape and placement reflect what they indicate
  
if strength > 1
  [ set strength 1 ]
  if strength < -1
  [ set strength -1 ]  
  

  if strength > 0
  [ show-turtle 
    set shape "circle"
    set size .5 ]

  if strength < 0
  [ show-turtle
    set shape "x"
    set size .6 ]

  if strength = 0
  [hide-turtle]
  
  
  if feature = "a"
  [ setxy ( [ xcor ] of one-of in-hold-neighbors - .5) ( [ ycor ] of one-of in-hold-neighbors + .5)  ] 
  if feature = "b"
  [ setxy ( [ xcor ] of one-of in-hold-neighbors + .5) ( [ ycor ] of one-of in-hold-neighbors + .5) ]
  
  color-code feature 1.5
end 

to adopt-technology
 
create-technologies 1
  [ set shape "box"
    set size 3
    
    ;; create a blank table that will hold affordances
    set affordances table:make
    
    ;; fill in the table from the features selected by the user
    let instructions (sentence technology-affordances)
    while [instructions != [] ]
  [ table:put affordances first instructions 1
    set instructions but-first instructions ] 
  
  color-code (table:keys affordances) -2.5]
end 

to color-code [thing number]
  ;; color code expectations, usage and affordances to  provide a visual indication of whether they match.  
  
  if member? "a" thing and not member? "b" thing
    [ set color blue + number ] 
  if member? "b" thing and not member? "a" thing
    [ set color yellow + number ] 
  if member? "a" thing and member? "b" thing
    [ set color green + number] 
  if not member? "a" thing and not member? "b" thing
    [ set color gray + number ]
end 

to add-expectations
  
  ;; translate the string into instructions
  let letter item 0 add-#-eigenvector
  let number read-from-string item 2 add-#-eigenvector
  let value item 4 add-#-eigenvector
  
  if value = "h"
  [ set value total-# - number ]
  if value = "l" 
  [ set value 0 ]
  if value = "a"
  [ set value floor (total-# - number) / 2 ]
  
  let all-eigen-cent sort-on [nw:eigenvector-centrality] people
  
  ;; identify the people with the lowest, median, or highest eigenvector centrality
  ;; clear their table of understandings and replace with either "a" or "b"
  repeat number 
  [ ask item value all-eigen-cent
    [ table:clear understanding
      table:put understanding letter 1 ] 
    set value value + 1 ]
end 

to adjust-counts
  
  ;; make sliders reflect actual counts
  set #-expecting-a count people with [ member? "a" table:keys understanding and not member? "b" table:keys understanding]
  set #-expecting-b count people with [ not member? "a" table:keys understanding and member? "b" table:keys understanding]
  set #-expecting-both count people with [ member? "a" table:keys understanding and member? "b" table:keys understanding]
  set #-no-expectations count people with [ not member? "a" table:keys understanding and not member? "b" table:keys understanding]
end 

to go
  
  ;; stop conditions
  if all? people [persistence = 0] 
    [ stop ]
  if ticks > 99 and (all? people [usage = []] 
    or all? people [usage = ["a"]] 
    or all? people [usage = ["b"]] 
    or all? people [usage = ["a" "b"] or usage = ["b" "a"]]) 
    [ stop ]
  
  ;; running the model
  ask people
  [ interact
    update-expectations ] 
  
  update-influences
  tick  
end   

to interact
  
  set influencer nobody
  
  if persistence > 0
  
  [ determine-influencer ]
    
    ;; if I am being influenced by a person (social interaction), then learn from their expectations
    if is-person? influencer 
    [ learn-from ([understanding] of influencer) 1 .2]
    
    ;; if I am being influenced by the technology (material interaction), then if I have some expectation of
    ;; what the technology is for I will try to use it accordingly.
    ;; otherwise I will learn from the technology
    if is-technology? influencer 
    [ ifelse table:length understanding > 0
      [ use-technology ] 
      [ learn-from ([affordances] of influencer) tech-transparency 1 ]  
    ;; increment my persistence down 
    set persistence persistence - 1 ] 
end  

to determine-influencer
  
  
  ;; figure out whether influencer will be the technology or a person
  if random-float 1 < .25
  [ ifelse random-float 1 < proportion-material-influence
    [ set influencer one-of technologies ]
    [ set influencer one-of connection-neighbors ] ] 

  ;; (THINK ABOUT CHANGING THIS TO A SYSTEM BASED ON LINK WEIGHTS
  ;; THEN THE WEIGHT FOR THE TECHNOLOGY CAN INCREASE BASED ON EXPECTATIONS)
end 

to learn-from [source chance influence]
  
  ;; set probability of learning
  ;; if the influencer has any features to learn from,
  ;; pick one to be the insight I learn
  if table:length source > 0 and random-float 1 < chance
  [ let insight one-of table:keys source
    
    
    ;; if that feature is new to me, put the insight into my table of understandings
    
    if not table:has-key? understanding insight
    [ table:put understanding insight 0 ]
    
    ;; determine whether this is going to be learning something positive or negative
    let direction 1
    if table:get source insight > 0
      [ set direction 1 ]
    if table:get source insight < 0
      [ set direction -1 ]
    
    ;; change expectation to be more positive/more negative 
    ;; (amount of change is .2 for people influencers, 1 for technology influencer)
    table:put understanding insight table:get understanding insight + influence * direction 
    
    ;; cap expectation strength at >= -1 and <= 1 
    if abs table:get understanding insight > 1
      [table:put understanding insight direction] 
    
    ;; adjust visual version of expectations to match understanding
    ask out-hold-neighbors with [feature = insight ]
    [ set strength [table:get understanding insight] of myself ] ]
end  

to use-technology
  
  ;; if can-learn-unexpectly is on, give a 5% chance of trying to learn from the technology before trying to use it 
  if can-learn-unexpectedly
  [ if random-float 1 < .05
    [ learn-from ([affordances] of influencer) tech-transparency 1 ] ] 
  
  ;; if I have any positive expectations, pick one of those to be the way I try to use the technology 
  if any? out-hold-neighbors with [strength > 0] 
  [ let use [feature] of one-of out-hold-neighbors with [ strength > 0 ]
    
    ;; if use-can-fail is on, set the chance that use will be successful down to 95%
    let chance-use-works 1
    if use-can-fail 
    [ set chance-use-works .95 ]
 
    ;; if the feature I'm trying to use is one of the technology's affordances, then put that feature into my usage (if use is successful)
    ;; and set my expectation for that feature fully to 1
    ;; if not, set my expectation for that feature fully negative and remove it from my usage 
    ifelse table:has-key? [affordances] of influencer use and random-float 1 < chance-use-works
    [ table:put understanding use 1 
      set usage lput use usage
      set usage remove-duplicates usage 
      color-code usage .8 ]
    [ table:put understanding use -1
      set usage remove use usage
      color-code usage .8 ]
    
    ;;ask my visual expectation network to adjust accordingly
    ask out-hold-neighbors with [feature = use ]
    [ set strength [table:get understanding use] of myself ]  ]
end  

to update-influences
  
  ;; list the proportion of people experiencing social and material influences at each tick
  if any? people with [persistence > 0]
  [ set social-influence fput (count people with [is-person? influencer] / count people with [persistence > 0]) social-influence
    set material-influence fput (count people with [is-technology? influencer] / count people with [persistence > 0]) material-influence ]
end 

to-report total-#
  ;; report the total number of people in the world
  report #-expecting-a + #-expecting-b + #-expecting-both + #-no-expectations
end 

to-report %-open-to-influence
  ;; report the % of people who are still open to being influenced out of the total 
  report count people with [persistence > 0 ] / total-#
end 

to-report %-being-influenced
  ;; report the % of people currently being influenced, out of the total (or out of the number open to being influenced)
  report count people with [influencer != nobody] / total-# ;count people with [persistence > 0]
end 

to-report average-social-influence
  ;; report the average % of people influenced by other people out of the number open to being influenced at each tick
  report sum social-influence / (length social-influence)
end 

to-report average-material-influence
  ;; report the average % of people influenced by the technology out of the number open to being influenced at each tick
  report sum material-influence / (length material-influence)
end 

to-report in-neighborhood? [ hood ]
  report ( member? end1 hood and member? end2 hood )
end 

to-report mean-clustering-coefficient
 
    let clustering-coefficient 0

    let total 0
    ask people with [ count connection-neighbors <= 1]
      [ set node-clustering-coefficient "undefined" ]
    ask people with [ count connection-neighbors > 1]
    [ let hood connection-neighbors
      set node-clustering-coefficient (2 * count connections with [ in-neighborhood? hood ] /
                                         ((count hood) * (count hood - 1)) )
      ;; find the sum for the value at turtles
      set total total + node-clustering-coefficient
    ]
    ;; take the average
    set clustering-coefficient total / count people with [count connection-neighbors > 1]
    report clustering-coefficient
end 

to-report path-length
  
nw:set-context people connections
report nw:mean-path-length  
end 

There are 2 versions of this model.

Uploaded by When Description Download
Eleanor Anderson almost 5 years ago finishing touches Download this version
Eleanor Anderson almost 5 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Eleanor_Anderson_final_poster.docx word poster almost 5 years ago, by Eleanor Anderson Download
Eleanor_Anderson_final_presentation.pptx powerpoint presentation slides almost 5 years ago, by Eleanor Anderson Download
EleanorAnderson_ 5 20 13.docx word progress report almost 5 years ago, by Eleanor Anderson Download
EleanorAnderson_ 5 27 13.docx word progress report almost 5 years ago, by Eleanor Anderson Download
EleanorAnderson_ 6 03 13.docx word progress report almost 5 years ago, by Eleanor Anderson Download
EleanorAndersonFinalPaper.docx word Final Paper almost 5 years ago, by Eleanor Anderson Download
Leonardi Model 3.png preview Preview for 'Leonardi Model 3' almost 5 years ago, by Eleanor Anderson Download
project update 5 18 13.docx word progress report almost 5 years ago, by Eleanor Anderson Download

This model does not have any ancestors.

This model does not have any descendants.