34 #define LIMIT_CHILDREN_NUMBER 3
65 for (
int a = n; a < m; ++a) {
88 return exp(-mean) * pow(mean, occ) / (double)
factorial(occ);
118 std::map<int, double>::iterator it;
124 if (it->first < age) {
126 }
else if (it->first >= age && previousAge < age) {
127 prop = ((double)(age - previousAge) / (double)(it->first - previousAge));
128 sum += prop * it->second;
131 previousAge = it->first;
149 std::map<int, double>::iterator it;
150 for (it = myMap->begin(); it != myMap->end(); ++it) {
156 for (it = myMap->begin(); it != myMap->end(); ++it) {
157 it->second = it->second / sum;
166 double p =
RandHelper::rand(static_cast<double>(0.0001), static_cast<double>(1));
168 double scale = exp((-1) * maxVar);
170 p = p * (1 - scale) + scale;
172 double variation = (-1) * log(p);
175 return mean + variation;
177 return mean - variation;
186 std::map<int, double>::iterator it;
193 std::cout <<
"ERROR: incoming at city gates not normalized" << std::endl;
201 std::map<int, double>::iterator it;
208 std::cout <<
"ERROR: outgoing at city gates not normalized" << std::endl;