swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random Seed question


From: Miles Parker
Subject: Re: Random Seed question
Date: Mon, 31 Jan 2000 12:46:23 -0500

>>> "Theodore C. Belding" <address@hidden> 01/30/00 03:56PM >>>
>>>Stated more generally, it's important that the algorithm you use for
generating seeds is uncorrelated with the RNG that you plug the seeds
into. In retrospect, I don't think it's absolutely necessary to use an RNG
to generate the seeds. Simply adding 1 to the last seed each time should
be sufficient, as long as the sequence of seeds that you produce that way
is unlikely to be produced again if you run another N runs of your
simulation.

>>>This is because, as Doug Donalson said, it shouldn't matter what seed you
give to the RNG as long as it's within the legal range and as long as it's
unlikely that you use the same seed twice.  (For instance some RNGs can't
be given a seed of 0, or negative seeds, or they have a maximum legal
seed value.) 

Exactly!

I think some kind of timestamp is just fine for a seed. In general, I'd be a 
little hesitiant and too lazy anyway to use RNGs to generate seed for other 
RNGs. In effect, you're just streaming two RNGs together,and that might just 
give you unexpected correlations/artifacts. A well designed RNG should be able 
to take an arbitrary (not strongly coorelated) seed and give you PRNs. 
Otherwise, what good is it? Now, if I was really industrious, I'd just hook the 
whole thing up to a lava-lamp true RN server, but I'm not. :-)

I am a little too superstitious to just increment my seeds though! One little 
problem I have is that I use current time in millis, which is a pretty big 
number. Its kind of silly to have to jot down seeds like '949340224380' but I'm 
afraid to simply shrink the number by division or modulous or whatever. I was 
thinking I could just keep the 'little' decimal end, in effect mod 10^5 or 
something. Does this sound ok? Does anyone have any otehr nice 'safe' ways to 
do this while keeping things arbitrary? 

Miles




Miles T. Parker
Software Engineer
The Brookings Institution  1775 Mass. Ave. NW  Washington, DC  20036
http://www.brook.edu/es/dynamics/models/ascape
mailto:address@hidden  voice 202.797.6136  fax 202.797.6319


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]