Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGDataAndStatistics.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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 are made available under the
7// terms of the Eclipse Public License 2.0 which is available at
8// https://www.eclipse.org/legal/epl-2.0/
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License 2.0 are satisfied: GNU General Public License, version 2
12// or later which is available at
13// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15/****************************************************************************/
23// Contains various data, statistical values and functions from input used
24// by various objects
25/****************************************************************************/
26#pragma once
27#include <config.h>
28
29#include <iostream>
30#include <map>
31#include "AGSchool.h"
32#include "AGPosition.h"
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
39public:
43 double speedTimePerKm; //number of seconds for one km
44 double carPreference; //prob. to choose the car (compared to the bus)
45
54 double carRate;
63
64 std::map<int, double> beginWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
65 std::map<int, double> endWorkHours; //<hour, probability> (number only used in term of PROPORTION: it should be normalized)
66 std::map<int, AGPosition> busStations; //<id, position>
67 //std::map<SchoolType, int> schoolCapacity;
68 std::map<int, double> population; //<bracket's end age, number> (number only used in term of PROPORTION: it should be normalized)
69 std::map<int, int> ageSpan; // <brachets begin age, endage>
70 //std::map<int, double> childrenAccompagniment; //<bracket's end age, probability>
75 std::map<int, double> incoming;
76 std::map<int, double> outgoing;
77
84
89 //probability of picking an old-people household (compared to working and have children adults)
91 //probability of having a second adult (old in case of old householders) in the household.
93 //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
95
99 //int childrenNbr;
100 //int oldPeopleNbr;
103 //households far from public transports
105
107
112 int getRandom(int n, int m);
120 int getRandomPopDistributed(int n, int m);
128 int getPoissonsNumberOfChildren(double mean);
135 int getPeopleOlderThan(int age);
136 int getPeopleYoungerThan(int age);
137 double getPropYoungerThan(int age);
143 void consolidateStat();
152 double getInverseExpRandomValue(double mean, double maxVar);
160
161private:
163
171 double poisson(double mean, int occ);
175 int factorial(int n);
176
177 //function normalizing the map's probabilities: Sum(floats) = 1
178 void normalizeMapProb(std::map<int, double>* myMap);
179};
std::map< int, double > incoming
static AGDataAndStatistics & getDataAndStatistics()
double getInverseExpRandomValue(double mean, double maxVar)
double getPropYoungerThan(int age)
int getRandom(int n, int m)
int getPoissonsNumberOfChildren(double mean)
double poisson(double mean, int occ)
void normalizeMapProb(std::map< int, double > *myMap)
std::map< int, double > endWorkHours
int getRandomPopDistributed(int n, int m)
std::map< int, AGPosition > busStations
std::map< int, int > ageSpan
std::map< int, double > beginWorkHours
std::map< int, double > outgoing
std::map< int, double > population