public class RandomGenerator extends Object
Modifier and Type | Field and Description |
---|---|
private int |
_ncall |
private Random |
_rand |
private long |
_seed |
Constructor and Description |
---|
RandomGenerator()
Default constructor.
|
RandomGenerator(long seed)
Constructor from seed.
|
RandomGenerator(RandomGenerator rgen)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
flat(double min,
double max)
Return a flat value in range (min.max).
|
protected double |
gauss()
Return a random number according to a Gaussian distribution
with sigma = 1.0.
|
long |
seed()
Get the seed.
|
void |
setSeed(long seed)
Set the seed.
|
private void |
setState(long seed,
int ncall)
Set the state = seed and number of calls.
|
void |
setState(RandomGenerator rgen)
Set the state (seed + ncall) to be the same as that of the argument.
|
String |
toString()
String representation of this RandomGenerator.
|
private Random _rand
private int _ncall
private long _seed
public RandomGenerator()
public RandomGenerator(long seed)
seed
- long value seeding the random number generator.public RandomGenerator(RandomGenerator rgen)
rgen
- The RandomGenerator to copy.private void setState(long seed, int ncall)
seed
- Random number seedncall
- Number of calls to this generatorprotected double flat(double min, double max)
min
- The minimum of the range.max
- The maximum of the range.protected double gauss()
public void setSeed(long seed)
seed
- long value seeding the random number generator.public long seed()
public void setState(RandomGenerator rgen)
rgen
- RandomGenerator used to set the state of this RandomGenerator.Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.