Print

Print


The actual method is an internal, non-public method called  
setRandomNumberGenerator(int).  Agreed, not a good name, nor is it  
public.  I'll think about making it public; in the meantime, you  
*probably* can just make it public in Console.java.  It'll be fine as  
long as it's not being called from within the simulation thread  
proper -- that is, from within a Steppable.  If you call it from some  
GUI object or from your main() thread, you're probably fine.

Sean

On Aug 15, 2007, at 6:58 PM, Glen E. P. Ropella wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Is the recommended way of programmatically controlling the random seed
> for GUI controlled experiments to sub-class sim.display.Console and  
> set
> randomSeed, randomField, and incrementSeedOnPlay?  Or is there some
> other method I've missed?
>
> If that is the recommended way, it strikes me as a bit of an extra
> effort on the programmer's part, since I have to create a mirror java
> package within my own source tree called sim.display and put my
> sub-classed console in there.  Perhaps a couple of public setters  
> on the
> Console are warranted?  Something like:
>
>    sim.display.Console c = new sim.display.Console(guistate);
>    c.setRandomSeed(94898989);
>    c.setIncrementSeedOnPlay(false);
>
> - --
> glen e. p. ropella, 971-219-3846, http://tempusdictum.com
> The only way we can win is to leave before the job is done. --  
> George W.
> Bush
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGw4UuZeB+vOTnLkoRAoLXAKDHwZkBDksWDuFnbjdQi4JHF36rwQCg23e/
> y3fNrA2lFLKdYzZE/vNXVFQ=
> =tnw9
> -----END PGP SIGNATURE-----