SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // City class that contains all other objects of the city: in particular 00010 // streets, households, bus lines, work positions and schools 00011 /****************************************************************************/ 00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00014 // activitygen module 00015 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00016 /****************************************************************************/ 00017 // 00018 // This file is part of SUMO. 00019 // SUMO is free software: you can redistribute it and/or modify 00020 // it under the terms of the GNU General Public License as published by 00021 // the Free Software Foundation, either version 3 of the License, or 00022 // (at your option) any later version. 00023 // 00024 /****************************************************************************/ 00025 #ifndef AGCITY_H 00026 #define AGCITY_H 00027 00028 00029 // =========================================================================== 00030 // included modules 00031 // =========================================================================== 00032 #ifdef _MSC_VER 00033 #include <windows_config.h> 00034 #else 00035 #include <config.h> 00036 #endif 00037 00038 #include <iostream> 00039 #include <vector> 00040 #include <list> 00041 #include <router/RONet.h> 00042 #include "AGPosition.h" 00043 #include "AGDataAndStatistics.h" 00044 #include "AGSchool.h" 00045 #include "AGBusLine.h" 00046 #include "AGWorkPosition.h" 00047 #include "AGHousehold.h" 00048 00049 00050 // =========================================================================== 00051 // class declarations 00052 // =========================================================================== 00053 class AGHousehold; 00054 00055 00056 // =========================================================================== 00057 // class definitions 00058 // =========================================================================== 00059 class AGCity { 00060 public: 00061 AGCity(RONet* net) : 00062 statData(AGDataAndStatistics::getDataAndStatistics()), 00063 net(net), 00064 streetsCompleted(false) {}; 00065 00069 void completeStreets(); 00070 void generateWorkPositions(); 00071 void completeBusLines(); 00072 //void generateSchools(); 00073 void generatePopulation(); 00074 void schoolAllocation(); 00075 void workAllocation(); 00076 void carAllocation(); 00077 00081 const AGStreet& getStreet(const std::string& edge); 00085 const AGStreet& getRandomStreet(); 00086 00087 AGDataAndStatistics& statData; 00088 std::vector<AGStreet> streets; 00089 std::vector<AGWorkPosition> workPositions; 00090 std::list<AGSchool> schools; 00091 std::list<AGBusLine> busLines; 00092 std::list<AGHousehold> households; 00093 std::vector<AGPosition> cityGates; 00094 std::list<AGAdult> peopleIncoming; 00095 00096 private: 00097 AGSchool closestSchoolTo(AGPosition pos); 00101 void generateOutgoingWP(); 00105 void generateIncomingPopulation(); 00106 00107 // @brief network of the city 00108 RONet* net; 00113 bool streetsCompleted; 00114 00115 int NrStreets; 00116 int nbrCars; 00117 }; 00118 00119 #endif 00120 00121 /****************************************************************************/