Examples of nextBoolean()


Examples of com.heatonresearch.aifh.randomize.GenerateRandom.nextBoolean()

        boolean[][] grid = this.worldArea.getBackupGrid();
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        for (int row = 0; row < this.worldArea.getRows(); row++) {
            for (int col = 0; col < this.worldArea.getCols(); col++) {
                grid[row][col] = rnd.nextBoolean();
            }
        }

        this.worldArea.advanceBackupGrid();
View Full Code Here

Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom.nextBoolean()

        boolean[][] grid = this.worldArea.getBackupGrid();
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        for (int row = 0; row < this.worldArea.getRows(); row++) {
            for (int col = 0; col < this.worldArea.getCols(); col++) {
                grid[row][col] = rnd.nextBoolean();
            }
        }

        this.worldArea.advanceBackupGrid();
View Full Code Here

Examples of com.orientechnologies.common.util.MersenneTwisterFast.nextBoolean()

    }

    Iterator<OClusterPosition> positionIterator = positionRecordMap.keySet().iterator();
    while (positionIterator.hasNext()) {
      OClusterPosition clusterPosition = positionIterator.next();
      if (mersenneTwisterFast.nextBoolean()) {
        Assert.assertTrue(paginatedCluster.deleteRecord(clusterPosition));
        positionIterator.remove();
      }
    }
View Full Code Here

Examples of java.security.SecureRandom.nextBoolean()

            sr = SecureRandom.getInstance("PRNG", "SunMSCAPI");
            long start = System.nanoTime();
            int x = 0;
            for(int i = 0; i < 10000; i++) {
                if (i % 100 == 0) System.err.print(".");
                if (sr.nextBoolean()) x++;
            };
            t = (System.nanoTime() - start) / 1000000000.0;
            System.err.println("\nSpend " + t + " seconds");
        } catch (Exception e) {
            // Not supported here, maybe not a Win32
View Full Code Here

Examples of java.util.Random.nextBoolean()

        int max = 300;
        int count = 100000;
        Random random = new Random(1);
        for (int i = 0; i < count; i++) {
            int idx = random.nextInt(max);
            if (random.nextBoolean()) {
                if (random.nextBoolean()) {
                    bits.set(idx);
                    set.set(idx);
                } else {
                    bits.clear(idx);
View Full Code Here

Examples of java.util.Random.nextBoolean()

        int count = 100000;
        Random random = new Random(1);
        for (int i = 0; i < count; i++) {
            int idx = random.nextInt(max);
            if (random.nextBoolean()) {
                if (random.nextBoolean()) {
                    bits.set(idx);
                    set.set(idx);
                } else {
                    bits.clear(idx);
                    set.clear(idx);
View Full Code Here

Examples of java.util.Random.nextBoolean()

        int total = maxOffset + maxLen;
        int count = 10000;
        for (int i = 0; i < count; i++) {
            int offset = random.nextInt(maxOffset);
            int len = random.nextInt(maxLen);
            boolean val = random.nextBoolean();
            set.set(offset, offset + len, val);
            bits.set(offset, offset + len, val);
            for (int j = 0; j < total; j++) {
                assertEquals(set.get(j), bits.get(j));
            }
View Full Code Here

Examples of java.util.Random.nextBoolean()

        org.h2.Driver.load();
        deleteDb("index");
        printTime("testIndex " + seed);
        Random random = new Random(seed);
        int distinct, prefixLength;
        if (random.nextBoolean()) {
            distinct = random.nextInt(8000) + 1;
            prefixLength = random.nextInt(8000) + 1;
        } else if (random.nextBoolean()) {
            distinct = random.nextInt(16000) + 1;
            prefixLength = random.nextInt(100) + 1;
View Full Code Here

Examples of java.util.Random.nextBoolean()

        Random random = new Random(seed);
        int distinct, prefixLength;
        if (random.nextBoolean()) {
            distinct = random.nextInt(8000) + 1;
            prefixLength = random.nextInt(8000) + 1;
        } else if (random.nextBoolean()) {
            distinct = random.nextInt(16000) + 1;
            prefixLength = random.nextInt(100) + 1;
        } else {
            distinct = random.nextInt(10) + 1;
            prefixLength = random.nextInt(10) + 1;
View Full Code Here

Examples of java.util.Random.nextBoolean()

            prefixLength = random.nextInt(100) + 1;
        } else {
            distinct = random.nextInt(10) + 1;
            prefixLength = random.nextInt(10) + 1;
        }
        boolean delete = random.nextBoolean();
        StringBuilder buff = new StringBuilder();
        for (int j = 0; j < prefixLength; j++) {
            buff.append("x");
            if (buff.length() % 10 == 0) {
                buff.append(buff.length());
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.