Examples of nextFloat()


Examples of java.util.Random.nextFloat()

            randomizer.nextInt(keyValues.size())).getQualifier();
      } else {
        qualifier = new byte[FIELD_LENGTH];
        randomizer.nextBytes(qualifier);
      }
      if (0 < i && randomizer.nextFloat() < CHANCE_TO_REPEAT) {
        value = keyValues.get(randomizer.nextInt(keyValues.size())).getValue();
      } else {
        value = new byte[FIELD_LENGTH];
        randomizer.nextBytes(value);
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

        value = keyValues.get(randomizer.nextInt(keyValues.size())).getValue();
      } else {
        value = new byte[FIELD_LENGTH];
        randomizer.nextBytes(value);
      }
      if (0 < i && randomizer.nextFloat() < CHANCE_TO_REPEAT) {
        timestamp = keyValues.get(
            randomizer.nextInt(keyValues.size())).getTimestamp();
      } else {
        timestamp = randomizer.nextLong();
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

    final RepeatingTokenStream ts = new RepeatingTokenStream(val);

    Analyzer analyzer = new Analyzer() {
      @Override
      public TokenStream tokenStream(String fieldName, Reader reader) {
        if (random.nextFloat() < percentDocs) ts.num = random.nextInt(maxTF)+1;
        else ts.num=0;
        return ts;
      }
    };
View Full Code Here

Examples of java.util.Random.nextFloat()

        break;
      case 'L':
        result.add(r.nextLong());
        break;
      case 'F':
        result.add(r.nextFloat());
        break;
      case 'D':
        result.add(r.nextDouble());
        break;
      case 'S':
View Full Code Here

Examples of java.util.Random.nextFloat()

    void genData(Encoder e) throws IOException {
      e.writeArrayStart();
      e.setItemCount(count);
      Random r = newRandom();
      for (int i = 0; i < count; i++) {
        e.writeFloat(r.nextFloat());
      }
      e.writeArrayEnd();
    }

    @Override
View Full Code Here

Examples of java.util.Random.nextFloat()

    void genData(Encoder e) throws IOException {
      e.writeArrayStart();
      e.setItemCount(count);
      Random r = newRandom();
      for (int i = 0; i < count; i++) {
        e.writeDouble(r.nextFloat());
      }
      e.writeArrayEnd();
    }
    @Override
    void readInternal(Decoder d) throws IOException {
View Full Code Here

Examples of java.util.Random.nextFloat()

   
    {
      final long seed = random().nextLong();
      Random r = new Random(seed);
      CommonTermsQuery left = new CommonTermsQuery(randomOccur(r),
          randomOccur(r), r.nextFloat(), r.nextBoolean());
      int leftTerms = atLeast(r, 2);
      for (int i = 0; i < leftTerms; i++) {
        left.add(new Term(_TestUtil.randomRealisticUnicodeString(r), _TestUtil
            .randomRealisticUnicodeString(r)));
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

      left.setHighFreqMinimumNumberShouldMatch(r.nextInt(4));
      left.setLowFreqMinimumNumberShouldMatch(r.nextInt(4));
     
      r = new Random(seed);
      CommonTermsQuery right = new CommonTermsQuery(randomOccur(r),
          randomOccur(r), r.nextFloat(), r.nextBoolean());
      int rightTerms = atLeast(r, 2);
      for (int i = 0; i < rightTerms; i++) {
        right.add(new Term(_TestUtil.randomRealisticUnicodeString(r), _TestUtil
            .randomRealisticUnicodeString(r)));
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

      float[] orig = new float[1024];
      MutableSparseFloatArray fromEmpty = new MutableSparseFloatArray(new float[1024]);
      float density = 0.2f;
      int idx = 0;
      while (rand.nextFloat() > density) {
        idx++;
      }
      while (idx < orig.length) {
        float val = rand.nextFloat();
        orig[idx] = val;
View Full Code Here

Examples of java.util.Random.nextFloat()

      int idx = 0;
      while (rand.nextFloat() > density) {
        idx++;
      }
      while (idx < orig.length) {
        float val = rand.nextFloat();
        orig[idx] = val;
        fromEmpty.set(idx, val);
        idx += 1;
        while (rand.nextDouble() > density) {
          idx++;
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.