Java Randomness
 Posted: 18 May 2013, 15:27
Posted: 18 May 2013, 15:27I played a lot with forge and something told me that the shuffling was always a little bit weird, e.g. much periodic behaviour.
As I looked at the source code of Cockatrice, I saw that they use a SIMD-oriented Fast Mersenne Twister for random numbers (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/) and asked me why... then I dug deeper and found that several languages use Mersenne-Twister as RNG, like Python, Ruby, R, PHP, MATLAB and C++11 but Java does not... multiple sources told me that the java.util.Random class is not very state of the art, see http://www.alife.co.uk/nonrandom/ and http://www.qbrundage.com/michaelb/pubs/ ... ation.html
The second source has Mersenne Twister and R250/521 implementations for Java under public domain and shortly describes them.
Could you improve the forge.util.MyRandom wrapper code by copying the MT class over and use it instead of using java.util.Random? It's only copy-paste with three lines of changes.
			As I looked at the source code of Cockatrice, I saw that they use a SIMD-oriented Fast Mersenne Twister for random numbers (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/) and asked me why... then I dug deeper and found that several languages use Mersenne-Twister as RNG, like Python, Ruby, R, PHP, MATLAB and C++11 but Java does not... multiple sources told me that the java.util.Random class is not very state of the art, see http://www.alife.co.uk/nonrandom/ and http://www.qbrundage.com/michaelb/pubs/ ... ation.html
The second source has Mersenne Twister and R250/521 implementations for Java under public domain and shortly describes them.
Could you improve the forge.util.MyRandom wrapper code by copying the MT class over and use it instead of using java.util.Random? It's only copy-paste with three lines of changes.
