swarm-support
[Top][All Lists]
Advanced

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

Re: uniformDblRand and uniformIntRand


From: Joshua Madden
Subject: Re: uniformDblRand and uniformIntRand
Date: Tue, 22 Aug 2000 17:27:54 -0700

Quoth Pietro Tierna:
> >         I'm using (in Obj-C) uniformDblRand (case A) to generate random 
> > number influencing the behavior of my agents; in the same application I
> > use (case B) uniformDblRand and uniformIntRand to generate initial
> > weights and sequences in random order learning in a neural network.
[snip]
> >         How can I generate a completely independent uniformDblRand 
> > object, to use it for case A?
 
On 15 Aug 00, at 9:58, Sven N. Thommesen wrote:
> Swarm allows you to create as many random generator and distribution
> objects as you want or need. However, I suspect most users just take the
> default ones and beat them to death, which is not always what a simulation
> calls for. As you have discovered, the 3 default distributions all take
> their input from the *same* default mt19937 generator, which is one
> possible way to connect things up. Another way is for each distribution
> object to be created with its own private random generator.
> 
> In your case, if you want a second stream of uniformDblRand values that is
> independent of the first, just create a new generator of your choice, then
> create a new uniformDblRand object and attach it to the new generator. If
> you choose to create a second mt19937 generator because of its good
> properties, you need to make sure that the default generator and the
> second generator are initialized with different seed values to get
> different (independent) output sequences.

A cautionary note: a given pseudorandom number generator will of 
course generate the same sequence of values given the same seed.  The 
corollary to this is that if your sample is large enough--or if you 
make an unfortunate pair of choices of seeds--you will get the same 
sequence of values from each generator, just displaced in time.  If 
you want two output sequences to be truly independent, you can't use 
the same generator for both.

Joshua Madden
address@hidden Per Obscurius....cs.uoregon.edu/~jmadden
     Joshua Madden: Information Scientist, Musician, Philosopher-At-Tall
It's that moment of dawning comprehension that I live for.  -- Bill Watterson
 My opinions are too rational and insightful to be those of any organization.

                  ==================================
   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]