SUMO - Simulation of Urban MObility
AGCity.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-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 // City class that contains all other objects of the city: in particular
23 // streets, households, bus lines, work positions and schools
24 /****************************************************************************/
25 #ifndef AGCITY_H
26 #define AGCITY_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 <vector>
40 #include <list>
41 #include <router/RONet.h>
42 #include "AGPosition.h"
43 #include "AGDataAndStatistics.h"
44 #include "AGSchool.h"
45 #include "AGBusLine.h"
46 #include "AGWorkPosition.h"
47 #include "AGHousehold.h"
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 class AGHousehold;
54 
55 
56 // ===========================================================================
57 // class definitions
58 // ===========================================================================
59 class AGCity {
60 public:
62  statData(AGDataAndStatistics::getDataAndStatistics()),
63  net(net),
64  streetsCompleted(false) {};
65 
69  void completeStreets();
70  void generateWorkPositions();
71  void completeBusLines();
72  //void generateSchools();
73  void generatePopulation();
74  void schoolAllocation();
75  void workAllocation();
76  void carAllocation();
77 
81  const AGStreet& getStreet(const std::string& edge);
85  const AGStreet& getRandomStreet();
86 
88  std::vector<AGStreet*> streets;
89  std::vector<AGWorkPosition> workPositions;
90  std::list<AGSchool> schools;
91  std::list<AGBusLine> busLines;
92  std::list<AGHousehold> households;
93  std::vector<AGPosition> cityGates;
94  std::list<AGAdult> peopleIncoming;
95 
96 private:
101  void generateOutgoingWP();
106 
107  // @brief network of the city
114 
115  int nbrCars;
116 
117 private:
119  AGCity& operator=(const AGCity&);
120 };
121 
122 #endif
123 
124 /****************************************************************************/
void completeStreets()
Definition: AGCity.cpp:56
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:62
AGDataAndStatistics & statData
Definition: AGCity.h:87
A model of the street in the city.
Definition: AGStreet.h:59
void generatePopulation()
Definition: AGCity.cpp:167
void completeBusLines()
Definition: AGCity.cpp:158
const AGStreet & getStreet(const std::string &edge)
Definition: AGCity.cpp:400
std::list< AGBusLine > busLines
Definition: AGCity.h:91
const AGStreet & getRandomStreet()
Definition: AGCity.cpp:425
Definition: AGCity.h:59
void generateOutgoingWP()
Definition: AGCity.cpp:130
void schoolAllocation()
Definition: AGCity.cpp:269
void generateWorkPositions()
Definition: AGCity.cpp:103
std::list< AGSchool > schools
Definition: AGCity.h:90
std::list< AGHousehold > households
Definition: AGCity.h:92
void workAllocation()
Definition: AGCity.cpp:290
AGCity(RONet *net)
Definition: AGCity.h:61
std::vector< AGStreet * > streets
Definition: AGCity.h:88
std::list< AGAdult > peopleIncoming
Definition: AGCity.h:94
The router&#39;s network representation.
Definition: RONet.h:74
bool streetsCompleted
Definition: AGCity.h:113
void carAllocation()
Definition: AGCity.cpp:356
int nbrCars
Definition: AGCity.h:115
AGCity & operator=(const AGCity &)
invalidated assignment operator
AGSchool closestSchoolTo(AGPosition pos)
RONet * net
Definition: AGCity.h:108
void generateIncomingPopulation()
Definition: AGCity.cpp:261
std::vector< AGPosition > cityGates
Definition: AGCity.h:93
std::vector< AGWorkPosition > workPositions
Definition: AGCity.h:89