/** * Compare results with * http://www.math.keio.ac.jp/matumoto/CODES/MT2002/mt19937ar.out */ @Test public void testCorrectness() { MersenneRandom r = new MersenneRandom(new int[]{0x123, 0x234, 0x345, 0x456}); logger.debug("Compare MersenneTwisterFast with new (2002/1/26) seeding mechanism with original result data.."); for (int j = 0; j < 1000; j++) { // first, convert the int from signed to "unsigned" long l = r.nextInt(); if (l < 0) { l += 4294967296L; // Integer.MAX_VALUE } assertEquals(FIRST_1000_VALS[j], l); } logger.debug("Success"); }
Random random = new MersenneRandom(seed); BlockManager blockManagerLocal = CoreRegistry.get(BlockManager.class); Vector3i relPos = chunk.chunkToWorldPosition(0, 0, 0).sub(pos).invert();
MersenneRandom r = new MersenneRandom(seed); sum += r.nextInt(); start = System.nanoTime(); for (int j = 0; j < count; j++) { sum += r.nextInt();