SUMO - Simulation of Urban MObility
AGHousehold.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // A household contains the people and cars of the city: roughly represents
11 // families with their address, cars, adults and possibly children
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors
15 // activitygen module
16 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
17 /****************************************************************************/
18 //
19 // This file is part of SUMO.
20 // SUMO is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 /****************************************************************************/
26 #ifndef HOUSEHOLD_H
27 #define HOUSEHOLD_H
28 
29 
30 // ===========================================================================
31 // included modules
32 // ===========================================================================
33 #ifdef _MSC_VER
34 #include <windows_config.h>
35 #else
36 #include <config.h>
37 #endif
38 
39 #include <iostream>
40 #include <list>
41 #include "AGPerson.h"
42 #include "AGAdult.h"
43 #include "AGChild.h"
44 #include "AGCar.h"
45 #include "AGStreet.h"
46 #include "AGPosition.h"
47 #include "AGCity.h"
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 class AGCity;
54 
55 
56 // ===========================================================================
57 // class definitions
58 // ===========================================================================
59 class AGHousehold {
60 public:
61  AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) :
62  myCity(city),
63  myLocation(pos),
64  myId(idHouseholds) {};
65  AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) :
66  myCity(city),
67  myLocation(*str),
68  myId(idHouseholds) {};
72  void generatePeople(int numAdults, int numChilds, bool firstRetired);
73  unsigned int getPeopleNbr();
74  unsigned int getAdultNbr();
75  const std::list<AGAdult>& getAdults() const;
76  const std::list<AGChild>& getChildren() const;
77  const std::list<AGCar>& getCars() const;
81  bool isCloseFromPubTransport(std::list<AGPosition>* pubTransport);
82  bool isCloseFromPubTransport(std::map<int, AGPosition>* pubTransport);
90  void regenerate();
100  bool allocateAdultsWork();
104  void generateCars(SUMOReal rate);
105  int getCarNbr();
109  void addACar();
113  AGCity* getTheCity();
117  bool retiredHouseholders();
122 
123 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 /****************************************************************************/
const std::list< AGCar > & getCars() const
bool allocateChildrenSchool()
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:63
AGCity * myCity
Definition: AGHousehold.h:124
A model of the street in the city.
Definition: AGStreet.h:60
void addACar()
Definition: AGHousehold.cpp:83
void regenerate()
void generatePeople(int numAdults, int numChilds, bool firstRetired)
Definition: AGHousehold.cpp:46
int getCarNbr()
Definition: AGHousehold.cpp:89
Definition: AGCity.h:60
AGHousehold(AGPosition pos, AGCity *city, int idHouseholds)
Definition: AGHousehold.h:61
const std::list< AGAdult > & getAdults() const
std::list< AGAdult > myAdults
Definition: AGHousehold.h:129
AGPosition getPosition()
bool isCloseFromPubTransport(std::list< AGPosition > *pubTransport)
bool retiredHouseholders()
unsigned int getPeopleNbr()
Definition: AGHousehold.cpp:94
AGCity * getTheCity()
unsigned int getAdultNbr()
Definition: AGHousehold.cpp:99
void generateCars(SUMOReal rate)
Definition: AGHousehold.cpp:72
AGPosition myLocation
Definition: AGHousehold.h:125
std::list< AGCar > myCars
Definition: AGHousehold.h:131
#define SUMOReal
Definition: config.h:214
AGHousehold(AGStreet *str, AGCity *city, int idHouseholds)
Definition: AGHousehold.h:65
bool allocateAdultsWork()
const std::list< AGChild > & getChildren() const
std::list< AGChild > myChildren
Definition: AGHousehold.h:130