samedi 22 octobre 2016

How to use MersenneTwisterRNG random number generator

I am trying to implement a random number generator in my java program. I was using Math.random() but that didn't seem to work very well. Then I tried using secureRandom, but that took too long for my game. However, I came across this generator, the MersenneTwisterRNG random number generator. It seems to be what I want; fast, but still random. However, I have not been writing in java for very long, only 2 months, and I cannot make heads nor tails of the API. If anyone could help explain to me how to use this in my code, it would be appreciated. Or, if you happen to know of a simpler, but similar, random number generator, I would be interested in that as well. The API is here .




Aucun commentaire:

Enregistrer un commentaire