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-2018 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
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
20 // City class that contains all other objects of the city: in particular
21 // streets, households, bus lines, work positions and schools
22 /****************************************************************************/
23 #ifndef AGCITY_H
24 #define AGCITY_H
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include <iostream>
33 #include <vector>
34 #include <list>
35 #include <router/RONet.h>
36 #include "AGPosition.h"
37 #include "AGDataAndStatistics.h"
38 #include "AGSchool.h"
39 #include "AGBusLine.h"
40 #include "AGWorkPosition.h"
41 #include "AGHousehold.h"
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class AGHousehold;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
53 class AGCity {
54 public:
56  statData(AGDataAndStatistics::getDataAndStatistics()),
57  net(net),
58  streetsCompleted(false) {};
59 
63  void completeStreets();
64  void generateWorkPositions();
65  void completeBusLines();
66  //void generateSchools();
67  void generatePopulation();
68  void schoolAllocation();
69  void workAllocation();
70  void carAllocation();
71 
75  const AGStreet& getStreet(const std::string& edge);
79  const AGStreet& getRandomStreet();
80 
82  std::vector<AGStreet*> streets;
83  std::vector<AGWorkPosition> workPositions;
84  std::list<AGSchool> schools;
85  std::list<AGBusLine> busLines;
86  std::list<AGHousehold> households;
87  std::vector<AGPosition> cityGates;
88  std::list<AGAdult> peopleIncoming;
89 
90 private:
95  void generateOutgoingWP();
100 
101  // @brief network of the city
108 
109  int nbrCars;
110 
111 private:
113  AGCity& operator=(const AGCity&);
114 };
115 
116 #endif
117 
118 /****************************************************************************/
void completeStreets()
Definition: AGCity.cpp:50
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:56
AGDataAndStatistics & statData
Definition: AGCity.h:81
A model of the street in the city.
Definition: AGStreet.h:53
void generatePopulation()
Definition: AGCity.cpp:161
void completeBusLines()
Definition: AGCity.cpp:152
const AGStreet & getStreet(const std::string &edge)
Definition: AGCity.cpp:394
std::list< AGBusLine > busLines
Definition: AGCity.h:85
const AGStreet & getRandomStreet()
Definition: AGCity.cpp:419
Definition: AGCity.h:53
void generateOutgoingWP()
Definition: AGCity.cpp:124
void schoolAllocation()
Definition: AGCity.cpp:263
void generateWorkPositions()
Definition: AGCity.cpp:97
std::list< AGSchool > schools
Definition: AGCity.h:84
std::list< AGHousehold > households
Definition: AGCity.h:86
void workAllocation()
Definition: AGCity.cpp:284
AGCity(RONet *net)
Definition: AGCity.h:55
std::vector< AGStreet * > streets
Definition: AGCity.h:82
std::list< AGAdult > peopleIncoming
Definition: AGCity.h:88
The router&#39;s network representation.
Definition: RONet.h:68
bool streetsCompleted
Definition: AGCity.h:107
void carAllocation()
Definition: AGCity.cpp:350
int nbrCars
Definition: AGCity.h:109
AGCity & operator=(const AGCity &)
invalidated assignment operator
AGSchool closestSchoolTo(AGPosition pos)
RONet * net
Definition: AGCity.h:102
void generateIncomingPopulation()
Definition: AGCity.cpp:255
std::vector< AGPosition > cityGates
Definition: AGCity.h:87
std::vector< AGWorkPosition > workPositions
Definition: AGCity.h:83