I've implemented a function:
bool doesCustomerArrive(int custPerHour) {
if(custPerHour > 60) {return true;}
static default_random_engine generator;
float custPerMinute = (float)custPerHour / 60;
bernoulli_distribution distribution(custPerMinute);
return distribution(generator);
}
Which I'm using in a simulation. I iterate custPerHour, starting from 1, and run the thing 6000 times per iteration, doing some calculations until a specific result is met. My problem is that the program is producing the exact same unusual results every time it's run, which immediately makes me think that I've either failed to seed the randomizer or else just set this up wrong. I thought this new set of random functions didn't need seeding, and I don't see anything wrong with my algorithm. Where am I screwing up here?
Specifically, the problem results are:
39 CPH for 100 hours = 2016 customers (expected 3900)
40 CPH for 100 hours = 1986 customers (expected 4000)
The results are the same every time.