|
Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfj.test.Rand
public final class Rand
A random number generator.
| Field Summary | |
|---|---|
static Rand |
standard
A standard random generator that uses Random. |
| Method Summary | |
|---|---|
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(F<Option<Long>,F<Integer,F<Integer,Integer>>> f,
F<Option<Long>,F<Double,F<Double,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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Rand standard
Random.
| Method Detail |
|---|
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(F<Option<Long>,F<Integer,F<Integer,Integer>>> f,
F<Option<Long>,F<Double,F<Double,Double>>> g)
f - The integer random generator.g - The floating-point random generator.
|
Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||