Examples of nextBoolean()


Examples of org.waveprotocol.wave.model.document.operation.automaton.DocOpAutomaton.ValidationResult.nextBoolean()

            if (nextKeyIndex >= keys.size()) {
              tryThisOption();
              return;
            }
            String key = keys.get(nextKeyIndex);
            boolean take = r.nextBoolean();
            if (take) {
              take(nextKeyIndex + 1, key);
              nextKey(nextKeyIndex + 1);
            } else {
              nextKey(nextKeyIndex + 1);
View Full Code Here

Examples of org.waveprotocol.wave.model.testing.RandomDocOpGenerator.RandomProvider.nextBoolean()

  public void testNextBooleanDistribution() {
    for (int seed : NUMBERS) {
      RandomProvider rp = RandomProviderImpl.ofSeed(seed);
      int trueCount = 0;
      for (int i = 0; i < ITERATIONS; i++) {
        if (rp.nextBoolean()) {
          trueCount++;
        }
      }
      assertTrue("seed " + seed + ", trueCount " + trueCount,
          trueCount >= (1.0 - MAX_DEVIATION) * 0.5 * ITERATIONS);
 
View Full Code Here

Examples of se.grunka.fortuna.Fortuna.nextBoolean()

            Fortuna fortuna = Fortuna.createInstance();
            System.err.println("Generating image...");
            BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            for (int x = 0; x < width; x++) {
                for (int y = 0; y < height; y++) {
                    image.setRGB(x, y, fortuna.nextBoolean() ? 0xffffff : 0x000000);
                }
            }
            String extension = args[2].substring(args[2].lastIndexOf('.') + 1);
            ImageIO.write(image, extension, new File(args[2]));
        }
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.