NetLogo / NW-Extension

This is the NetLogo Network Extension. For general information about NetLogo, see:
http://ccl.northwestern.edu/netlogo/
Other
62 stars 25 forks source link

Small world Kleinberg model removes links to neighbors #158

Closed ramy89 closed 8 years ago

ramy89 commented 9 years ago

I tried to generate a Kleinberg graph using:

nw:generate-small-world turtles links 7 7 2.0 false

And this is what I got:

percolation_thresholds view

Why some nodes don't have links to their neighbors? shouldn't the Kleinberg model start with a regular lattice and then add long distance links?

SethTisue commented 9 years ago

see also http://stackoverflow.com/questions/31035932/kleinberg-model-in-nw-extension-is-wrong

qiemem commented 8 years ago

As Marlon pointed out in the thread that @SethTisue linked to, the network is being generated correctly, it's just that it doesn't layout in correct order.

I've changed it so that the turtles are now generated in the order that they appear in the lattice so you'll be able to generate what you want with something like:

nw:generate-small-world turtles links world-width world-height 2.0 false
(forach (sort turtles) (sort patches) [ ask ?1 [ move-to ?2 ] ])

These changes should appear in NetLogo 6.0.