SUMO - Simulation of Urban MObility
AGCity.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // City class that contains all other objects of the city: in particular
11 // streets, households, bus lines, work positions and schools
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2010-2015 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 AGCITY_H
27 #define AGCITY_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 <vector>
41 #include <list>
42 #include <router/RONet.h>
43 #include "AGPosition.h"
44 #include "AGDataAndStatistics.h"
45 #include "AGSchool.h"
46 #include "AGBusLine.h"
47 #include "AGWorkPosition.h"
48 #include "AGHousehold.h"
49 
50 
51 // ===========================================================================
52 // class declarations
53 // ===========================================================================
54 class AGHousehold;
55 
56 
57 // ===========================================================================
58 // class definitions
59 // ===========================================================================
60 class AGCity {
61 public:
63  statData(AGDataAndStatistics::getDataAndStatistics()),
64  net(net),
65  streetsCompleted(false) {};
66 
70  void completeStreets();
71  void generateWorkPositions();
72  void completeBusLines();
73  //void generateSchools();
74  void generatePopulation();
75  void schoolAllocation();
76  void workAllocation();
77  void carAllocation();
78 
82  const AGStreet& getStreet(const std::string& edge);
86  const AGStreet& getRandomStreet();
87 
89  std::vector<AGStreet*> streets;
90  std::vector<AGWorkPosition> workPositions;
91  std::list<AGSchool> schools;
92  std::list<AGBusLine> busLines;
93  std::list<AGHousehold> households;
94  std::vector<AGPosition> cityGates;
95  std::list<AGAdult> peopleIncoming;
96 
97 private:
102  void generateOutgoingWP();
107 
108  // @brief network of the city
115 
116  int nbrCars;
117 
118 private:
120  AGCity& operator=(const AGCity&);
121 };
122 
123 #endif
124 
125 /****************************************************************************/
void completeStreets()
Definition: AGCity.cpp:56
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:63
AGDataAndStatistics & statData
Definition: AGCity.h:88
A model of the street in the city.
Definition: AGStreet.h:60
void generatePopulation()
Definition: AGCity.cpp:169
void completeBusLines()
Definition: AGCity.cpp:160
const AGStreet & getStreet(const std::string &edge)
Definition: AGCity.cpp:394
std::list< AGBusLine > busLines
Definition: AGCity.h:92
const AGStreet & getRandomStreet()
Definition: AGCity.cpp:419
Definition: AGCity.h:60
void generateOutgoingWP()
Definition: AGCity.cpp:132
void schoolAllocation()
Definition: AGCity.cpp:271
void generateWorkPositions()
Definition: AGCity.cpp:105
std::list< AGSchool > schools
Definition: AGCity.h:91
std::list< AGHousehold > households
Definition: AGCity.h:93
void workAllocation()
Definition: AGCity.cpp:292
AGCity(RONet *net)
Definition: AGCity.h:62
std::vector< AGStreet * > streets
Definition: AGCity.h:89
std::list< AGAdult > peopleIncoming
Definition: AGCity.h:95
The router's network representation.
Definition: RONet.h:72
bool streetsCompleted
Definition: AGCity.h:114
void carAllocation()
Definition: AGCity.cpp:350
int nbrCars
Definition: AGCity.h:116
AGCity & operator=(const AGCity &)
invalidated assignment operator
AGSchool closestSchoolTo(AGPosition pos)
RONet * net
Definition: AGCity.h:109
void generateIncomingPopulation()
Definition: AGCity.cpp:263
std::vector< AGPosition > cityGates
Definition: AGCity.h:94
std::vector< AGWorkPosition > workPositions
Definition: AGCity.h:90