List of utility methods to do Random Double
double[] | randomDoubleArray(int len) Produce an array of random numbers in [0:1]. return randomDoubleArray(len, new Random()); |
double | randomDoubleBetween(double a, double b) random Double Between return (Math.random() * (b - a) + a);
|
double | randomDoubleOperand(Random rnd) random Double Operand switch (rnd.nextInt(3)) { case 0: return rnd.nextDouble(); case 1: return rnd.nextGaussian(); default: return Double.longBitsToDouble(rnd.nextLong()); |
boolean | randomFlip(double probTrue) random Flip return Math.random() <= probTrue;
|
double | randomIn(double in) random In return (double) (Math.random() * in); |
void | randomInitialize(double[] base) random Initialize for (int i = 0; i < base.length; i++) { base[i] = Math.random() / 10000; |
double | randomInRange(double min, double max) random In Range return Math.random() < 0.5 ? ((1 - Math.random()) * (max - min) + min)
: (Math.random() * (max - min) + min);
|
boolean | randomPercent(double percent) random Percent return (Math.random() * 100.0) <= percent;
|
double | randomRange(double min, double max) Returns a pseudorandom double within the given range. return min + (Math.random() * ((max - min) + 1));
|
double | randRealUniform(double minrange, double maxrange) Generates a random real number in the given range. return minrange + (Math.random() * (maxrange - minrange));
|