|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UranusRandomService
Uranus - Universal RAndom NUmber Service
Field Summary | |
---|---|
static String |
NORMAL_DEFAULT
Identifier for default normal stream (not necessarily standard!) |
static String |
UNIFORM_DEFAULT
Identifier for default uniform stream |
Method Summary | |
---|---|
Normal |
createNormal(double mean,
double stdDev)
Create a normal distribution with the given parameters using the default random generator. |
Normal |
createNormal(double mean,
double std,
RandomEngine generator)
Create a normal distribution with the given parameters using the given random generator. |
AbstractDistribution |
getDistribution(String name)
Returns the AbstractDistribution that is registered for the given name. |
RandomEngine |
getGenerator(String name)
|
Uniform |
getNewUniformDistribution(RandomEngine engine)
Returns a Uniform distribution that is fed by the given RandomEngine . |
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. |
Uniform |
getUniform(double from,
double to,
RandomEngine engine)
|
String |
identifyDistribution(AbstractDistribution distribution)
Identifies the name of the given AbstractDistribution if
registered at this service. |
String |
identifyGenerator(RandomEngine generator)
Identifies the name of the given RandomEngine if registered at
this service. |
boolean |
isDebugEnabled()
Checks if the logger of LRandomService is set to debug. |
boolean |
isDistributionRegistered(String name)
Checks whether a distribution with the given name is registered. |
boolean |
isGeneratorRegistered(String name)
Checks whether a generator with the given name is registered. |
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. |
Field Detail |
---|
static final String UNIFORM_DEFAULT
static final String NORMAL_DEFAULT
Method Detail |
---|
Uniform getUniform()
LaraRandom#getDistribution(MoreRandomServicem.UNIFORM_DEFAULT)
.
Uniform getUniform(double from, double to, RandomEngine engine)
from
- to
- engine
-
Uniform getNewUniformDistribution(RandomEngine engine)
RandomEngine
.
Advantage: Uses a UUniformDistributionController
in case logger is debug enabled.
engine
- to fed the distribution
Normal createNormal(double mean, double stdDev)
mean
- stdDev
-
Normal createNormal(double mean, double std, RandomEngine generator)
mean
- std
- generator
- the generator to use
Normal getNormal()
Normal
distribution that was created at last (therefore,
mean and standard deviation is not defined). Equivalent to
UranusRandomService#getDistribution(UranusRandomService.NORMAL_DEFAULT)
.
Returns null if no normal distribution has been created yet.
void registerDistribution(AbstractDistribution dist, String name)
AbstractDistribution
at the given name.
dist
- name
- AbstractDistribution getDistribution(String name)
AbstractDistribution
that is registered for the given name.
name
-
boolean isDistributionRegistered(String name)
name
- the distribution's name
void registerGenerator(String name, RandomEngine generator)
name
- to associate the given generator withgenerator
- to registerRandomEngine getGenerator(String name)
name
-
boolean isGeneratorRegistered(String name)
name
- the generator's name
void setSeed(int seed)
seed
- int getSeed()
boolean isDebugEnabled()
String identifyDistribution(AbstractDistribution distribution)
AbstractDistribution
if
registered at this service.
NOTE: The lookup is time consuming since this operation is meant to be
use only for debugging purposes, and the service is optimised for other
uses.
generator
-
String identifyGenerator(RandomEngine generator)
RandomEngine
if registered at
this service.
NOTE: The lookup is time consuming since this operation is meant to be
use only for debugging purposes, and the service is optimised for other
uses.
generator
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |