double LogNormalHyperPrior::init() { boost::random::lognormal_distribution<> lognormal_dist(location, scale); boost::random::variate_generator<boost::random::mt19937*, boost::random::lognormal_distribution<> > sample_gamma(mt_rng_pt, lognormal_dist); double gamma = sample_gamma(); return gamma; }
/* this function creates a random realization of the mean data rate of a background-session input: output: - random realization of R_s (B/s) */ double backgroundRateRnd(){ double rate; rate=pow(10,lognormal_dist(1.3525, 0.1954))/8; /*Byte/s*/; if(rate>BACKGROUND_RATE_MAX){ rate=BACKGROUND_RATE_MAX; }else if(rate<0){ rate=0; } return rate; }