[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uniformDblRand and uniformIntRand
From: |
Sven N. Thommesen |
Subject: |
Re: uniformDblRand and uniformIntRand |
Date: |
Tue, 15 Aug 2000 09:58:50 -0500 |
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.