RepastHelper RNG Bug?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RepastHelper RNG Bug?

William Mack-Crane

Hi all,

 

I had a curious bug in a repast model I’m working with, and I wanted to mention it in case it indicates a bug on the back end. The initialization of one of my model’s properties is stochastic. We set the random seed explicitly for each run (via randomSeed parameter. Each parameter combination is run with the same 50 seeds). Yet, the initialized value of this property differs, for a given random seed, based on another parameter which is unrelated to it in the code. It’s a very small difference on average – as though the distribution is identical, but it’s just getting a different set of draws from the RNG.

 

I’ve noticed this in batch runs in both RS 2.1 and 2.3.1. I had trouble reproducing that behavior per se in the GUI. The bug was fixed by seeding RandomHelper explicitly at the beginning of initialization. I hadn’t thought that was necessary with RandomHelper, so this makes me wonder if there’s something behind the scenes that draws on RandomHelper’s stream after it’s seeded, leaving it in a different place for the model run. Indeed, in the GUI I found that the model’s initial state for a particular random seed would be consistent across parameterizations, but when I started a new instance the initialization value would be different. But perhaps I’m just misunderstanding how RandomHelper is to be used.

 

Just wanted to throw this out there in case it’s useful.

 

Best,

 

Austen


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: RepastHelper RNG Bug?

srcnick
Can you describe your intialization the uses the random seed in detail? We haven’t seen this kind of behavior, so I’d like to check on it. if I understand you correctly, it works as expected in the GUI, but when doing batch runs it does not?

thanks,

Nick

On Sep 20, 2016, at 9:59 PM, William Mack-Crane <[hidden email]> wrote:

Hi all,
 
I had a curious bug in a repast model I’m working with, and I wanted to mention it in case it indicates a bug on the back end. The initialization of one of my model’s properties is stochastic. We set the random seed explicitly for each run (via randomSeed parameter. Each parameter combination is run with the same 50 seeds). Yet, the initialized value of this property differs, for a given random seed, based on another parameter which is unrelated to it in the code. It’s a very small difference on average – as though the distribution is identical, but it’s just getting a different set of draws from the RNG.
 
I’ve noticed this in batch runs in both RS 2.1 and 2.3.1. I had trouble reproducing that behavior per se in the GUI. The bug was fixed by seeding RandomHelper explicitly at the beginning of initialization. I hadn’t thought that was necessary with RandomHelper, so this makes me wonder if there’s something behind the scenes that draws on RandomHelper’s stream after it’s seeded, leaving it in a different place for the model run. Indeed, in the GUI I found that the model’s initial state for a particular random seed would be consistent across parameterizations, but when I started a new instance the initialization value would be different. But perhaps I’m just misunderstanding how RandomHelper is to be used.
 
Just wanted to throw this out there in case it’s useful.
 
Best,
 
Austen
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest