/** * {@inheritDoc} */ public synchronized float nextFloat() { return wrapped.nextFloat(); }
@Override public float nextFloat() { return random.nextFloat(); }
/** * Returns the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this random * number generator's sequence. * * @return the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this * random number generator's sequence */ @Override public float nextFloat() { return randomGenerator.nextFloat(); }
@Override public float nextFloat() { return getRandomGenerator().nextFloat(); }
/** * Returns the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this random * number generator's sequence. * * @return the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this * random number generator's sequence */ @Override public float nextFloat() { return randomGenerator.nextFloat(); }
/** * {@inheritDoc} */ public synchronized float nextFloat() { return wrapped.nextFloat(); }
@Override public float nextFloat() { return random.nextFloat(); }
/** * {@inheritDoc} */ public synchronized float nextFloat() { return wrapped.nextFloat(); }
@Override public float nextFloat() { return delegateRng.nextFloat(); }
/** * Returns the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this random * number generator's sequence. * * @return the next pseudorandom, uniformly distributed <code>float</code> * value between <code>0.0</code> and <code>1.0</code> from this * random number generator's sequence */ @Override public float nextFloat() { return randomGenerator.nextFloat(); }
@Override public float nextFloat() { return getRandomGenerator().nextFloat(); }
private static void generateBrownian(DoubleColumn col, long first, double start, double end, NormalDistribution nd, RandomGenerator rand) { double x = start; int chunkSize = (int) Math.min(col.length() - first, CHUNK_SIZE); for (int i = 0; i < chunkSize; i++) { col.set(first + i, x); double p = rand.nextFloat() + 0.5 / (1 << 24); double v = nd.inverseCumulativeProbability(p); x += v; assert !Double.isInfinite(x); } double diff = end - x; double gradient = diff / chunkSize; for (int i = 0; i < chunkSize; i++) { col.add(first + i, i * gradient); } }
RandomGenerator rand = new MersenneTwister(); for (int i = 0; i < trendLength - 1; i++) { float f = rand.nextFloat(); trend.writeDouble((long) i << 3, x); x += nd.inverseCumulativeProbability(f);
/** * */ @Override public void execute() { final double x = getRandomGenerator().nextFloat() - 0.5; final double y = getRandomGenerator().nextFloat() - 0.5; Position randomVersor = new Continuous2DEuclidean(x, y); if (x == 0) { randomVersor = new Continuous2DEuclidean(0, 1); } else if (y == 0) { randomVersor = new Continuous2DEuclidean(1, 0); } else { final double module = FastMath.sqrt(FastMath.pow(x, 2) + FastMath.pow(y, 2)); if (module == 0) { randomVersor = new Continuous2DEuclidean(0, 0); } else { randomVersor = new Continuous2DEuclidean(x / module, y / module); } } getNode().addPolarization(randomVersor); }
rng.nextBytes(new byte[] {}); rng.nextDouble(); rng.nextFloat(); rng.nextGaussian(); rng.nextInt();