swarm-support
[Top][All Lists]
Advanced

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

Re: seeds, standard deviation, and stopping


From: Rick Riolo
Subject: Re: seeds, standard deviation, and stopping
Date: Thu, 1 May 1997 16:35:20 -0400 (EDT)

1. I don't think there is a StdDev that comes with the averagers.

2. Here is how I start RNGs:
   I have a run-time (or init file or GUI) settable
   parameter, unsigned long seed, and then in a startRNG method
   I do this:

-(void) startRNG {
    char    seedBuff[32];
    if ( seed == 0 ) {
        seed = getpid()*time(0);
        sprintf(seedBuff,"%u",seed);
        [self setParameterName: "seed" ToValue: seedBuff];
    }
    randomGeneratorR = [PMMLCG1 create: globalZone
                 setStateFromSeed: seed];
    uniformUR = [UniformUnsigned create: globalZone
                    setGenerator: randomGeneratorR];
    //... and so on for any other distributions I want.
}

3. You might schedule a checkToStop message each step,
   and that checkToStop method could check variables
   to see if its time to stop, and if it is, issue a
      [getTopLevelActivity() terminate]; 
   and do any other cleanup that is needed
   (as in the Heatbugs batchmode stopRunning method).

- r

Rick Riolo                       address@hidden
Program for Study of Complex Systems (PSCS)
1061 Randall Lab     University of Michigan
Ann Arbor MI 48109-1120
http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html

On Thu, 1 May 1997, Daniel J. Shapero wrote:

> Date: Thu, 01 May 1997 14:21:58 -0400
> From: Daniel J. Shapero <address@hidden>
> To: address@hidden
> Subject: seeds, standard deviation, and stopping
> 
> Hi,
>       First, I was wondering if Swarm had a built in standard deviation
> function like it has for averaging and the syntax for that.
>       Second, is there a way to randomize the seed off of the computer's
> intertal clock?
>       Third, I understand the stopping mechanism for when the simulation
> reaches a certain time period, but what about when a group of variables
> reach a certain value.  It there a way to work that stopping mechanism
> similar to the timestop mechanism.
> 
> Thanks,
> 
> Daniel Shapero
> 
>                   ==================================
>    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]