Public Member Functions | Private Attributes | List of all members
f2c::Random Class Reference

#include <random.h>

Public Member Functions

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)))
 

Private Attributes

std::mt19937 mt_
 

Detailed Description

Definition at line 23 of file random.h.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ genConvexCell()

f2c::types::Cell f2c::Random::genConvexCell ( double  area,
size_t  n_sides = 4 
)

Definition at line 69 of file random.cpp.

◆ genConvexField()

f2c::types::Field f2c::Random::genConvexField ( double  area,
size_t  n_sides = 4 
)

Generate a convex field

Parameters
areaArea 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 
)

Definition at line 43 of file random.cpp.

◆ 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
areaArea of the generated field
n_sidesNumber of sides of the generated field.
min_widthMinimum distance to the center for the base field.
max_widthMaximum 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()

f2c::types::Cell f2c::Random::genNonConvexCell ( double  area)

Definition at line 82 of file random.cpp.

◆ genNonConvexField()

f2c::types::Field f2c::Random::genNonConvexField ( double  area)

Generate a non-convex field

Parameters
areaArea 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 $ \in [0, 2\pi) $

Definition at line 39 of file random.cpp.

◆ getRandomDouble()

double f2c::Random::getRandomDouble ( )

Get a random double $\in [0, 1]$

Returns
Double $\in [0, 1]$

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
minMinimum of the range
maxMaximum of the range
Returns
Double $\in [min, max]$

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
lambdais 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
minMinimum of the range
maxMaximum of the range
Returns
Double $\in [min, max]$

Definition at line 22 of file random.cpp.

Member Data Documentation

◆ mt_

std::mt19937 f2c::Random::mt_
private

Definition at line 88 of file random.h.


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


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31