Examples of nextBoolean()


Examples of java.util.Random.nextBoolean()

        Random r = new Random(Array.get(dataArray, 0).hashCode());
        for (int i = 0; i < len; ++i) {
            Object value = Array.get(dataArray, i).toString();
            sb.append(value);
            // Let's add 25% of time
            if (addNoise && r.nextBoolean() && r.nextBoolean()) {
                if (r.nextBoolean()) {
                    sb.append("<!-- comment: "+value+" -->");
                } else {
                    sb.append("<?pi "+value+"?>");
                }
View Full Code Here

Examples of java.util.Random.nextBoolean()

        for (int i = 0; i < len; ++i) {
            Object value = Array.get(dataArray, i).toString();
            sb.append(value);
            // Let's add 25% of time
            if (addNoise && r.nextBoolean() && r.nextBoolean()) {
                if (r.nextBoolean()) {
                    sb.append("<!-- comment: "+value+" -->");
                } else {
                    sb.append("<?pi "+value+"?>");
                }
            }
View Full Code Here

Examples of java.util.Random.nextBoolean()

                int len = ARRAY_TEST_LENGTHS[i-1];
                data = new float[len];
                for (int ix = 0; ix < len; ++ix) {
                    // Need to scale: nextFloat is [0.0, 1.0[
                    float value = rnd.nextFloat();
                    if (rnd.nextBoolean()) {
                        value = (float) (value * rnd.nextInt());
                    }
                    if (rnd.nextBoolean()) {
                        value = -value;
                    }
View Full Code Here

Examples of java.util.Random.nextBoolean()

                    // Need to scale: nextFloat is [0.0, 1.0[
                    float value = rnd.nextFloat();
                    if (rnd.nextBoolean()) {
                        value = (float) (value * rnd.nextInt());
                    }
                    if (rnd.nextBoolean()) {
                        value = -value;
                    }
                    data[ix] = value;
                }
            }
View Full Code Here

Examples of java.util.Random.nextBoolean()

                int len = ARRAY_TEST_LENGTHS[i-1];
                data = new double[len];
                for (int ix = 0; ix < len; ++ix) {
                    // Need to scale: nextDouble is [0.0, 1.0[
                    double value = rnd.nextDouble();
                    if (rnd.nextBoolean()) {
                        value = (value * rnd.nextLong());
                    }
                    if (rnd.nextBoolean()) {
                        value = -value;
                    }
View Full Code Here

Examples of java.util.Scanner.nextBoolean()

    Scanner s = new Scanner (inStr);
    i = 0;
    hasNext = s.hasNextBoolean ();
    while (hasNext)
      {
  aktValue = s.nextBoolean ();
  this.myHarness.check (aktValue, values[i],
            "nextBoolean() is wrong : " + aktValue +
            " != " + values[i]);
  i++;
  hasNext = s.hasNextBoolean ();
View Full Code Here

Examples of org.apache.commons.math3.random.RandomGenerator.nextBoolean()

            Assert.assertEquals(0.0, r.applyTo(c.getXAxis()).distance(tc.getXAxis()), 1.0e-10);
            Assert.assertEquals(0.0, r.applyTo(c.getYAxis()).distance(tc.getYAxis()), 1.0e-10);
            Assert.assertEquals(c.getTolerance(), ((Circle) t.apply(c)).getTolerance(), 1.0e-10);

            SubLimitAngle  sub = new LimitAngle(new S1Point(MathUtils.TWO_PI * random.nextDouble()),
                                                random.nextBoolean(), 1.0e-10).wholeHyperplane();
            Vector3D psub = c.getPointAt(((LimitAngle) sub.getHyperplane()).getLocation().getAlpha());
            SubLimitAngle tsub = (SubLimitAngle) t.apply(sub, c, tc);
            Vector3D ptsub = tc.getPointAt(((LimitAngle) tsub.getHyperplane()).getLocation().getAlpha());
            Assert.assertEquals(0.0, r.applyTo(psub).distance(ptsub), 1.0e-10);

View Full Code Here

Examples of org.apache.commons.math3.random.Well1024a.nextBoolean()

            Assert.assertEquals(0.0, r.applyTo(c.getXAxis()).distance(tc.getXAxis()), 1.0e-10);
            Assert.assertEquals(0.0, r.applyTo(c.getYAxis()).distance(tc.getYAxis()), 1.0e-10);
            Assert.assertEquals(c.getTolerance(), ((Circle) t.apply(c)).getTolerance(), 1.0e-10);

            SubLimitAngle  sub = new LimitAngle(new S1Point(MathUtils.TWO_PI * random.nextDouble()),
                                                random.nextBoolean(), 1.0e-10).wholeHyperplane();
            Vector3D psub = c.getPointAt(((LimitAngle) sub.getHyperplane()).getLocation().getAlpha());
            SubLimitAngle tsub = (SubLimitAngle) t.apply(sub, c, tc);
            Vector3D ptsub = tc.getPointAt(((LimitAngle) tsub.getHyperplane()).getLocation().getAlpha());
            Assert.assertEquals(0.0, r.applyTo(psub).distance(ptsub), 1.0e-10);

View Full Code Here

Examples of org.apache.mahout.common.RandomWrapper.nextBoolean()

    for (int nloop = 0; nloop < n; nloop++) {
      RandomWrapper rng = (RandomWrapper) RandomUtils.getRandom();

      long seed = rng.getSeed();
      double threshold = rng.nextDouble();
      boolean training = rng.nextBoolean();

      DatasetSplit split = new DatasetSplit(seed, threshold);
      split.setTraining(training);

      JobConf conf = new JobConf();
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG.nextBoolean()

      // all weights are 1 (active)
      CDRule rule = new CDRule(0.);
      for (int condInd = 0; condInd < rule.getNbConditions(); condInd++) {
        rule.setW(condInd, 1.);
        rule.setO(condInd, rng.nextBoolean());
        rule.setV(condInd, rng.nextInt(2)); // two categories
      }

      // the condition is true if the operator is == and the values are equal
      // (value==1), or the operator is != and the values are no equal
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.