SUMO - Simulation of Urban MObility

AGCity.h

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