Multiple Instance of rand?

Is it possible to have multiple instances Ruby’s random-number
generator running within one program? I would like to have different
random sequences, each with its own seed.

are wrote:

Is it possible to have multiple instances Ruby’s random-number
generator running within one program? I would like to have different
random sequences, each with its own seed.

Not yet, but it has been proposed for 1.9.

The best workaround for now is to use one of the external PRNG
libraries.

On 26/06/07, are [email protected] wrote:

Thanks much. I’m kind of a noob; could you please give me a hint as
to what the PRNG libraries are and where I would find them?

Try searching within these sites:
http://rubyforge.org/
http://raa.ruby-lang.org/

Thanks much. I’m kind of a noob; could you please give me a hint as
to what the PRNG libraries are and where I would find them?

Thanks much. I’m kind of a noob; could you please give me a hint as
to what the PRNG libraries are and where I would find them?

A PRNG is a pseudo random number generator - “pseudo” here expresses the
fact
that a computer is a deterministic device, so some tweaking is necessary
to make it difficult to predict the next “random” number …

You can get an implementation for Ruby here:

http://rubyvm.sourceforge.net/subprojects/randomr/

Best regards,

Axel

On Tue, 26 Jun 2007, are wrote:

Thanks much. I’m kind of a noob; could you please give me a hint as
to what the PRNG libraries are and where I would find them?

There is http://rubyforge.org/projects/crypt-isaac

ISAAC is a cryptographically secure PRNG (the mersenne twister, which is
what Ruby uses, produces quality streams of numbers, butis not
cryptographically secure).

That is a pure Ruby implementation. I have a version that has a C
extension that I have been sitting on for quite some time. I’ll make
some
time today to get that version packaged and uploaded, though.

Kirk H.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs