NetLogo / NetLogo/NW-Extension
nw:load-graphml somehow messes with the random seed
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 66
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report centers on nw:load-graphml and the setup3/setup4 reproductions; start by running them with random-exact-50-4-106.graphml and prova.graphml, then compare repeated runs with setup/setup2. Done means loading the same GraphML after random-seed 1 produces a repeatable layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100