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-2017 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
22 // Contains various data, statistical values and functions from input used
23 // by various objects
24 /****************************************************************************/
25 #ifndef AGDATAANDSTATISTICS_H
26 #define AGDATAANDSTATISTICS_H
27 
28 
29 // ===========================================================================
30 // included modules
31 // ===========================================================================
32 #ifdef _MSC_VER
33 #include <windows_config.h>
34 #else
35 #include <config.h>
36 #endif
37 
38 #include <iostream>
39 #include <map>
40 #include "AGSchool.h"
41 #include "AGPosition.h"
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
48 public:
52  double speedTimePerKm; //number of seconds for one km
53  double carPreference; //prob. to choose the car (compared to the bus)
54 
63  double carRate;
64  double unemployement;
65  double laborDemand;
72 
73  std::map<int, double> beginWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
74  std::map<int, double> endWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
75  std::map<int, AGPosition> busStations; //<id, position>
76  //std::map<SchoolType, int> schoolCapacity;
77  std::map<int, double> population; //<bracket's end age, number> (number only used in term of PROPORTION: it should be normalized)
78  //std::map<int, double> childrenAccompagniment; //<bracket's end age, probability>
83  std::map<int, double> incoming;
84  std::map<int, double> outgoing;
85 
92 
97  //probability of picking an old-people household (compared to working and have children adults)
98  double oldAgeHhProb;
99  //probability of having a second adult (old in case of old householders) in the household.
101  //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
103 
107  //int childrenNbr;
108  //int oldPeopleNbr;
109  int AdultNbr;
111  //households far from public transports
113 
115 
120  int getRandom(int n, int m);
128  int getRandomPopDistributed(int n, int m);
136  int getPoissonsNumberOfChildren(double mean);
143  int getPeopleOlderThan(int age);
144  int getPeopleYoungerThan(int age);
145  double getPropYoungerThan(int age);
151  void consolidateStat();
160  double getInverseExpRandomValue(double mean, double maxVar);
168 
169 private:
171 
179  double poisson(double mean, int occ);
183  int factorial(int n);
184 
185  //function normalizing the map's probabilities: Sum(floats) = 1
186  void normalizeMapProb(std::map<int, double>* myMap);
187 };
188 
189 #endif
190 
191 /****************************************************************************/
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)