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