Additive Mechanisms for Interorganizational Hyperlink Networks

Additive Mechanisms for Interorganizational Hyperlink Networks preview image

1 collaborator

Default-person Jiawei Fu (Author)

Tags

(This model has yet to be categorized with any tags)
Model group MAM-2015 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.0 • Viewed 638 times • Downloaded 54 times • Run 0 times
Download the 'Additive Mechanisms for Interorganizational Hyperlink 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.)


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

turtles-own [wealth]
globals[number-links number-homophily number-RDT number-PA p]
extensions[nw]

to setup
  clear-all
  nw:set-context turtles links
  ask patches [set pcolor violet + 1]
  create-turtles number-of-nodes [  ;; users can choose the number of nodes and number of links in the network that they want using a slider
    set wealth random 30            ;; each node has a random wealth 
    set shape "circle"
    set color scale-color green wealth -10 30    ;; the color is used to represent the wealth of the turtle; with darker color representing smaller wealth
    set size 1
    setxy random-xcor random-ycor]
  reset-ticks
end 

to go
  ask links [set color gray]                   ;; links formed in previous ticks turn gray
  ask one-of turtles [                         ;; at each tick, based on a random probability, a random turtle either chooses to link to another turtle
    make-node find-partner wealth]     ;; based on the principle of homophily, resource dependence, or preferential attchment, the sum of probabilities is 1
  if number-links >= number-of-links 
  [ask links 
    [set color gray] 
    stop] ;; if the number of links exceeds the number of links that the user wants, the model stops
  tick
  if layout? [layout]
end 

to make-node [node]
  if node != nobody
  [
    create-link-with node 
    [set color red]
    move-to node
    fd 8
  ]
  set number-links number-links + 1
end 

to-report find-partner [W]
  set p random 100    ;; random probability of RD, PA, and homophily, totaling 100 percent
  ifelse p < probability-of-homophily ;; based on users' preferred probability of homophily, an agent chooses another agent that has similar wealth with itself
  [set number-homophily number-homophily + 1 
    report one-of other turtles with [wealth = W or wealth = W - 1 or wealth = W + 1]
  ]
  [ifelse p > 100 - probability-of-RDT 
    [set number-RDT number-RDT + 1 
      report one-of other turtles with [wealth > W]
    ] ;; otherwise, if the probability is about 100 - probability of resource dependence effect
    [set number-PA number-PA + 1 
      report one-of max-n-of max-number other turtles [count link-neighbors]  ;; a user can determine the number of the top agents with the highest degree centrality
    ]
  ]      ;; resource dependence: an agent chooses another agent that has wealth larger than its own
end         ;; prefential attachment: an agent chooses another agent to link based on its degree. The agent is among the top XX in terms of degree


           ;;Layout
           ;; resize-nodes

to resize-nodes
  ifelse all? turtles [size <= 1]
  [
    ;; a node is a circle with diameter determined by
    ;; the SIZE variable; using SQRT makes the circle's
    ;; area proportional to its degree
    ask turtles 
    [ set size sqrt sqrt count link-neighbors ] ;; sqrt sqrt makes the agents visually attractive instead of too large
  ]
  [
    ask turtles 
    [ set size 1 ]
  ]
end 

to layout  ;; this is based on the preferential attachment model in the model lirbaility
           ;; the number 3 here is arbitrary; more repetitions slows down the
           ;; model, but too few gives poor layouts
  repeat 3 [
    ;; the more turtles we have to fit into the same amount of space,
    ;; the smaller the inputs to layout-spring we'll need to use
    let factor sqrt count turtles
    ;; numbers here are arbitrarily chosen for pleasing appearance
    layout-spring turtles links (1 / factor) (10 / factor) (10 / factor)
    display  ;; for smooth animation
  ]
  ;; don't bump the edges of the world
  let x-offset max [xcor] of turtles + min [xcor] of turtles
  let y-offset max [ycor] of turtles + min [ycor] of turtles
  ;; big jumps look funny, so only adjust a little each time
  set x-offset limit-magnitude x-offset 0.1
  set y-offset limit-magnitude y-offset 0.1
  ask turtles [ setxy (xcor - x-offset / 2) (ycor - y-offset / 2) ]
end 

to-report limit-magnitude [number limit]
  if number > limit [ report limit ]
  if number < (- limit) [ report (- limit) ]
  report number
end 

There is only one version of this model, created almost 9 years ago by Jiawei Fu.

Attached files

File Type Description Last updated
Additive Mechanisms for Interorganizational Hyperlink Networks.png preview Preview for 'Additive Mechanisms for Interorganizational Hyperlink Networks' almost 9 years ago, by Jiawei Fu Download
Contagion.nlogo extension Preferential Attachment and Contagion model almost 9 years ago, by Jiawei Fu Download
EECS 472 Poster- Jiawei Fu.pdf pdf Poster Slide almost 9 years ago, by Jiawei Fu Download
Final Project Proposal - Fu.pdf pdf Project Proposal almost 9 years ago, by Jiawei Fu Download
Final Project Report - Fu.pdf pdf Final Project Report and Analyses almost 9 years ago, by Jiawei Fu Download
Fu_Jiawei_Slam.pdf pdf Slam Slides almost 9 years ago, by Jiawei Fu Download
Homophily.nlogo extension Homophily model almost 9 years ago, by Jiawei Fu Download
JiaweiFu_ June1.pdf pdf Progress Report 3 almost 9 years ago, by Jiawei Fu Download
JiaweiFu_ May18.pdf pdf Progress Report 1 almost 9 years ago, by Jiawei Fu Download
JiaweiFu_ May25.pdf pdf Progress Report 2 almost 9 years ago, by Jiawei Fu Download
Resource Dependence.nlogo extension Resource dependence model almost 9 years ago, by Jiawei Fu Download

This model does not have any ancestors.

This model does not have any descendants.