Examples of nextInt()


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

    ORecordVersion recordVersion = OVersionFactory.instance().createVersion();
    recordVersion.increment();
    recordVersion.increment();

    for (int i = 0; i < records; i++) {
      int recordSize = mersenneTwisterFast.nextInt(2 * OClusterPage.MAX_RECORD_SIZE) + 1;
      byte[] record = new byte[recordSize];
      mersenneTwisterFast.nextBytes(record);

      final OPhysicalPosition physicalPosition = paginatedCluster.createRecord(record, recordVersion, (byte) 2);
      positionRecordMap.put(physicalPosition.clusterPosition, record);
View Full Code Here

Examples of com.ribomation.droidAtScreen.Settings.nextInt()

    return chooser;
  }

  private File suggestFilename(Application app) {
    Settings cfg = app.getSettings();
    return new File(cfg.getImageDirectory(), String.format("%s-%d.%s", app.getInfo().getName().toLowerCase(), cfg.nextInt(), cfg.getImageFormat().toLowerCase()));
  }

  private boolean askOverwrite(Application app, File f) {
    return JOptionPane.showConfirmDialog(app.getAppFrame(), String.format("File '%s' already exists. Do you want to overwrite it?", f), "Overwrite?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
  }
View Full Code Here

Examples of com.subgraph.orchid.crypto.TorRandom.nextInt()

 
  private List<IntroductionPoint> shuffle(List<IntroductionPoint> list) {
    final TorRandom r = new TorRandom();
    final int sz = list.size();
    for(int i = 0; i < sz; i++) {
      swap(list, i, r.nextInt(sz));
    }
    return list;
  }
 
  private void swap(List<IntroductionPoint> list, int a, int b) {
View Full Code Here

Examples of com.tommytony.war.Warzone.nextInt()

          player.teleport(random.getTeleport());
        } else if (sign.getLine(1).equalsIgnoreCase("$active")) {
          List<Warzone> warzones = War.war.getActiveWarzones();
          if (warzones.size() == 0) warzones = War.war.getEnabledWarzones();
          if (warzones.size() == 0) return;
          int zone = random.nextInt(warzones.size());
          Warzone random = warzones.get(zone);
          player.teleport(random.getTeleport());
        }
      }
    }
View Full Code Here

Examples of com.twitter.common.util.Random.nextInt()

    int randomValue = 123;

    Random mockRandom = control.createMock(Random.class);

    if (!shouldThrow) {
      expect(mockRandom.nextInt(jitterWindowMs)).andReturn(randomValue);
    }

    control.replay();

    assertEquals(
View Full Code Here

Examples of com.yahoo.ycsb.generator.IntegerGenerator.nextInt()

        HashMap<String, ByteIterator> values = new HashMap<String, ByteIterator>();

        for (int i = 0; i < 4; i++)
        {
            String fieldkey = "field" + i;
            ByteIterator data = new RandomByteIterator(fieldlengthgenerator.nextInt());
            values.put(fieldkey, data);
        }
        return values;
    }
}
View Full Code Here

Examples of com.yahoo.ycsb.generator.ZipfianGenerator.nextInt()

        HashMap<String, ByteIterator> values = new HashMap<String, ByteIterator>();

        for (int i = 0; i < 4; i++)
        {
            String fieldkey = "field" + i;
            ByteIterator data = new RandomByteIterator(fieldlengthgenerator.nextInt());
            values.put(fieldkey, data);
        }
        return values;
    }
}
View Full Code Here

Examples of edu.brown.benchmark.ycsb.distributions.CustomSkewGenerator.nextInt()

      CustomSkewGenerator custom_skew = new CustomSkewGenerator(rand, max, hot_data_skew, hot_data_size, warm_data_skew, warm_data_size);
            Histogram<Integer> h = new ObjectHistogram<Integer>();

      System.out.println("Generating " + hot_data_skew + "/" + hot_data_size + "-" + warm_data_skew + "/" + warm_data_size + " distribution.");
            for (int j = 0; j < 100000; j++) {
                h.put(custom_skew.nextInt());
            } // FOR
            System.out.println(h);
            System.out.println("==========================================");
      System.out.flush();
     
View Full Code Here

Examples of edu.brown.benchmark.ycsb.distributions.ZipfianGenerator.nextInt()

            ZipfianGenerator zipf = new ZipfianGenerator(NUM_TUPLES, ZIPF_CONSTANT);

            for (int i = 0; i < keys.length; i++) {
                for (int j = 0; j < keys[i].length; j++) {
//                    keys[i][j] = rand.nextInt(NUM_TUPLES);
                      keys[i][j] = zipf.nextInt(NUM_TUPLES);
                    num_reads++;
                } // FOR
            } // FOR
           
            Procedure proc = this.getProcedure(SelectBlaster.class);
View Full Code Here

Examples of edu.brown.rand.RandomDistribution.Gaussian.nextInt()

                TimestampType timestamp = new TimestampType(t);
                if (first) {
                    this.start_date = timestamp;
                    first = false;
                }
                int num_flights = gaussian.nextInt();
                this.flights_per_day.put(timestamp, num_flights);
                this.total += num_flights;
            } // FOR
            if (this.start_date == null) this.start_date = this.today;
            profile.setFlightStartDate(this.start_date);
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.