NW-Extension
NW-Extension copied to clipboard
nw:weak-component-clusters not following seed?
When I run a netlogo code with nw:weak-component-clusters in it, it returns the components in a different random order each time, even when random-seed is specified. I've tried with netlogo 5.1.0, 6.1.0 and 6.2.2 and two different machines, but the problem persists.
extensions [nw]
to setup
clear-all
random-seed 5
create-turtles 1000
ask turtles [create-link-with one-of other turtles]
print (nw:weak-component-clusters)
end
, for example will sometimes print '[(agentset, 2 turtles) (agentset, 15 turtles) (agentset, 59 turtles) (agentset, 4 turtles) (agentset, 920 turtles)]', sometimes '[(agentset, 2 turtles) (agentset, 920 turtles) (agentset, 15 turtles) (agentset, 59 turtles) (agentset, 4 turtles)]', sometimes '[(agentset, 15 turtles) (agentset, 59 turtles) (agentset, 920 turtles) (agentset, 4 turtles) (agentset, 2 turtles)]' etc. Any idea what could be causing this?
I have confirmed the bug. I used the following code and exported world file to show that given the same set of links and turtles and a random seed the weak component clusters differ between runs with a fresh NetLogo session.
extensions [nw]
to import-links
clear-all
import-world "links-world.txt"
random-seed 15
print (nw:weak-component-clusters)
end