-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I think there is a problem with random seed if nw:load-graphml is invoked.
If you create a network like this, you can set the random seed and every time you call the procedure you have a network in the same exact position:
to setup
ca
random-seed 1
create-turtles 100
ask turtles [
ask other turtles [
if random-float 1 < 0.01 [
create-link-with myself
]
]
]
repeat 10 [layout-spring turtles links 0.2 5 1]
nw:set-context turtles links
end
same applies if you create the network from scratch using the nw extension:
to setup2
ca
random-seed 1
nw:generate-random turtles links 100 0.01
repeat 10 [layout-spring turtles links 0.2 5 1]
nw:set-context turtles links
end
however, if you try to load from a graphml file, every time you have the network with a different layout - and this applies with a graphml that I have generated as well as the graphml file used in the nw guide:
to setup3
ca
random-seed 1
nw:load-graphml "random-exact-50-4-106.graphml"
repeat 10 [layout-spring turtles links 0.2 5 1]
end
to setup4
ca
random-seed 1
nw:load-graphml "prova.graphml"
repeat 10 [layout-spring turtles links 0.2 5 1]
end
See also the discussion here to find a netlogo model and graphml files that demonstrate the issue.
Metadata
Metadata
Assignees
Labels
No labels