SUMO - Simulation of Urban MObility

AGHousehold.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A household contains the people and cars of the city: roughly represents
00008 // families with their address, cars, adults and possibly children
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 HOUSEHOLD_H
00023 #define HOUSEHOLD_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 <list>
00037 #include "AGPerson.h"
00038 #include "AGAdult.h"
00039 #include "AGChild.h"
00040 #include "AGCar.h"
00041 #include "AGStreet.h"
00042 #include "AGPosition.h"
00043 #include "AGCity.h"
00044 
00045 
00046 // ===========================================================================
00047 // class declarations
00048 // ===========================================================================
00049 class AGCity;
00050 
00051 
00052 // ===========================================================================
00053 // class definitions
00054 // ===========================================================================
00055 class AGHousehold {
00056 public:
00057     AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) :
00058         location(pos),
00059         myCity(city),
00060         idHH(idHouseholds) {};
00061     AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) :
00062         location(*str),
00063         myCity(city),
00064         idHH(idHouseholds) {};
00073     void generatePeople();
00074     int getPeopleNbr();
00075     int getAdultNbr();
00079     bool isCloseFromPubTransport(std::list<AGPosition> *pubTransport);
00080     bool isCloseFromPubTransport(std::map<int, AGPosition> *pubTransport);
00088     void regenerate();
00093     bool allocateChildrenSchool();
00098     bool allocateAdultsWork();
00102     void generateCars(SUMOReal rate);
00103     int getCarNbr();
00107     void addACar();
00111     AGCity* getTheCity();
00115     bool retiredHouseholders();
00119     AGPosition getPosition();
00120     std::list<AGAdult> adults;
00121     std::list<AGChild> children;
00122     std::list<AGCar> cars;
00123 
00124 private:
00125 
00126     bool decisionProba(SUMOReal p);
00127 
00128     AGCity* myCity;
00129     AGPosition location;
00130     int numberOfPeople;
00131     int numberOfCars;
00132     int idHH;
00133 };
00134 
00135 #endif
00136 
00137 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines