ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
The RNG. More...
#include <rng.h>
Public Member Functions | |
CRNG (UInt32 un_seed, const std::string &str_type="mt19937") | |
Class constructor. | |
CRNG (const CRNG &c_rng) | |
Class copy constructor. | |
virtual | ~CRNG () |
Class destructor. | |
UInt32 | GetSeed () const throw () |
Returns the seed of this RNG. | |
void | SetSeed (UInt32 un_seed) throw () |
Sets the seed of this RNG. | |
std::string | GetType () const throw () |
Returns the type of this RNG. | |
void | SetType (const std::string &str_type) |
Sets the type of this RNG. | |
void | Reset () |
Reset the RNG. | |
bool | Bernoulli (Real f_true=0.5) |
Returns a random value from a Bernoulli distribution. | |
CRadians | Uniform (const CRange< CRadians > &c_range) |
Returns a random value from a uniform distribution. | |
Real | Uniform (const CRange< Real > &c_range) |
Returns a random value from a uniform distribution. | |
SInt32 | Uniform (const CRange< SInt32 > &c_range) |
Returns a random value from a uniform distribution. | |
UInt32 | Uniform (const CRange< UInt32 > &c_range) |
Returns a random value from a uniform distribution. | |
Real | Exponential (Real f_mean) |
Returns a random value from an exponential distribution. | |
Real | Gaussian (Real f_std_dev, Real f_mean=0.0f) |
Returns a random value from a Gaussian distribution. | |
Real | Rayleigh (Real f_sigma) |
Returns a random value from a Rayleigh distribution. | |
Real | Lognormal (Real f_sigma, Real f_mu) |
Returns a random value from a Lognormal distribution. |
The RNG.
This class is the real random number generator. You need an instance of this class to be able to generate random numbers.
argos::CRandom::CRNG::CRNG | ( | UInt32 | un_seed, |
const std::string & | str_type = "mt19937" |
||
) |
Class constructor.
To create a new RNG from user code, never use this method. Use CreateRNG() instead.
un_seed | the seed of the RNG. |
str_type | the type of RNG to use. By default, Mersenne Twister is used. For a list of available RNG types, see GetRNGTypes(). |
argos::CRandom::CRNG::CRNG | ( | const CRNG & | c_rng | ) |
argos::CRandom::CRNG::~CRNG | ( | ) | [virtual] |
bool argos::CRandom::CRNG::Bernoulli | ( | Real | f_true = 0.5 | ) |
Real argos::CRandom::CRNG::Exponential | ( | Real | f_mean | ) |
Real argos::CRandom::CRNG::Gaussian | ( | Real | f_std_dev, |
Real | f_mean = 0.0f |
||
) |
UInt32 argos::CRandom::CRNG::GetSeed | ( | ) | const throw () [inline] |
std::string argos::CRandom::CRNG::GetType | ( | ) | const throw () [inline] |
Real argos::CRandom::CRNG::Lognormal | ( | Real | f_sigma, |
Real | f_mu | ||
) |
Real argos::CRandom::CRNG::Rayleigh | ( | Real | f_sigma | ) |
void argos::CRandom::CRNG::Reset | ( | ) |
void argos::CRandom::CRNG::SetSeed | ( | UInt32 | un_seed | ) | throw () [inline] |
void argos::CRandom::CRNG::SetType | ( | const std::string & | str_type | ) | [inline] |
CRadians argos::CRandom::CRNG::Uniform | ( | const CRange< CRadians > & | c_range | ) |
Real argos::CRandom::CRNG::Uniform | ( | const CRange< Real > & | c_range | ) |
SInt32 argos::CRandom::CRNG::Uniform | ( | const CRange< SInt32 > & | c_range | ) |
UInt32 argos::CRandom::CRNG::Uniform | ( | const CRange< UInt32 > & | c_range | ) |