Thanks. I've rechecked and nextInt() is providing the same start
sequence as expected. Somehow, my code is still producing non-repeatable
behavior despite the fixed sequence. The ball is in my court now. 


Angel Martine
RAND Corporation

-----Original Message-----
From: MASON Multiagent Simulation Toolkit
[mailto:[log in to unmask]] On Behalf Of Sean Luke
Sent: Tuesday, June 14, 2011 11:00 AM
To: [log in to unmask]
Subject: Re: Setting the random seed

Angel, I'm not sure what the issue is, but you have full control over  
your random number generator. So for example, at the beginning of your  
model's start() method you could replace the random number generator  
like this:

	random = new MersenneTwisterFast(13492341L);

This should always guarantee a fixed sequence.  If it does not,  
there's got to be a bug in your model code somewhere: I'd need a  
stripped-down version to look at which exhibits the same behavior.


On Jun 14, 2011, at 10:41 AM, Martinez, Angel wrote:

> For debugging purposes, I need to use a fixed random seed. However,  
> I'm
> having trouble getting a fixed sequence to occur.
> I've tried setting it in the UI version of the simulation, in the
> constructor of the simulation itself, and explicitly calling
> random.setSeed() from the simulation start() method.
> Any ideas?
> Thanks,
> Angel Martinez
> RAND Corporation
> This email message is for the sole use of the intended recipient(s)  
> and
> may contain confidential information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all  
> copies
> of the original message.