swarm-support
[Top][All Lists]
Advanced

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

Re: Normal Dist solved


From: Rick Riolo
Subject: Re: Normal Dist solved
Date: Tue, 7 Jul 1998 08:54:37 -0400 (EDT)

My guess is that result should be a double.

Its probably better to have the seed be unsigned int,
maybe long, but I can't recall for sure.

 - 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, 7 Jul 1998, Alessandro Perrone wrote:

> Date: Tue, 7 Jul 1998 14:44:38 +0200 (METDST)
> From: Alessandro Perrone <address@hidden>
> To: address@hidden
> Subject: Normal Dist solved 
> 
> Hi all
>  I solved my previous problem with Normal Dist.
> The method is
> -alex {
> int result;
> int seed = 25699870;
> id normalDR, randomGeneratorR;
> randomGeneratorR = [PMMLCG1 create: globalZone setStateFromSeed: seed];
> 
> normalDR = [NormalDistribution create: globalZone
> setGenerator:randomGeneratorR];
> result =  [normalDR getSampleWithMean: 0 withVariance: 0.5];
> printf (" Normal Value ---> %d\n ", result);
> return self;
> 
> }
> 
> Is it right?
> The only problem is that the result is ALWAYS 0!! sigh sigh sigh!!!
> Any ideas?
>                       ALEX
> 
> 
>                   ==================================
>    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]