Package com.facebook.LinkBench.distributions

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.choose()


    ProbabilityDistribution dist = getDist();
    long min = 453, max = 26546454;
    dist.init(min, max, getDistParams(), "");
    Random rng = initRandom("testChooseSanity");
    for (int i = 0; i < 100000; i++) {
      long id = dist.choose(rng);
      assertTrue(id >= min);
      assertTrue(id < max);
    }
  }
View Full Code Here


    ProbabilityDistribution dist = getDist();
    dist.init(min, max, getDistParams(), "");

    int trials = 1000000;
    for (int i = 0; i < trials; i++) {
      long id = dist.choose(rng);
      long off = id - min;
      int bucket = bucketer.chooseBucket(off, n);
      buckets[bucket]++;
    }
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.