swarm-support
[Top][All Lists]
Advanced

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

Re: Matters of taste or strategy?


From: Parviez Hosseini
Subject: Re: Matters of taste or strategy?
Date: Fri, 5 Jun 1998 15:25:30 -0700 (PDT)

On Fri, 5 Jun 1998 address@hidden wrote:
> Two Swarm Modeling questions:
> 1.
> -createEnd {
. . . 
>     aGenerator = [SWB1 create: [self getZone] setStateFromSeed: 23 ];
>     aNormalValue= [NormalDistribution create: [self getZone] 
>           setGenerator:  aGenerator
>           setMean: 0 setVariance: 1];   
>    return self;
> }
The only problem here is there are varying opinions about using a single 
random numer generator for a simulation, versus several. I don't know 
what "the answer" is, if there is one. I know the logic against is that 
they are tested for serial correlations, but not cross-correlations for 
different seeds. 

>  2. Anybody create a nice way to randomly select members of a list? 
>   If I want to have some action committed on 1000 members out of a list
>   of 50000 objects, it seems there ought to be some easier way than
>   just cycling through the whole list of 50000, drawing a random
>   uniform for each one and picking that one if the random number is
>   less than 1/50.   

Yes. This is what I did to randomize actionGroups. You can use 
x = [ list atOffset: {random number}]; [list remove:x];
just make sure you don't draw random deviates higher than getCount-1, 
and get rid of the remove if you want "with replacement". You could even 
use a non-uniform distribution, if you had a perverse enough reason.

-Parviez

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