// for random intervals, use random delays within intervals
BOOST_FOREACH( IntervalCountPair interval_and_count, delay_shifts )
{
- if ( interval_and_count.second == 1 )
+ if ( abs(interval_and_count.second - 1.0f) < 0.0001 ) // == 1.0f
{ // there is exactly 1 pinger with exactly that interval
// --> assign a random delay within interval
- rand_dist_type random_distribution(0, interval_and_count.first);
+ rand_dist_type random_distribution(0.0f, interval_and_count.first);
rand_var_type random_variate(random_number_generator,
random_distribution);
delay_shifts[interval_and_count.first] = random_variate();
// --> distribute evenly
delay_shifts[interval_and_count.first] =
boost::numeric_cast<float>(interval_and_count.first) /
- std:max(1.0f, interval_and_count.second); // max is paranoid
+ std::max(1.0f, interval_and_count.second); //max is paranoid
}
}