YARP  2.3.70.1
Yet Another Robot Platform
yarp::os::Random Class Reference

A collection of basic random number generation algorithms. More...

#include <yarp/os/Random.h>

Static Public Member Functions

static double uniform ()
 Generates a random number in the range 0 to 1. More...
 
static double normal (double m, double s)
 A normal random number generator. More...
 
static void seed (int seed)
 Sets the seed of the random number generator. More...
 
static double normal ()
 
static int uniform (int min, int max)
 A random number in a specified range. More...
 

Detailed Description

A collection of basic random number generation algorithms.

Definition at line 29 of file Random.h.

Member Function Documentation

◆ normal() [1/2]

double Random::normal ( double  m,
double  s 
)
static

A normal random number generator.

Parameters
mis the mean of the gaussian distribution.
sis the standard deviation of the distribution.
Returns
a random number with normal distribution.

Definition at line 46 of file Random.cpp.

◆ normal() [2/2]

double Random::normal ( )
static
Returns
a random number normally distributed with 0 mean and unitary standard deviation.

Definition at line 18 of file Random.cpp.

◆ seed()

void Random::seed ( int  seed)
static

Sets the seed of the random number generator.

Parameters
seedis the new seed of the random number generator.

Definition at line 71 of file Random.cpp.

◆ uniform() [1/2]

double Random::uniform ( )
static

Generates a random number in the range 0 to 1.

Returns
a random floating point number in the range 0 to 1.

Definition at line 14 of file Random.cpp.

◆ uniform() [2/2]

int Random::uniform ( int  min,
int  max 
)
static

A random number in a specified range.

Parameters
minis the minimum of the range.
maxis the maximum of the range.
Returns
a random integer in the specified range.

Definition at line 76 of file Random.cpp.


The documentation for this class was generated from the following files: