{"action":"created","issue":{"url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/187","repository_url":"https://api.github.com/repos/NetLogo/NW-Extension","labels_url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/187/comments","events_url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/187/events","html_url":"https://github.com/NetLogo/NW-Extension/issues/187","id":347910064,"node_id":"MDU6SXNzdWUzNDc5MTAwNjQ=","number":187,"title":"nw:load-graphml somehow messes with the random seed","user":{"login":"digitaldust","id":3994257,"node_id":"MDQ6VXNlcjM5OTQyNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/3994257?v=4","gravatar_id":"","url":"https://api.github.com/users/digitaldust","html_url":"https://github.com/digitaldust","followers_url":"https://api.github.com/users/digitaldust/followers","following_url":"https://api.github.com/users/digitaldust/following{/other_user}","gists_url":"https://api.github.com/users/digitaldust/gists{/gist_id}","starred_url":"https://api.github.com/users/digitaldust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitaldust/subscriptions","organizations_url":"https://api.github.com/users/digitaldust/orgs","repos_url":"https://api.github.com/users/digitaldust/repos","events_url":"https://api.github.com/users/digitaldust/events{/privacy}","received_events_url":"https://api.github.com/users/digitaldust/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-06T12:50:43Z","updated_at":"2018-08-09T11:06:47Z","closed_at":"2018-08-07T16:10:32Z","author_association":"NONE","body":"I think there is a problem with random seed if nw:load-graphml is invoked. \r\n\r\nIf 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:\r\n\r\n```\r\nto setup\r\n  ca\r\n  random-seed 1\r\n  create-turtles 100\r\n  ask turtles [\r\n    ask other turtles [\r\n      if random-float 1 < 0.01 [\r\n        create-link-with myself\r\n      ]\r\n    ]\r\n  ]\r\n  repeat 10 [layout-spring turtles links 0.2 5 1]\r\n  nw:set-context turtles links\r\nend\r\n```\r\n\r\nsame applies if you create the network from scratch using the nw extension:\r\n\r\n```\r\nto setup2\r\n  ca\r\n  random-seed 1\r\n  nw:generate-random turtles links 100 0.01\r\n  repeat 10 [layout-spring turtles links 0.2 5 1]\r\n  nw:set-context turtles links\r\nend\r\n```\r\n\r\nhowever, 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:\r\n\r\n```\r\nto setup3\r\n  ca\r\n  random-seed 1\r\n  nw:load-graphml \"random-exact-50-4-106.graphml\"\r\n  repeat 10 [layout-spring turtles links 0.2 5 1]\r\nend\r\n```\r\n\r\n```\r\nto setup4\r\n  ca\r\n  random-seed 1\r\n  nw:load-graphml \"prova.graphml\"\r\n  repeat 10 [layout-spring turtles links 0.2 5 1]\r\nend\r\n```\r\n\r\nSee also the discussion [here](https://groups.google.com/d/msgid/netlogo-users/92a260ca-5489-44d3-aedb-ca9defcd2d75%40googlegroups.com) to find a netlogo model and graphml files that demonstrate the issue."},"comment":{"url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/comments/411721348","html_url":"https://github.com/NetLogo/NW-Extension/issues/187#issuecomment-411721348","issue_url":"https://api.github.com/repos/NetLogo/NW-Extension/issues/187","id":411721348,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTcyMTM0OA==","user":{"login":"digitaldust","id":3994257,"node_id":"MDQ6VXNlcjM5OTQyNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/3994257?v=4","gravatar_id":"","url":"https://api.github.com/users/digitaldust","html_url":"https://github.com/digitaldust","followers_url":"https://api.github.com/users/digitaldust/followers","following_url":"https://api.github.com/users/digitaldust/following{/other_user}","gists_url":"https://api.github.com/users/digitaldust/gists{/gist_id}","starred_url":"https://api.github.com/users/digitaldust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitaldust/subscriptions","organizations_url":"https://api.github.com/users/digitaldust/orgs","repos_url":"https://api.github.com/users/digitaldust/repos","events_url":"https://api.github.com/users/digitaldust/events{/privacy}","received_events_url":"https://api.github.com/users/digitaldust/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T11:06:47Z","updated_at":"2018-08-09T11:06:47Z","author_association":"NONE","body":"@qiemem thanks a ton, I see the patch works if I just read the graphml file in... still if you call layout-radial after importing then the ordering is not preserved, so maybe also layout-radial is doing the same stuff? anyway thanks a ton for now, I can run my experiment and have reproducible results now... 👍 "}}
{"actor":{"display_login":"digitaldust"}}