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

Reproducible simulation runs with nw:generate-preferential-attachment does not work for min-degree > 4? #192

Closed janlorenz closed 5 years ago

janlorenz commented 5 years ago

I want to make a reproducible simulation run which starts with the generation of a network using nw:generate-preferential-attachment.

I used random-seed to set the seed for random number generation. This works fine when min-degree = 4 or less. Surprisingly, it does not work for min-degree = 5 or higher. When I clear-all, set the seed, and generate the network and randomly place nodes, this always looks different, with min-degree >= 5. It looks identical (as it should) for min-degree <=4. I provide a minimal example.

extensions [nw] to setup clear-all random-seed 1 nw:generate-preferential-attachment turtles links 100 5 ask turtles [setxy random-xcor random-ycor] end

Replace the "5" in line 5 with "4" and run setup two times each to see the difference.

Is there a way to make this work also for larger min-degree? What is the reason for this difference?

LaCuneta commented 5 years ago

Hey Jan, thanks for your issue and questions.

There have been a couple fixes to both preferential attachment and random number generator usage since the NetLogo 6.0.4 release. Can you try out the current v3.7.5 release of nw and see if that fixes your problem?

Please let us know either way, so we can either close this issue if things work for you or dig in further if not. Thanks, again.

janlorenz commented 5 years ago

I downloaded the 3.7.5 release of the nw package and replaced the nw folder in my NetLogo 6.0.4 installation.

The problem persists in my minimal example exactly as stated above.

LaCuneta commented 5 years ago

Jan, thanks for trying it out with the new version. I'll look into it and let you know what I find.

LaCuneta commented 5 years ago

@janlorenz I package up a new release if you want to try your model with Bryan's fix: https://github.com/NetLogo/NW-Extension/releases/tag/v3.7.6

janlorenz commented 5 years ago

Works, great!