41 #define LIMIT_CHILDREN_NUMBER 3 72 for (
int a = n; a < m; ++a) {
125 std::map<int, SUMOReal>::iterator it;
131 if (it->first < age) {
133 }
else if (it->first >= age && previousAge < age) {
134 prop = ((
SUMOReal)(age - previousAge) / (
SUMOReal)(it->first - previousAge));
135 sum += prop * it->second;
138 previousAge = it->first;
156 std::map<int, SUMOReal>::iterator it;
157 for (it = myMap->begin(); it != myMap->end(); ++it) {
163 for (it = myMap->begin(); it != myMap->end(); ++it) {
164 it->second = it->second / sum;
175 SUMOReal scale = exp((-1) * maxVar);
177 p = p * (1 - scale) + scale;
182 return mean + variation;
184 return mean - variation;
193 std::map<int, SUMOReal>::iterator it;
200 std::cout <<
"ERROR: incoming at city gates not normalized" << std::endl;
208 std::map<int, SUMOReal>::iterator it;
215 std::cout <<
"ERROR: outgoing at city gates not normalized" << std::endl;
#define LIMIT_CHILDREN_NUMBER
int getPeopleOlderThan(int age)
static AGDataAndStatistics & getDataAndStatistics()
static SUMOReal rand()
Returns a random real number in [0, 1)
int getRandomCityGateByOutgoing()
std::map< int, SUMOReal > endWorkHours
int getRandomPopDistributed(int n, int m)
SUMOReal poisson(SUMOReal mean, int occ)
int getPeopleYoungerThan(int age)
void normalizeMapProb(std::map< int, SUMOReal > *myMap)
std::map< int, SUMOReal > beginWorkHours
std::map< int, SUMOReal > population
int getPoissonsNumberOfChildren(SUMOReal mean)
int getRandom(int n, int m)
std::map< int, SUMOReal > incoming
SUMOReal getInverseExpRandomValue(SUMOReal mean, SUMOReal maxVar)
SUMOReal getPropYoungerThan(int age)
int getRandomCityGateByIncoming()
std::map< int, SUMOReal > outgoing