SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGHousehold.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A household contains the people and cars of the city: roughly represents
10 // families with their address, cars, adults and possibly children
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14 // activitygen module
15 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 #ifndef HOUSEHOLD_H
26 #define HOUSEHOLD_H
27 
28 
29 // ===========================================================================
30 // included modules
31 // ===========================================================================
32 #ifdef _MSC_VER
33 #include <windows_config.h>
34 #else
35 #include <config.h>
36 #endif
37 
38 #include <iostream>
39 #include <list>
40 #include "AGPerson.h"
41 #include "AGAdult.h"
42 #include "AGChild.h"
43 #include "AGCar.h"
44 #include "AGStreet.h"
45 #include "AGPosition.h"
46 #include "AGCity.h"
47 
48 
49 // ===========================================================================
50 // class declarations
51 // ===========================================================================
52 class AGCity;
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
58 class AGHousehold {
59 public:
60  AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) :
61  myCity(city),
62  myLocation(pos),
63  myId(idHouseholds) {};
64  AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) :
65  myCity(city),
66  myLocation(*str),
67  myId(idHouseholds) {};
71  void generatePeople(int numAdults, int numChilds, bool firstRetired);
72  unsigned int getPeopleNbr();
73  unsigned int getAdultNbr();
74  const std::list<AGAdult>& getAdults() const;
75  const std::list<AGChild>& getChildren() const;
76  const std::list<AGCar>& getCars() const;
80  bool isCloseFromPubTransport(std::list<AGPosition>* pubTransport);
81  bool isCloseFromPubTransport(std::map<int, AGPosition>* pubTransport);
89  void regenerate();
99  bool allocateAdultsWork();
103  void generateCars(SUMOReal rate);
104  int getCarNbr();
108  void addACar();
112  AGCity* getTheCity();
116  bool retiredHouseholders();
121 
122 private:
126  int myId;
127 
128 private:
129  std::list<AGAdult> myAdults;
130  std::list<AGChild> myChildren;
131  std::list<AGCar> myCars;
132 };
133 
134 #endif
135 
136 /****************************************************************************/