[Ns-developers] ns-2/3 RNG

Mathieu Lacage Mathieu.Lacage at sophia.inria.fr
Mon Dec 19 23:25:35 PST 2005


On Mon, 2005-12-19 at 17:03 -0500, Michele Weigle wrote:
> It could be that GSL is what we want to use, but I wasn't able to  
> quickly find a way to address your #1 requirement:
> >> 1) ability to create multiple random number generator instances which
> >> will not generate the same random number series during a single  
> >> run of
> >> the simulator.
> 
> Just from quickly looking at things in GSL, it seemed that if you  
> created a new RNG, it would be seeded to the default (which is the  
> same as every other RNG you create).  If there was some "next- 

I think you are looking for gsl_rng_set.

see http://www.gnu.org/software/gsl/manual/gsl-ref_17.html

>From the above:
--------------------------
This function initializes (or `seeds') the random number generator. If
the generator is seeded with the same value of s on two different runs,
the same stream of random numbers will be generated by successive calls
to the routines below. If different values of s are supplied, then the
generated streams of random numbers should be completely different. If
the seed s is zero then the standard seed from the original
implementation is used instead. For example, the original Fortran source
code for the ranlux generator used a seed of 314159265, and so choosing
s equal to zero reproduces this when using gsl_rng_ranlux.
--------------------------

regards,
Mathieu
-- 



More information about the Ns-developers mailing list