|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.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 LaraRandom
LaraRandom.createNormal(double, double)
public Normal getCustomNormal(double mean, double std, String name)
getCustomNormal
in interface LaraRandom
name
- name of the generator to use from stored generators
LaraRandom.getCustomNormal(double,
double, java.lang.String)
public AbstractDistribution getDistribution(String name)
LaraRandom
AbstractDistribution
that is registered for the given
name.
getDistribution
in interface LaraRandom
LaraRandom.getDistribution(java.lang.String)
public RandomEngine getGenerator(String name)
getGenerator
in interface LaraRandom
LaraRandom.getGenerator(java.lang.String)
public Normal getNormal()
LaraRandom
Normal
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 LaraRandom
LaraRandom.getNormal()
public int getSeed()
LaraRandom
getSeed
in interface LaraRandom
LaraRandom.getSeed()
public Uniform getUniform()
LaraRandom
LaraRandom#getDistribution(LaraRandom.UNIFORM_DEFAULT)
.
getUniform
in interface LaraRandom
LaraRandom.getUniform()
public boolean isDebugEnabled()
LaraRandom
isDebugEnabled
in interface LaraRandom
LaraRandom.isDebugEnabled()
public void registerDistribution(AbstractDistribution dist, String name)
LaraRandom
AbstractDistribution
at the given name.
registerDistribution
in interface LaraRandom
de.cesr.lara.components.util.LaraRandom#registerDistribution(cern.jet.random.AbstractDistribution,
java.lang.String)
public void registerGenerator(String name, RandomEngine generator)
registerGenerator
in interface LaraRandom
name
- 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 LaraRandom
LaraRandom.setSeed(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |