17 CLOG(
LEV_INFO1) <<
"Pseudo random number generator initialized with seed: "
26 boost::random::uniform_01<> dist;
31 boost::random::uniform_int_distribution<> dist(low, high);
32 boost::random::variate_generator<
Generator&,
33 boost::random::uniform_int_distribution<>>
39 boost::random::uniform_real_distribution<> dist(low, high);
40 boost::random::variate_generator<
Generator&,
41 boost::random::uniform_real_distribution<>>
47 double low,
double high) {
48 boost::random::normal_distribution<> dist(mean, std_dev);
49 boost::random::variate_generator<
Generator&,
50 boost::random::normal_distribution<>>
53 while (val < low || val > high) {
61 boost::random::normal_distribution<> dist(mean, std_dev);
62 boost::random::variate_generator<
Generator&,
63 boost::random::normal_distribution<>>
66 while (val < low || val > high) {
69 int rounded_val = std::lrint(val);
76 double val = dist(RandomNumberGenerator::gen_);
77 while (val < min_ || val > max_) {
78 val = dist(RandomNumberGenerator::gen_);
84 double val = dist(RandomNumberGenerator::gen_);
85 while (val < min_ || val > max_) {
86 val = dist(RandomNumberGenerator::gen_);
88 return std::lrint(val);
double random_01()
wrappers for boost::random distributions
int random_uniform_int(int low, int high)
generate a random integer between [low, high)
double random_uniform_real(double low, double high)
generate a random real number between [low, high)
void Initialize(SimInfo si)
Initialize from seed.
double random_normal_real(double mean, double std_dev, double low=0, double high=std::numeric_limits< double >::max())
generate a double from a normal distribution, with truncation at low and high
int random_normal_int(double mean, double std_dev, int low=0, int high=std::numeric_limits< int >::max())
generates an integer from a normal distribution, with truncation uses rounding to convert double to i...
Container for a static simulation-global parameters that both describe the simulation and affect its ...
uint64_t seed
Seed for random number generator.
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
boost::random::mt19937 Generator
@ LEV_INFO1
Information helpful for simulation users and developers alike.