Consider using boost::random for random number generation
boost::random has a lot of nice features for random number generation, and could potentially simplify some of what we are doing a bit.
For example, you can generate a random number on an interval, as shown in this example from the boost documentation:
boost::random::mt19937 rng; // produces randomness out of thin air
// see pseudo-random number generators
boost::random::uniform_int_distribution<> six(1,6);
// distribution that maps to 1..6
// see random number distributions
int x = six(rng); // simulate rolling a die