swarm-support
[Top][All Lists]
Advanced

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

Re: uniformDblRand and uniformIntRand


From: Pietro Terna
Subject: Re: uniformDblRand and uniformIntRand
Date: Tue, 15 Aug 2000 17:01:43 +0200

        Hi Sven,

many thanks, sorry for missing my signture in the previous message (send before end ...).

        Pietro

At 09.58 15/08/00 -0500, you wrote:
At 09:16 AM 8/15/00, you wrote:
        Hi All,

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.

Changing neural network parameters, the number of calls made to uniformDblRand and uniformIntRand changes. The consequence is a different sequence of random number also for case A; this is embarassing, as I'd like to experiment different neural network parameters vs. the same behavioral data.

How can I generate a completely independent uniformDblRand object, to use it for case A?

Pietro,

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.

The documentation and the user guide explain these things in some detail.

Cheers,
Sven


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



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