public final class Rand
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static Rand |
standard
A standard random generator that uses
Random. |
| Modifier and Type | Method and Description |
|---|---|
double |
choose(double from,
double to)
Randomly chooses a value between the given range (inclusive).
|
int |
choose(int from,
int to)
Randomly chooses a value between the given range (inclusive).
|
double |
choose(long seed,
double from,
double to)
Randomly chooses a value between the given range (inclusive).
|
int |
choose(long seed,
int from,
int to)
Randomly chooses a value between the given range (inclusive).
|
static Rand |
rand(fj.F<fj.data.Option<java.lang.Long>,fj.F<java.lang.Integer,fj.F<java.lang.Integer,java.lang.Integer>>> f,
fj.F<fj.data.Option<java.lang.Long>,fj.F<java.lang.Double,fj.F<java.lang.Double,java.lang.Double>>> g)
Constructs a random generator from the given functions that supply a range to produce a
result.
|
Rand |
reseed(long seed)
Gives this random generator a new seed.
|
public static final Rand standard
Random.public int choose(long seed,
int from,
int to)
seed - The seed to use for random generation.from - The minimum value to choose.to - The maximum value to choose.public int choose(int from,
int to)
from - The minimum value to choose.to - The maximum value to choose.public double choose(long seed,
double from,
double to)
seed - The seed to use for random generation.from - The minimum value to choose.to - The maximum value to choose.public double choose(double from,
double to)
from - The minimum value to choose.to - The maximum value to choose.public Rand reseed(long seed)
seed - The seed of the new random generator.public static Rand rand(fj.F<fj.data.Option<java.lang.Long>,fj.F<java.lang.Integer,fj.F<java.lang.Integer,java.lang.Integer>>> f, fj.F<fj.data.Option<java.lang.Long>,fj.F<java.lang.Double,fj.F<java.lang.Double,java.lang.Double>>> g)
f - The integer random generator.g - The floating-point random generator.