NetLogo / LevelSpace

This is the LevelSpace extension repository. LevelSpace allows you to run NetLogo models |: from inside NetLogo models :|
Other
19 stars 8 forks source link

Link child RNG with parent #115

Closed qiemem closed 6 years ago

qiemem commented 6 years ago

We could have every ls:ask (ls:of, etc) sets the child's seed with a nextInt off the parent's RNG (or some function of it anyway). This way:

child.seed(parent.nextInt)
child.nextInt
x = child.nextInt
child.seed(parent.nextInt)
y = child.nextInt

I think this is prevented by how Mersenne Twister works, but we should test for it. The NetLogo test for this would be something like:

not member? ([ random-float 1 ] ls:of 0) ([ list random-float 1 random-float 1 ] ls:of 0)

The downsides to this are that:

@arthurhjorth what do you think?

qiemem commented 6 years ago

New proposal: We set child model seed at model creation. Then add a ls:random-seed primitive which sets the parent's seed and every child's seed using nextInt.