Manages a thread which calls a specified function at a specified interval.
More...
|
template<typename RealType = double> |
double | getRand_normalDist (RealType mean=0.0, RealType stddev=1.0) |
| Gets a random number from a normal distribution.
|
|
template<typename IntType = int> |
double | getRand_uniformIntDist (IntType min=0, IntType max=std::numeric_limits< IntType >::max()) |
| Gets a random integer number from an uniform distribution.
|
|
template<typename RealType = double> |
double | getRand_uniformRealDist (RealType min=0.0, RealType max=1.0) |
| Gets a random real number from an uniform distribution.
|
|
RandomNumberGenerator & | operator= (const RandomNumberGenerator &)=delete |
| Copy assignment operator.
|
|
RandomNumberGenerator & | operator= (RandomNumberGenerator &&)=delete |
| Move assignment operator.
|
|
| RandomNumberGenerator (bool useSeed=true) |
| Default constructor.
|
|
| RandomNumberGenerator (const RandomNumberGenerator &)=delete |
| Copy constructor.
|
|
| RandomNumberGenerator (RandomNumberGenerator &&)=delete |
| Move constructor.
|
|
void | resetSeed (size_t id=0) |
| Reset the seed to the internal seed or the system time.
|
|
void | resetSeedOnce (uint64_t userSeed) |
| Reset the seed to the specified seed, but do not update the internal seed.
|
|
| ~RandomNumberGenerator ()=default |
| Destructor.
|
|
|
uint64_t | seed |
| Seed for the random number generator.
|
|
bool | useSeed |
| Flag whether to use the seed instead of the system time.
|
|
Manages a thread which calls a specified function at a specified interval.
◆ getRand_normalDist()
template<typename RealType = double>
double NAV::RandomNumberGenerator::getRand_normalDist |
( |
RealType | mean = 0.0, |
|
|
RealType | stddev = 1.0 ) |
|
inline |
Gets a random number from a normal distribution.
- Template Parameters
-
RealType | The result type generated by the generator. The effect is undefined if this is not one of float, double, or long double |
- Parameters
-
mean | The μ distribution parameter (mean) |
stddev | The σ distribution parameter (standard deviation) |
- Returns
- Random number
◆ getRand_uniformIntDist()
template<typename IntType = int>
double NAV::RandomNumberGenerator::getRand_uniformIntDist |
( |
IntType | min = 0, |
|
|
IntType | max = std::numeric_limits<IntType>::max() ) |
|
inline |
Gets a random integer number from an uniform distribution.
- Template Parameters
-
IntType | The result type generated by the generator. The effect is undefined if this is not one of short, int, long, long long, unsigned short, unsigned int, unsigned long, or unsigned long long. |
- Parameters
-
min | Minimum value |
max | Maximum value |
- Returns
- Random number
◆ getRand_uniformRealDist()
template<typename RealType = double>
double NAV::RandomNumberGenerator::getRand_uniformRealDist |
( |
RealType | min = 0.0, |
|
|
RealType | max = 1.0 ) |
|
inline |
Gets a random real number from an uniform distribution.
- Template Parameters
-
RealType | The result type generated by the generator. The effect is undefined if this is not one of float, double, or long double |
- Parameters
-
min | Minimum value |
max | Maximum value |
- Returns
- Random number
◆ resetSeed()
void NAV::RandomNumberGenerator::resetSeed |
( |
size_t | id = 0 | ) |
|
|
inline |
Reset the seed to the internal seed or the system time.
- Parameters
-
id | Some id used to make a unique hash when using the system time to set the seed |
◆ resetSeedOnce()
void NAV::RandomNumberGenerator::resetSeedOnce |
( |
uint64_t | userSeed | ) |
|
|
inline |
Reset the seed to the specified seed, but do not update the internal seed.
- Parameters
-
[in] | userSeed | Seed to use once |
The documentation for this class was generated from the following file: