swarm-support
[Top][All Lists]
Advanced

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

Re: built in rv objects -- "bug" in documenation


From: Rick Riolo
Subject: Re: built in rv objects -- "bug" in documenation
Date: Tue, 26 Jan 1999 21:40:11 -0500 (EST)

Thanks to all for the answers...I must apologize for
my ill-formed question.
I actually know about all this stuff and where it is.
What I was asking was where, if anywhere, in the documentation
is there one page, say, that tells the beginning user
about these built in objects, and about --varyseed's effect
on them?

As you know I teach beginners how to use swarm, and its just
too off-putting to point them to:
a) swarm source files
b) the nice and complete, but not beginner-suitable random lib ref pages
...in my humble opinion (to borrow a phrase from click and clack).

Paul Johnson pointed out some material in the FAQ.
I think that material, perhaps simplified and ordered a bit,
should make it into the documentation somewhere,
so someone teaching swarm can say "go see the page..."
and not feel guilty and know the poor (biologist, anthropologist,
busAdmin, or pick your other non-programmer) will not
get a twitch in his or her eye after going to that page!

Or put it this way:  if someone picks up heatbugs demo source,
it can be rather hard to figure out where those random
numbers are coming from, what --varyseed does, and what similar things 
are provided "out of the box" for other simple swarm apps.

I bring this up because the ref manual, with its nice indicies
and cross-references as made it *so much easier* to
get beginners oriented and on their own.

- r

Rick Riolo                           address@hidden
Program for Study of Complex Systems (PSCS)
4477 Randall Lab                
University of Michigan         Ann Arbor MI 48109-1120
Phone: 734 763 3323                  Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html

On Tue, 26 Jan 1999, Benedikt Stefansson wrote:

> Date: Tue, 26 Jan 1999 17:54:39 -0800
> From: Benedikt Stefansson <address@hidden>
> To: address@hidden
> Subject: Re: built in rv objects
> 
> Rick,
> 
> In addition to what Van Dung wrote; the following objects are "global"
> variables once initSwarm() has been called in main.m (see /random/random.m:)
> 
> id <MT19937gen>          randomGenerator;
> 
> id <UniformIntegerDist>   uniformIntRand;
> id <UniformUnsignedDist>  uniformUnsRand;
> id <UniformDoubleDist>    uniformDblRand;
> 
>  If one only needs uniform distributions,  one can simply seed the generator
> instance (randomGenerator) and then get down to business. Since the MT19937
> generator is good enough for most purposes (see Matsumoto, M. and Kurita, Y.
> (1998) "Mersenne twister a 623-dimensionally equidistributed uniform
> pseudo-random number generator", ACM Transactions on Modeling and Computer
> Simulations, 8 (1), pages 3-30), there is little reason to use any of the 
> other
> generators provideed (Sven once published some statistics on speed, which 
> might
> be a consideration in some cases). The three distributions are already global
> and ready to rumble. I.e. the following code is actually superfluous:
> 
> Van Dung Ly wrote:
> 
> > - buildObjects
> > {
> > // snip
> >
> >   id <UniformDoubleDist> udd;
> >
> >   udd = [ UniformDoubleDist
> >           create: [self getZone]
> >           setGenerator: [MT19937gen create: [self getZone]
> >                                     setStateFromSeed: SLEEPYSEED] ];
> > //snip
> 
> To do the same thing you only need the following line:
> 
> [randomGenerator setSeed: SLEEPYSEED];
> 
> and then one can call the instance -uniformDoubleRand which is already
> provided.
> 
> Regards,
> -Benedikt
> 
> PS. Note that the different generators are amply documented, the only problem
> is maybe that the random libary is huge and there is in effect to much
> information:
> http://www.santafe.edu/projects/swarm/swarmdocs/set/swarm.random.sgml.reference.html
> 
> --
> ----------------
> Benedikt Stefansson                 address@hidden
> Department of Economics, UCLA       Fax. (310) 825-9528
> Los Angeles, CA 90095-1477          Tel. (310) 825-1777
> 
> 
> 
>                   ==================================
>    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]