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 /****************************************************************************/
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 "AGPosition.h"
36 #include "AGDataAndStatistics.h"
37 #include "AGSchool.h"
38 #include "AGBusLine.h"
39 #include "AGWorkPosition.h"
40 #include "AGHousehold.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class AGHousehold;
47 class RONet;
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 /****************************************************************************/
AGCity::workAllocation
void workAllocation()
Definition: AGCity.cpp:285
AGHousehold
Definition: AGHousehold.h:52
AGCity::households
std::list< AGHousehold > households
Definition: AGCity.h:86
AGCity::workPositions
std::vector< AGWorkPosition > workPositions
Definition: AGCity.h:83
AGCity::busLines
std::list< AGBusLine > busLines
Definition: AGCity.h:85
AGCity::schoolAllocation
void schoolAllocation()
Definition: AGCity.cpp:264
AGCity::generateWorkPositions
void generateWorkPositions()
Definition: AGCity.cpp:98
AGSchool
Definition: AGSchool.h:37
AGCity::operator=
AGCity & operator=(const AGCity &)
invalidated assignment operator
AGCity::getStreet
const AGStreet & getStreet(const std::string &edge)
Definition: AGCity.cpp:395
RONet
The router's network representation.
Definition: RONet.h:64
AGCity::streetsCompleted
bool streetsCompleted
Definition: AGCity.h:107
AGSchool.h
AGBusLine.h
AGWorkPosition.h
AGCity::generateOutgoingWP
void generateOutgoingWP()
Definition: AGCity.cpp:125
AGCity::streets
std::vector< AGStreet * > streets
Definition: AGCity.h:82
AGDataAndStatistics
Definition: AGDataAndStatistics.h:41
AGCity::net
RONet * net
Definition: AGCity.h:102
AGHousehold.h
AGCity
Definition: AGCity.h:53
AGCity::closestSchoolTo
AGSchool closestSchoolTo(AGPosition pos)
AGStreet
A model of the street in the city.
Definition: AGStreet.h:53
AGCity::generatePopulation
void generatePopulation()
Definition: AGCity.cpp:162
AGCity::getRandomStreet
const AGStreet & getRandomStreet()
Definition: AGCity.cpp:420
AGCity::carAllocation
void carAllocation()
Definition: AGCity.cpp:351
AGPosition.h
AGPosition
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:56
AGCity::generateIncomingPopulation
void generateIncomingPopulation()
Definition: AGCity.cpp:256
AGCity::cityGates
std::vector< AGPosition > cityGates
Definition: AGCity.h:87
config.h
AGCity::completeStreets
void completeStreets()
Definition: AGCity.cpp:51
AGCity::AGCity
AGCity(RONet *net)
Definition: AGCity.h:55
AGCity::nbrCars
int nbrCars
Definition: AGCity.h:109
AGCity::completeBusLines
void completeBusLines()
Definition: AGCity.cpp:153
AGCity::peopleIncoming
std::list< AGAdult > peopleIncoming
Definition: AGCity.h:88
AGDataAndStatistics.h
AGCity::statData
AGDataAndStatistics & statData
Definition: AGCity.h:81
AGCity::schools
std::list< AGSchool > schools
Definition: AGCity.h:84