7 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 9 #pragma warning(disable:4244) 11 #pragma warning(disable:4512) 16 #include <boost/random.hpp> 17 #include <boost/thread/mutex.hpp> 48 boost::mutex& getAccess(){
return access_; }
51 boost::mt19937& getRng(){
return rng_;}
56 rng_.seed( static_cast<unsigned int>( time( 0L ) ) );
80 boost::uniform_real<double>(0.0, 1.0) )
87 boost::uniform_real<double>( (
std::min)(min_v, max_v), (
std::max)(min_v,max_v) ) )
95 boost::mutex::scoped_lock scoped_lock(access_);
99 typedef boost::variate_generator<boost::mt19937&, boost::uniform_real<double> > Generator;
102 boost::mutex& access_;
119 boost::mutex::scoped_lock scoped_lock(access_);
123 typedef boost::variate_generator<boost::mt19937&, boost::uniform_int<int> > Generator;
126 boost::mutex& access_;
145 boost::mutex::scoped_lock scoped_lock(access_);
149 typedef boost::variate_generator<boost::mt19937&, boost::normal_distribution<double> > Generator;
152 boost::mutex& access_;
159 #endif //FAIF_RANDOM_H
double operator()()
the method to generate the random variable in given range, uniform distribution
Definition: Random.hpp:94
RandomDouble(double min_v, double max_v)
the c-tor random variable generator in range <min,max), uniform distribution
Definition: Random.hpp:84
static RandomSingleton & getInstance()
Definition: Random.hpp:43
RandomNormal(double mi, double sigma)
the c-tor random variable generator, normal distribution
Definition: Random.hpp:136
the uniform distribution for double, in given range, e.g. <0,1), uses RandomSingleton ...
Definition: Random.hpp:74
double operator()()
the method to generate the random variable with normal distribution
Definition: Random.hpp:144
the uniform distribution for int, in range <min,max>, uses RandomSingleton
Definition: Random.hpp:107
the normal distribution for double, for given mean (mi) and standard deviation (sigma), uses RandomSingleton
Definition: Random.hpp:133
int operator()()
the method to generate the random variable in range <min, max>, uniform distribution ...
Definition: Random.hpp:118
the singleton, synchronized proxy to boost::Random
Definition: Random.hpp:36
RandomDouble()
the c-tor random variable generator in range <0,1), uniform distribution
Definition: Random.hpp:77