swarm-support
[Top][All Lists]
Advanced

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

Re:


From: Benedikt Stefansson
Subject: Re:
Date: Fri, 07 Aug 1998 16:45:23 -0600

George F Dickinson wrote:
> 
> I need to generate 520 random numbers durring the execution of my
> simulation. I am not familiar with your generators and was wondering
> if there is a simple way to make the seed change with every execution
> and what generator to use. The numbers must have a mean of 1 and a
> standard deviation of 3 and a normal distribution.  Can someone give
> me a pointer?  George Dickinson
> 

All the information on creating a Normal distribution with the required
mean and standard deviation you need is here:
 
http://www.santafe.edu/projects/swarm/swarmdocs/html/refbook/swarm.random.normal.protocol.html

You have to set a random number generator for each distribution you
create: 

The random number generator that is created by default when you execute
initSwarm() in main.m (see for example heatbugs or tutorial app for demo
of this) is good enough (it's an instance of the mt19337 generator
described here:

http://www.santafe.edu/projects/swarm/swarmdocs/html/refbook/swarm.random.mt19937gen.protocol.html

You can reseed the default generator every time by a) reading new
parameters into ModelSwarm, one of which should be the random number
seed b) using the --varyseed option on the command line when starting
the simulation. In case a) remember to put somewhere in ModelSwarm
before you create the Normal distribution object, this line:

 [randomGenerator setSeed: randomSeed] 

where randomSeed is an instance variable in ModelSwarm that you read in
from a file.

Regards.
-B
-- 
-------------------------------------------------------------------
Department of Economics, UCLA, Los Angeles, CA 90095-1477, USA
Tel: (310) 825 4126     Fax: (310) 825 9528   <address@hidden>

8/2-8/31 1998:
Santa Fe Institute, 1399 Hyde Park Road, New Mexico 87501 USA
Tel: (505) 984 8800     Fax: (505) 982 0565   <address@hidden>
-------------------------------------------------------------------

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