random.h
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #pragma once
8 #ifndef FIELDS2COVER_UTILS_RANDOM_H_
9 #define FIELDS2COVER_UTILS_RANDOM_H_
10 
11 #include <time.h>
12 #include <limits>
13 #include <random>
14 #include <boost/math/constants/constants.hpp>
20 
21 namespace f2c {
22 
23 class Random {
24  public:
27  explicit Random(uint32_t seed = static_cast<uint32_t>(time(NULL)));
28 
30  ~Random();
31  Random(const Random&);
32  Random &operator=(const Random&);
33  Random(Random&&);
34  Random &operator=(Random&&);
36 
37  public:
40  double getRandomDouble();
41 
46  double getRandomLinear(double min, double max);
47 
53  double getRandomExp(double min, double max);
54 
60  double getRandomExpDist(double lambda);
61 
64  double getAngleRandom();
65 
66  f2c::types::Cell generateRandCell(double area, int n_sides,
67  double min_width = 0.5, double max_width = 1.0);
74  f2c::types::Field generateRandField(double area, int n_sides,
75  double min_width = 0.5, double max_width = 1.0);
76 
77  f2c::types::Cell genConvexCell(double area, size_t n_sides = 4);
80  f2c::types::Field genConvexField(double area, size_t n_sides = 4);
81 
86 
87  private:
88  std::mt19937 mt_;
89 };
90 
91 
92 } // namespace f2c
93 
94 #endif // FIELDS2COVER_UTILS_RANDOM_H_
f2c::Random::genConvexField
f2c::types::Field genConvexField(double area, size_t n_sides=4)
Definition: random.cpp:77
Cell.h
f2c::Random::Random
Random(uint32_t seed=static_cast< uint32_t >(time(NULL)))
Definition: random.cpp:11
Point.h
f2c::Random::generateRandField
f2c::types::Field generateRandField(double area, int n_sides, double min_width=0.5, double max_width=1.0)
Definition: random.cpp:63
f2c::types::Field
Definition: Field.h:18
f2c::Random::generateRandCell
f2c::types::Cell generateRandCell(double area, int n_sides, double min_width=0.5, double max_width=1.0)
Definition: random.cpp:43
f2c::Random::getRandomDouble
double getRandomDouble()
Definition: random.cpp:18
f2c::Random::getAngleRandom
double getAngleRandom()
Definition: random.cpp:39
f2c::Random::genNonConvexCell
f2c::types::Cell genNonConvexCell(double area)
Definition: random.cpp:82
f2c::types::Cell
Definition: Cell.h:32
LineString.h
Field.h
f2c::Random::getRandomLinear
double getRandomLinear(double min, double max)
Definition: random.cpp:22
f2c::Random
Definition: random.h:23
LinearRing.h
f2c
Main namespace of the fields2cover library.
Definition: boustrophedon_decomp.h:14
f2c::Random::genNonConvexField
f2c::types::Field genNonConvexField(double area)
Definition: random.cpp:90
f2c::Random::getRandomExpDist
double getRandomExpDist(double lambda)
Definition: random.cpp:34
f2c::Random::genConvexCell
f2c::types::Cell genConvexCell(double area, size_t n_sides=4)
Definition: random.cpp:69
f2c::Random::getRandomExp
double getRandomExp(double min, double max)
Definition: random.cpp:28
f2c::Random::mt_
std::mt19937 mt_
Definition: random.h:88


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