SimObs
Class Sample
java.lang.Object
|
+--java.util.Random
|
+--SimObs.Sample
- public class Sample
- extends java.util.Random
Used to create streamable random numbers and associated routines to sample
from probability distributions.
- See Also:
- Serialized Form
Constructor Summary |
Sample(long thisSeed)
Constructor, passes the seed to the Random super-class. |
Method Summary |
int |
NegExp(double mean)
Returns with an integer sample from a (negative) exponential distribution
with a double precision mean. |
int |
negExp(float mean)
Returns with an integer sample from a (negative) exponential distribution
with a floating point mean. |
int |
NegExp(int mean)
Returns with an integer sample from a (negative) exponential distribution
with an integer mean. |
int |
uniform(double min,
double max)
Returns with a sample from a uniform distribution. |
int |
uniform(float min,
float max)
Returns with a sample from a uniform distribution. |
int |
uniform(int min,
int max)
Returns with a sample from a uniform distribution. |
Methods inherited from class java.util.Random |
next,
nextBoolean,
nextBytes,
nextDouble,
nextFloat,
nextGaussian,
nextInt,
nextInt,
nextLong,
setSeed |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Sample
public Sample(long thisSeed)
- Constructor, passes the seed to the Random super-class.
NegExp
public int NegExp(int mean)
- Returns with an integer sample from a (negative) exponential distribution
with an integer mean.
negExp
public int negExp(float mean)
- Returns with an integer sample from a (negative) exponential distribution
with a floating point mean.
NegExp
public int NegExp(double mean)
- Returns with an integer sample from a (negative) exponential distribution
with a double precision mean.
uniform
public int uniform(int min,
int max)
- Returns with a sample from a uniform distribution.
min is the minimum and max is the maximum of its range. Both integers.
No checks to see if min <= max.
uniform
public int uniform(float min,
float max)
- Returns with a sample from a uniform distribution.
min is the minimum and max is the maximum of its range. Both floating point.
No checks to see if min <= max.
uniform
public int uniform(double min,
double max)
- Returns with a sample from a uniform distribution.
min is the minimum and max is the maximum of its range. Both double precision.
No checks to see if min <= max.