Package org.terasology.utilities.random

Examples of org.terasology.utilities.random.FastRandom.nextInt()


            noiseTable[i] = i;
        }

        // Shuffle the array
        for (int i = 0; i < 256; i++) {
            int j = rand.nextInt(256);

            int swap = noiseTable[i];
            noiseTable[i] = noiseTable[j];
            noiseTable[j] = swap;
        }
View Full Code Here


            p[i] = i;
        }

        // Shuffle the array
        for (int i = 0; i < 256; i++) {
            int j = rand.nextInt(256);

            short swap = p[i];
            p[i] = p[j];
            p[j] = swap;
        }
View Full Code Here

            noiseTable[i] = i;
        }

        // Shuffle the array
        for (int i = 0; i < 256; i++) {
            int j = rand.nextInt(256);

            int swap = noiseTable[i];
            noiseTable[i] = noiseTable[j];
            noiseTable[j] = swap;
        }
View Full Code Here

        FastRandom fr = new FastRandom(seed);

        // warmup
        sum = 0;
        for (int j = 0; j < warmUpCount; j++) {
            sum += fr.nextInt();
        }
        sum = 0;
        start = System.nanoTime();
        for (int j = 0; j < count; j++) {
            sum += fr.nextInt();
View Full Code Here

            sum += fr.nextInt();
        }
        sum = 0;
        start = System.nanoTime();
        for (int j = 0; j < count; j++) {
            sum += fr.nextInt();
        }

        logger.info("FastRandom: {}ms.", (System.nanoTime() - start) / 1000000);
        logger.trace("Use the result so that JVM doesn't skip the computation - here it is: {}", sum);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.