Adapting preferential attachment model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Adapting preferential attachment model

NetLogo-Users mailing list
I'm trying to adapt the (simple) Preferential Attachment Network model (available in the Netlogo Models library) to include a slider variable that determines network structure. According to the theory of the Preferential Attachment model (or 'Opinion Leader' model) each individual in the network is assigned a number of ties, k, according to the distribution p(k) ∝ k^−γ, and connected randomly to this number of people. I thus want to have a slider for which i can adapt γ.
 
 In the heart of the original code partners and links are chosen randomly, as such:
 

 to create-new-nodes [n]
    clear-all
    ask patches [ set pcolor white ]
    create-nodes n [
    set color red
    set shape "circle"
  ]

    reset-ticks
end

to wire-pref-attach
  create-new-nodes 2 ; create the first two nodes (0 and 1)
  ask node 0 [ create-edge-with node 1] ; link them together
  create-nodes num-nodes - 2 [
    create-edge-with [one-of both-ends] of one-of edges ; pref select old node with more links
    set color red
    set shape "circle"
  ]
  radial-layout

end

to radial-layout
  layout-radial nodes edges (node 0)
end How should I adapt this code to include the slider for the gamma parameter?
 

 Thanks!