SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGDataAndStatistics.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Contains various data, statistical values and functions from input used
11 // by various objects
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
14 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
15 // activitygen module
16 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
17 /****************************************************************************/
18 //
19 // This file is part of SUMO.
20 // SUMO is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 /****************************************************************************/
26 #ifndef AGDATAANDSTATISTICS_H
27 #define AGDATAANDSTATISTICS_H
28 
29 
30 // ===========================================================================
31 // included modules
32 // ===========================================================================
33 #ifdef _MSC_VER
34 #include <windows_config.h>
35 #else
36 #include <config.h>
37 #endif
38 
39 #include <iostream>
40 #include <map>
41 #include "AGSchool.h"
42 #include "AGPosition.h"
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
49 public:
53  SUMOReal speedTimePerKm; //number of seconds for one km
54  SUMOReal carPreference; //prob. to choose the car (compared to the bus)
55 
72 
73  std::map<int, SUMOReal> beginWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
74  std::map<int, SUMOReal> 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, SUMOReal> population; //<bracket's end age, number> (number only used in term of PROPORTION: it should be normalized)
78  //std::map<int, SUMOReal> childrenAccompagniment; //<bracket's end age, probability>
83  std::map<int, SUMOReal> incoming;
84  std::map<int, SUMOReal> outgoing;
85 
92 
97  //probability of picking an old-people household (compared to working and have children adults)
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);
143  int getPeopleOlderThan(int age);
144  int getPeopleYoungerThan(int age);
145  SUMOReal getPropYoungerThan(int age);
151  void consolidateStat();
168 
169 private:
171 
179  SUMOReal poisson(SUMOReal 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, SUMOReal> *myMap);
187 };
188 
189 #endif
190 
191 /****************************************************************************/