18 CLOG(
LEV_INFO1) <<
"Pseudo random number generator initialized with seed: " <<
si.seed;
26 boost::random::uniform_01<> dist;
31 boost::random::uniform_int_distribution<> dist(
low,
high);
32 boost::random::variate_generator<Generator&, boost::random::uniform_int_distribution<> >
rn(gen_, dist);
37 boost::random::uniform_real_distribution<> dist(
low,
high);
38 boost::random::variate_generator<Generator&, boost::random::uniform_real_distribution<> >
rn(gen_, dist);
43 boost::random::normal_distribution<> dist(
mean,
std_dev);
44 boost::random::variate_generator<Generator&, boost::random::normal_distribution<> >
rn(gen_, dist);
53 boost::random::normal_distribution<> dist(
mean,
std_dev);
54 boost::random::variate_generator<Generator&, boost::random::normal_distribution<> >
rn(gen_, dist);
66 double val = dist(RandomNumberGenerator::gen_);
68 val = dist(RandomNumberGenerator::gen_);
74 double val = dist(RandomNumberGenerator::gen_);
76 val = dist(RandomNumberGenerator::gen_);
78 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 ...
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 - least verbose.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters