rococo
rococo

Reputation: 2657

Does the MersenneTwister PRNG class in Apache Commons guarantee consistent results (with identical seeds) across different platforms?

I am trying to procedurally generate a multiplayer world for a game without having to store the world server-side. So, I need a source of random numbers that I can be sure is identical across different platforms when seeded with the same number. I've done some searching, and it seems that Java's built-in Random class does not provide this guarantee.

Does MersenneTwister in Commons Math provide this guarantee? The documentation does not specify, but I believe by definition the Mersenne Twister is deterministic, and thus any implementation of it will give the same sequence. I want to be sure my understanding is correct:

  1. Can I rely on it to always give me the same sequence of pseudo-random numbers on different platforms when seeded with the same value?

  2. In what scenarios could the sequence of numbers change (e.g. an update to the library that changes some specific thing)?

Upvotes: 1

Views: 41

Answers (0)

Related Questions