|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.cesr.lara.components.util.impl.LRandomService
public class LRandomService
Uses the MersenneTwister as generator.
TODO substitute by URaNuS (or clear generators) TODO document (SH) TODO
methods to check if given distribution name is of given class
| Field Summary |
|---|
| Fields inherited from interface de.cesr.lara.components.util.LaraRandom |
|---|
NORMAL_DEFAULT, UNIFORM_DEFAULT |
| Constructor Summary | |
|---|---|
LRandomService(int seed)
Initialise a new instance with the given random seed. |
|
| Method Summary | |
|---|---|
Normal |
createNormal(double mean,
double std)
Create a normal distribution with the given parameters using the default random generator. |
Normal |
getCustomNormal(double mean,
double std,
String name)
|
AbstractDistribution |
getDistribution(String name)
Returns the AbstractDistribution that is registered for the given
name. |
RandomEngine |
getGenerator(String name)
|
Normal |
getNormal()
Returns the Normal distribution that was created at last
(therefore, mean and standard deviation is not defined). |
int |
getSeed()
Get the seed currently used for the default distributions. |
Uniform |
getUniform()
Return the default uniform distribution. |
boolean |
isDebugEnabled()
Checks if the logger of LRandomService is set to debug. |
void |
registerDistribution(AbstractDistribution dist,
String name)
Registers a custom AbstractDistribution at the given name. |
void |
registerGenerator(String name,
RandomEngine generator)
|
void |
setSeed(int seed)
Sets the seed for all random number generators. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LRandomService(int seed)
seed - | Method Detail |
|---|
public Normal createNormal(double mean,
double std)
LaraRandom
createNormal in interface LaraRandomLaraRandom.createNormal(double, double)
public Normal getCustomNormal(double mean,
double std,
String name)
getCustomNormal in interface LaraRandomname - name of the generator to use from stored generators
LaraRandom.getCustomNormal(double,
double, java.lang.String)public AbstractDistribution getDistribution(String name)
LaraRandomAbstractDistribution that is registered for the given
name.
getDistribution in interface LaraRandomLaraRandom.getDistribution(java.lang.String)public RandomEngine getGenerator(String name)
getGenerator in interface LaraRandomLaraRandom.getGenerator(java.lang.String)public Normal getNormal()
LaraRandomNormal distribution that was created at last
(therefore, mean and standard deviation is not defined). Equivalent to
LaraRandom#getDistribution(LaraRandom.NORMAL_DEFAULT).
Returns null if no normal distribution has been created yet.
getNormal in interface LaraRandomLaraRandom.getNormal()public int getSeed()
LaraRandom
getSeed in interface LaraRandomLaraRandom.getSeed()public Uniform getUniform()
LaraRandomLaraRandom#getDistribution(LaraRandom.UNIFORM_DEFAULT).
getUniform in interface LaraRandomLaraRandom.getUniform()public boolean isDebugEnabled()
LaraRandom
isDebugEnabled in interface LaraRandomLaraRandom.isDebugEnabled()
public void registerDistribution(AbstractDistribution dist,
String name)
LaraRandomAbstractDistribution at the given name.
registerDistribution in interface LaraRandomde.cesr.lara.components.util.LaraRandom#registerDistribution(cern.jet.random.AbstractDistribution,
java.lang.String)
public void registerGenerator(String name,
RandomEngine generator)
registerGenerator in interface LaraRandomname - to associte the given generator withgenerator - to registerde.cesr.lara.components.util.LaraRandom#registerGenerator(java.lang.String,
cern.jet.random.engine.RandomEngine)public void setSeed(int seed)
LaraRandom
setSeed in interface LaraRandomLaraRandom.setSeed(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||