#include <random.h>
|
f2c::types::Cell | genConvexCell (double area, size_t n_sides=4) |
|
f2c::types::Field | genConvexField (double area, size_t n_sides=4) |
|
f2c::types::Cell | generateRandCell (double area, int n_sides, double min_width=0.5, double max_width=1.0) |
|
f2c::types::Field | generateRandField (double area, int n_sides, double min_width=0.5, double max_width=1.0) |
|
f2c::types::Cell | genNonConvexCell (double area) |
|
f2c::types::Field | genNonConvexField (double area) |
|
double | getAngleRandom () |
|
double | getRandomDouble () |
|
double | getRandomExp (double min, double max) |
|
double | getRandomExpDist (double lambda) |
|
double | getRandomLinear (double min, double max) |
|
| Random (uint32_t seed=static_cast< uint32_t >(time(NULL))) |
|
Definition at line 23 of file random.h.
◆ Random()
f2c::Random::Random |
( |
uint32_t |
seed = static_cast< uint32_t >(time(NULL)) | ) |
|
|
explicitdefault |
Constructor to initialize the seed to a known value to make experiments reproducible
Definition at line 11 of file random.cpp.
◆ genConvexCell()
◆ genConvexField()
Generate a convex field
- Parameters
-
area | Area of the generated field |
Definition at line 77 of file random.cpp.
◆ generateRandCell()
f2c::types::Cell f2c::Random::generateRandCell |
( |
double |
area, |
|
|
int |
n_sides, |
|
|
double |
min_width = 0.5 , |
|
|
double |
max_width = 1.0 |
|
) |
| |
◆ generateRandField()
f2c::types::Field f2c::Random::generateRandField |
( |
double |
area, |
|
|
int |
n_sides, |
|
|
double |
min_width = 0.5 , |
|
|
double |
max_width = 1.0 |
|
) |
| |
Random field generator to make tests.
- Parameters
-
area | Area of the generated field |
n_sides | Number of sides of the generated field. |
min_width | Minimum distance to the center for the base field. |
max_width | Maximum distance to the center for the base field. |
- Returns
- Field with area area an n_sides.
Definition at line 63 of file random.cpp.
◆ genNonConvexCell()
◆ genNonConvexField()
Generate a non-convex field
- Parameters
-
area | Area of the generated field |
Definition at line 90 of file random.cpp.
◆ getAngleRandom()
double f2c::Random::getAngleRandom |
( |
| ) |
|
Return a random angle in radians.
- Returns
- random angle
Definition at line 39 of file random.cpp.
◆ getRandomDouble()
double f2c::Random::getRandomDouble |
( |
| ) |
|
Get a random double
- Returns
- Double
Definition at line 18 of file random.cpp.
◆ getRandomExp()
double f2c::Random::getRandomExp |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
Get a random double in a range with exponential probability. Lower values are more probable than higher ones.
- Parameters
-
min | Minimum of the range |
max | Maximum of the range |
- Returns
- Double
Definition at line 28 of file random.cpp.
◆ getRandomExpDist()
double f2c::Random::getRandomExpDist |
( |
double |
lambda | ) |
|
Get a random double in a range [0;+inf) with exponential probability. Lower values are more probable than higher ones.
- Parameters
-
lambda | is the rate parameter |
- Returns
- Double > 0
Definition at line 34 of file random.cpp.
◆ getRandomLinear()
double f2c::Random::getRandomLinear |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
Get a random double in a range with uniform probability
- Parameters
-
min | Minimum of the range |
max | Maximum of the range |
- Returns
- Double
Definition at line 22 of file random.cpp.
◆ mt_
std::mt19937 f2c::Random::mt_ |
|
private |
The documentation for this class was generated from the following files: