37 #ifndef OMPL_UTIL_RANDOM_NUMBERS_
38 #define OMPL_UTIL_RANDOM_NUMBERS_
40 #include <boost/random/mersenne_twister.hpp>
41 #include <boost/random/uniform_real.hpp>
42 #include <boost/random/normal_distribution.hpp>
43 #include <boost/random/variate_generator.hpp>
70 assert(lower_bound <= upper_bound);
71 return (upper_bound - lower_bound) * uni_() + lower_bound;
77 int r = (int)floor(
uniformReal((
double)lower_bound, (
double)(upper_bound) + 1.0));
78 return (r > upper_bound) ? upper_bound : r;
96 return normal_() * stddev + mean;
104 double halfNormalReal(
double r_min,
double r_max,
double focus = 3.0);
120 static void setSeed(boost::uint32_t seed);
126 static boost::uint32_t
getSeed(
void);
130 boost::mt19937 generator_;
131 boost::uniform_real<> uniDist_;
132 boost::normal_distribution<> normalDist_;
133 boost::variate_generator<boost::mt19937&, boost::uniform_real<> > uni_;
134 boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > normal_;