SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // A household contains the people and cars of the city: roughly represents 00010 // families with their address, cars, adults and possibly children 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 HOUSEHOLD_H 00026 #define HOUSEHOLD_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 <list> 00040 #include "AGPerson.h" 00041 #include "AGAdult.h" 00042 #include "AGChild.h" 00043 #include "AGCar.h" 00044 #include "AGStreet.h" 00045 #include "AGPosition.h" 00046 #include "AGCity.h" 00047 00048 00049 // =========================================================================== 00050 // class declarations 00051 // =========================================================================== 00052 class AGCity; 00053 00054 00055 // =========================================================================== 00056 // class definitions 00057 // =========================================================================== 00058 class AGHousehold { 00059 public: 00060 AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) : 00061 location(pos), 00062 myCity(city), 00063 idHH(idHouseholds) {}; 00064 AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) : 00065 location(*str), 00066 myCity(city), 00067 idHH(idHouseholds) {}; 00076 void generatePeople(); 00077 int getPeopleNbr(); 00078 int getAdultNbr(); 00082 bool isCloseFromPubTransport(std::list<AGPosition> *pubTransport); 00083 bool isCloseFromPubTransport(std::map<int, AGPosition> *pubTransport); 00091 void regenerate(); 00096 bool allocateChildrenSchool(); 00101 bool allocateAdultsWork(); 00105 void generateCars(SUMOReal rate); 00106 int getCarNbr(); 00110 void addACar(); 00114 AGCity* getTheCity(); 00118 bool retiredHouseholders(); 00122 AGPosition getPosition(); 00123 std::list<AGAdult> adults; 00124 std::list<AGChild> children; 00125 std::list<AGCar> cars; 00126 00127 private: 00128 00129 bool decisionProba(SUMOReal p); 00130 00131 AGCity* myCity; 00132 AGPosition location; 00133 int numberOfPeople; 00134 int numberOfCars; 00135 int idHH; 00136 }; 00137 00138 #endif 00139 00140 /****************************************************************************/