state-observation 1.7.0
Loading...
Searching...
No Matches
probability-law-simulation.hpp
Go to the documentation of this file.
1
11#ifndef SENSORSSIMULATIONPROBABILITYLAWSIMULATIONHPP
12#define SENSORSSIMULATIONPROBABILITYLAWSIMULATIONHPP
13
14#include <random>
15
16#include <state-observation/api.h>
18
19namespace stateObservation
20{
21namespace tools
22{
24{
25public:
29 static double getGaussianScalar(double std = 1, double bias = 0);
30
33 template<typename BiasType,
34 typename StdType = Eigen::Matrix<double, BiasType::RowsAtCompileTime, BiasType::RowsAtCompileTime>>
35 static Eigen::Matrix<double, BiasType::RowsAtCompileTime, BiasType::ColsAtCompileTime> getGaussianMatrix(
36 BiasType bias = Eigen::Matrix<double, BiasType::RowsAtCompileTime, BiasType::ColsAtCompileTime>::Zero(),
37 StdType std = Eigen::Matrix<double, BiasType::RowsAtCompileTime, BiasType::RowsAtCompileTime>::Identity(),
40
46 static double getUniformScalar(double min = -1., double max = 1.);
47
52 template<typename ReturnType = Matrix>
53 static typename MatrixType<ReturnType>::type getUniformMatrix(Index rows = ReturnType::RowsAtCompileTime,
54 Index cols = ReturnType::ColsAtCompileTime,
55 double min = -1.,
56 double max = 1.);
57
59 static void setSeed(unsigned int seed);
60
62 static void setRandomSeed();
63
64protected:
65 static const int defaultSeed_;
68 static std::random_device rd_;
69 static std::mt19937 gen_;
70};
71#include <state-observation/tools/probability-law-simulation.hxx>
72} // namespace tools
73} // namespace stateObservation
74#endif // SENSORSSIMULATIONPROBABILITYLAWSIMULATIONHPP
Definition probability-law-simulation.hpp:24
static double getUniformScalar(double min=-1., double max=1.)
Get a scalar following a uniform distribution between min and max.
ProbabilityLawSimulation()
Private constructor for preventing instanciation of Probability Law Simulation.
Definition probability-law-simulation.hpp:67
static void setRandomSeed()
sets the seed to the generator
static double getGaussianScalar(double std=1, double bias=0)
static std::random_device rd_
Definition probability-law-simulation.hpp:68
static Eigen::Matrix< double, BiasType::RowsAtCompileTime, BiasType::ColsAtCompileTime > getGaussianMatrix(BiasType bias=Eigen::Matrix< double, BiasType::RowsAtCompileTime, BiasType::ColsAtCompileTime >::Zero(), StdType std=Eigen::Matrix< double, BiasType::RowsAtCompileTime, BiasType::RowsAtCompileTime >::Identity(), Index rows=Index(EigenType< BiasType >::type::RowsAtCompileTime), Index cols=Index(EigenType< BiasType >::type::ColsAtCompileTime))
static std::mt19937 gen_
Definition probability-law-simulation.hpp:69
static void setSeed(unsigned int seed)
sets the seed to the generator
static MatrixType< ReturnType >::type getUniformMatrix(Index rows=ReturnType::RowsAtCompileTime, Index cols=ReturnType::ColsAtCompileTime, double min=-1., double max=1.)
Get a Matrix following a uniform distribution between min and max.
static const int defaultSeed_
Definition probability-law-simulation.hpp:65
Definitions of types and some structures.
Definition bidim-elastic-inv-pendulum-dyn-sys.hpp:21
Eigen::MatrixXd Matrix
Dynamic sized Matrix.
Definition definitions.hpp:100
Eigen::Index Index
Definition definitions.hpp:138
Definition definitions.hpp:67
Definition definitions.hpp:72