Examples of UniformDistribution


Examples of ar.edu.unlp.yaqc4j.randoms.UniformDistribution

      return generator;
    }
    if (paramClass.isArray()) {
      return this.generatorForArray(paramClass, position);
    }
    generator = Arbitrary.getGeneratorFor(new UniformDistribution(),
        paramClass);
    if (generator != null) {
      return generator;
    } else {
      throw new RuntimeException(String.format(
View Full Code Here

Examples of ar.edu.unlp.yaqc4j.randoms.UniformDistribution

   * Getter of default random element.
   *
   * @return a random.
   */
  public static Distribution defaultDistribution() {
    return new UniformDistribution();
  }
View Full Code Here

Examples of com.facebook.LinkBench.distributions.UniformDistribution

    testSanityBuiltinDist(AccessDistMode.ROUND_ROBIN, 0);
  }

  @Test
  public void testUniform() {
    UniformDistribution u = new UniformDistribution();
    Properties props = new Properties();
    int min = 100, max = 200;
    u.init(min, max, props, "");
    ProbAccessDistribution unshuffled = new ProbAccessDistribution(u, null);
    testSanityAccessDist(unshuffled, min, max);

    ProbAccessDistribution shuffled = new ProbAccessDistribution(u,
                        new InvertibleShuffler(13, 25, max - min));
View Full Code Here

Examples of com.facebook.LinkBench.distributions.UniformDistribution

public class UniformDistTest extends DistributionTestBase {

  @Override
  public ProbabilityDistribution getDist() {
    return new UniformDistribution();
  }
View Full Code Here

Examples of com.facebook.LinkBench.distributions.UniformDistribution

    long maxes[] = {(long)Math.pow(2, 31.5), (long)Math.pow(2, 34.23)};
    int trials = 10000;
    Random rng = new Random();

    for (long max: maxes) {
      UniformDistribution dist = new UniformDistribution();
      dist.init(0, max, 1);
      for (int trial = 0; trial < trials; trial++) {
        long i = dist.choose(rng);
        assertTrue(i >= 0);
        assertTrue(i < max);
      }
    }
  }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.data.synthetic.bymodel.distribution.UniformDistribution

      max = Double.valueOf(maxstr);
    }

    // *** new uniform generator
    Random random = cluster.getNewRandomGenerator();
    Distribution generator = new UniformDistribution(min, max, random);
    cluster.addGenerator(generator);

    // TODO: check for unknown attributes.
    for(Node child : new XMLNodeIterator(cur.getFirstChild())) {
      if(child.getNodeType() == Node.ELEMENT_NODE) {
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.math.statistics.distribution.UniformDistribution

      max = Double.parseDouble(maxstr);
    }

    // *** new uniform generator
    Random random = cluster.getNewRandomGenerator();
    Distribution generator = new UniformDistribution(min, max, random);
    cluster.addGenerator(generator);

    // TODO: check for unknown attributes.
    for(Node child : new XMLNodeIterator(cur.getFirstChild())) {
      if(child.getNodeType() == Node.ELEMENT_NODE) {
View Full Code Here

Examples of org.dmg.pmml.pmml_4_2.descr.UniformDistribution

            return "new Double[] { " + gd.getMean() + ", " + gd.getVariance() + " }";
        } else if ( d instanceof PoissonDistribution ) {
            PoissonDistribution pd = (PoissonDistribution) d;
            return "new Double[] { " + pd.getMean() + " }";
        } else if ( d instanceof UniformDistribution ) {
            UniformDistribution ud = (UniformDistribution) d;
            return "new Double[] { " + ud.getLower() + ", " + ud.getUpper() + " }";
        } else if ( d instanceof AnyDistribution ) {
            AnyDistribution ad = (AnyDistribution) d;
            return "new Double[] { " + ad.getMean() + ", " + ad.getVariance() + " }";
        }
        throw new IllegalStateException( "Unrecognized Distribution type " + d.getClass().getName() );
View Full Code Here

Examples of org.jamesii.core.math.random.distributions.UniformDistribution

   *          the random number generator to be used
   */
  public UniformNode(IRandom rng) {
    super();
    random = rng;
    distrib = new UniformDistribution(random);
  }
View Full Code Here

Examples of org.jamesii.core.math.random.distributions.UniformDistribution

  @SuppressWarnings("unchecked")
  @Override
  public <N extends INode> N calc(IEnvironment<?> cEnv) {

    distrib =
        new UniformDistribution(random,
            ((ValueNode<Double>) lowerB.calc(cEnv)).getValue(),
            ((ValueNode<Double>) upperB.calc(cEnv)).getValue());

    return (N) new ValueNode<>(distrib.getRandomNumber());
  }
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.