#include <RandomWrapper.h>
A simple wrapper which may be used to generate random values.
◆ CoinFlip()
bool panann::RandomWrapper::CoinFlip |
( |
double |
probability | ) |
|
Generates a weighted coin flip with |probability| chance of producing the value true.
◆ RandomByte()
std::byte panann::RandomWrapper::RandomByte |
( |
| ) |
|
Generates a uniformly random byte.
◆ RandomFloat()
template<typename FloatType = double>
FloatType panann::RandomWrapper::RandomFloat |
( |
FloatType |
min, |
|
|
FloatType |
max |
|
) |
| |
|
inline |
Generates a uniformly random floating point value of type |FloatType| in the range [|min|, |max|).
◆ RandomInteger()
template<typename IntegerType = uint32_t>
IntegerType panann::RandomWrapper::RandomInteger |
( |
IntegerType |
min, |
|
|
IntegerType |
max |
|
) |
| |
|
inline |
Generates a uniformly random integer of type |IntegerType| in the range [|min|, |max|].
◆ ShuffleVector()
template<typename T >
void panann::RandomWrapper::ShuffleVector |
( |
std::vector< T > * |
vec | ) |
|
|
inline |
Shuffle the elements of |vec| into random positions.
The documentation for this class was generated from the following files: