SUMO - Simulation of Urban MObility
AGDataAndStatistics.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
20 // Contains various data, statistical values and functions from input used
21 // by various objects
22 /****************************************************************************/
23 #ifndef AGDATAANDSTATISTICS_H
24 #define AGDATAANDSTATISTICS_H
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include <iostream>
33 #include <map>
34 #include "AGSchool.h"
35 #include "AGPosition.h"
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
42 public:
46  double speedTimePerKm; //number of seconds for one km
47  double carPreference; //prob. to choose the car (compared to the bus)
48 
57  double carRate;
58  double unemployement;
59  double laborDemand;
66 
67  std::map<int, double> beginWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
68  std::map<int, double> endWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
69  std::map<int, AGPosition> busStations; //<id, position>
70  //std::map<SchoolType, int> schoolCapacity;
71  std::map<int, double> population; //<bracket's end age, number> (number only used in term of PROPORTION: it should be normalized)
72  //std::map<int, double> childrenAccompagniment; //<bracket's end age, probability>
77  std::map<int, double> incoming;
78  std::map<int, double> outgoing;
79 
86 
91  //probability of picking an old-people household (compared to working and have children adults)
92  double oldAgeHhProb;
93  //probability of having a second adult (old in case of old householders) in the household.
95  //this s the mean number of children pro household (not old). This value is used in the Poisson-lay for determining the number of children in each family
97 
101  //int childrenNbr;
102  //int oldPeopleNbr;
103  int AdultNbr;
105  //households far from public transports
107 
109 
114  int getRandom(int n, int m);
122  int getRandomPopDistributed(int n, int m);
130  int getPoissonsNumberOfChildren(double mean);
137  int getPeopleOlderThan(int age);
138  int getPeopleYoungerThan(int age);
139  double getPropYoungerThan(int age);
145  void consolidateStat();
154  double getInverseExpRandomValue(double mean, double maxVar);
162 
163 private:
165 
173  double poisson(double mean, int occ);
177  int factorial(int n);
178 
179  //function normalizing the map's probabilities: Sum(floats) = 1
180  void normalizeMapProb(std::map<int, double>* myMap);
181 };
182 
183 #endif
184 
185 /****************************************************************************/
std::map< int, double > outgoing
double getInverseExpRandomValue(double mean, double maxVar)
static AGDataAndStatistics & getDataAndStatistics()
std::map< int, double > population
int getRandomPopDistributed(int n, int m)
std::map< int, double > beginWorkHours
std::map< int, double > incoming
std::map< int, double > endWorkHours
double getPropYoungerThan(int age)
int getPoissonsNumberOfChildren(double mean)
void normalizeMapProb(std::map< int, double > *myMap)
int getRandom(int n, int m)
std::map< int, AGPosition > busStations
double poisson(double mean, int occ)