33 #define LIMIT_CHILDREN_NUMBER 3
64 for (
int a = n; a < m; ++a) {
87 return exp(-mean) * pow(mean, occ) / (double)
factorial(occ);
117 std::map<int, double>::iterator it;
123 if (it->first < age) {
125 }
else if (it->first >= age && previousAge < age) {
126 prop = ((double)(age - previousAge) / (double)(it->first - previousAge));
127 sum += prop * it->second;
130 previousAge = it->first;
148 std::map<int, double>::iterator it;
149 for (it = myMap->begin(); it != myMap->end(); ++it) {
155 for (it = myMap->begin(); it != myMap->end(); ++it) {
156 it->second = it->second / sum;
165 double p =
RandHelper::rand(
static_cast<double>(0.0001),
static_cast<double>(1));
167 double scale = exp((-1) * maxVar);
169 p = p * (1 - scale) + scale;
171 double variation = (-1) * log(p);
174 return mean + variation;
176 return mean - variation;
185 std::map<int, double>::iterator it;
192 std::cout <<
"ERROR: incoming at city gates not normalized" << std::endl;
200 std::map<int, double>::iterator it;
207 std::cout <<
"ERROR: outgoing at city gates not normalized" << std::endl;