//======================================================== // Class Random provides class methods for generating // pseudo-random numbers. It is based on the random // function in the C standard library. // // The methods are as follows. // // Random::setseed(n) Initialize the random number generator. // Use this ONCE at the beginning. // // Random::uniformRandom() Return a real number that is uniformly // distributed between 0 and 1. // // Random::uniformRandom(m) Return a real number that is uniformly // distributed between 0 and 2m. Its mean // is m. // // Random::exponentialRandom(m) Return a real number that is exponentially // distributed (between 0 and infinity) with // a mean of m. class Random { public: static void setseed(int seed); static double uniformRandom(); static double uniformRandom(double mean); static double exponentialRandom(double mean); };