Examples of RandomAdaptor


Examples of org.apache.commons.math3.random.RandomAdaptor

            points.add(outerCircle.add(generateNoiseVector(dist)));
            points.add(innerCircle.add(generateNoiseVector(dist)));
        }
       
        if (shuffle) {
            Collections.shuffle(points, new RandomAdaptor(random));
        }

        return points;
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

            Vector2D innerCircle = new Vector2D(1 - FastMath.cos(angle), 1 - FastMath.sin(angle) - 0.5);
            points.add(innerCircle.add(generateNoiseVector(dist)));
        }
       
        if (shuffle) {
            Collections.shuffle(points, new RandomAdaptor(random));
        }

        return points;
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

                points.add(point.add(centerPoints[i]));
            }
        }
       
        if (shuffle) {
            Collections.shuffle(points, new RandomAdaptor(random));
        }

        return points;
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

    public Random createRandom() {
        switch (randomType) {
            case JDK:
                return randomSeed == null ? new Random() : new Random(randomSeed);
            case MERSENNE_TWISTER:
                return new RandomAdaptor(randomSeed == null ? new MersenneTwister() : new MersenneTwister(randomSeed));
            case WELL512A:
                return new RandomAdaptor(randomSeed == null ? new Well512a() : new Well512a(randomSeed));
            case WELL1024A:
                return new RandomAdaptor(randomSeed == null ? new Well1024a() : new Well1024a(randomSeed));
            case WELL19937A:
                return new RandomAdaptor(randomSeed == null ? new Well19937a() : new Well19937a(randomSeed));
            case WELL19937C:
                return new RandomAdaptor(randomSeed == null ? new Well19937c() : new Well19937c(randomSeed));
            case WELL44497A:
                return new RandomAdaptor(randomSeed == null ? new Well44497a() : new Well44497a(randomSeed));
            case WELL44497B:
                return new RandomAdaptor(randomSeed == null ? new Well44497b() : new Well44497b(randomSeed));
            default:
                throw new IllegalStateException("The randomType (" + randomType + ") is not implemented.");
        }
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

      checkNotNull(event);
      final Iterator<Point> points = measureString(
          ((Text) event.widget).getText(), 30, 30d, 0).iterator();
      final List<Vehicle> vs = newArrayList(vehicles);
      if (event.type == SWT.DefaultSelection) {
        Collections.shuffle(vs, new RandomAdaptor(rng));
      }
      for (final Vehicle v : vs) {
        if (points.hasNext()) {
          v.setDestination(points.next());
        } else {
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

      assigned.addAll(conts);
      if (vso.destination != null
          && state.availableParcels.contains(vso.destination)) {
        assigned.add(vso.destination);
      }
      Collections.shuffle(assigned, new RandomAdaptor(randomGenerator));
      if (vso.destination != null) {
        assigned.add(0, vso.destination);
      }
      builder.add(ImmutableList.copyOf(assigned));
    }
View Full Code Here

Examples of org.apache.commons.math3.random.RandomAdaptor

    checkState(floorTimes + ceilTimes == arrivalTimes.size());

    final List<Integer> orderCountList = newArrayList();
    orderCountList.addAll(nCopies(floorTimes, floor));
    orderCountList.addAll(nCopies(ceilTimes, ceiling));
    Collections.shuffle(orderCountList, new RandomAdaptor(rng));

    final ImmutableList.Builder<Double> lb = ImmutableList.builder();
    for (int i = 0; i < arrivalTimes.size(); i++) {
      for (int j = 0; j < orderCountList.get(i); j++) {
        lb.add(arrivalTimes.get(i));
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.