16 #include <argos3/core/utility/math/angles.h>
17 #include <argos3/core/utility/math/range.h>
213 template <
typename T>
216 for(
UInt32 i = 0; i < vec_data.size()-1; ++i) {
218 T tTmp = vec_data[i];
219 vec_data[i] = vec_data[j];
265 inline const std::string&
GetId()
const throw() {
272 void SetId(
const std::string& str_id) {
312 std::vector<CRNG*> m_vecRNGList;
333 static CCategory&
GetCategory(
const std::string& str_category);
353 static CRNG*
CreateRNG(
const std::string& str_category);
369 static void SetSeedOf(
const std::string& str_category,
379 static std::map<std::string, CCategory*> m_mapCategories;
signed int SInt32
32-bit signed integer.
unsigned int UInt32
32-bit unsigned integer.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
It defines the basic type CRadians, used to store an angle value in radians.
The ARGoS random number generator.
static UInt32 GetSeedOf(const std::string &str_category)
Returns the seed of the wanted category.
static void Reset()
Resets all the RNG categories.
static CRNG * CreateRNG(const std::string &str_category)
Creates a new RNG inside the given category.
static void RemoveCategory(const std::string &str_category)
Removes the wanted category.
static void SetSeedOf(const std::string &str_category, UInt32 un_seed)
Sets the new seed of the wanted category.
static bool CreateCategory(const std::string &str_category, UInt32 un_seed)
Creates a new category.
static CCategory & GetCategory(const std::string &str_category)
Returns a reference to the wanted category.
static bool ExistsCategory(const std::string &str_category)
Returns true if the given category exists in the pool.
void Shuffle(std::vector< T > &vec_data)
Shuffles the values of the given vector in-place.
UInt32 Poisson(Real f_mean)
Returns a random value from a Poisson distribution.
virtual ~CRNG()
Class destructor.
bool Bernoulli(Real f_true=0.5)
Returns a random value from a Bernoulli distribution.
UInt32 GetSeed() const
Returns the seed of this RNG.
CRNG(UInt32 un_seed)
Class constructor.
void SetSeed(UInt32 un_seed)
Sets the seed of this RNG.
void Reset()
Reset the RNG.
Real Lognormal(Real f_sigma, Real f_mu)
Returns a random value from a Lognormal distribution.
Real Rayleigh(Real f_sigma)
Returns a random value from a Rayleigh 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.
CRadians Uniform(const CRange< CRadians > &c_range)
Returns a random value from a uniform distribution.
void ResetRNGs()
Resets the RNGs in this category.
CCategory(const std::string &str_id, UInt32 un_seed)
Class constructor.
const std::string & GetId() const
Returns the id of the category.
CRNG * CreateRNG()
Creates a new RNG inside this category.
virtual ~CCategory()
Class destructor.
void SetSeed(UInt32 un_seed)
Sets the new seed of the category.
void ReseedRNGs()
Sets new seed for the RNGs in this category.
UInt32 GetSeed() const
Returns the seed of the category.
void SetId(const std::string &str_id)
Sets the new id of the category.