I want to write a reasonably high-performance simulation program in
Clojure. For the random numbers, I'd prefer to use Mersenne Twister
(for a number of reasons - it's a well-known, good RNG, and it's
commonly used in a number of other languages I use, so it's a good
baseline for comparing implementations). The Java RNG, which Clojure
uses, is not MT, but Knuth's linear congruential RNG.

Can someone recommend a good Mersenne Twister implementation I could
use? A web search finds a number of implementations in Java -
presumably I can use these via Java interop - is that a sensible thing
to do?

I'm also looking to parallelise my simulation, so I'd want to have
multiple threads all generating random numbers. I'm not an expert in
this field, if I just naively generate random numbers in multiple
threads is that OK, or could it compromise the randomness? If there is
an issue, has anyone got a pointer to a thread-safe MT implementation
that I could use?

Thanks,
Paul.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to