NetLogo/NW-Extension

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

Closed this issue · 5 comments

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?

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.

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.

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

@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

Works, great!