SUMO - Simulation of Urban MObility
AGHousehold.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2017 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 /****************************************************************************/
7 //
8 // This program and the accompanying materials
9 // are made available under the terms of the Eclipse Public License v2.0
10 // which accompanies this distribution, and is available at
11 // http://www.eclipse.org/legal/epl-v20.html
12 //
13 /****************************************************************************/
22 // A household contains the people and cars of the city: roughly represents
23 // families with their address, cars, adults and possibly children
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  int getPeopleNbr();
73  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(double rate);
104  int getCarNbr();
108  void addACar();
112  AGCity* getTheCity();
116  bool retiredHouseholders();
121 
122 private:
125  int myId;
126 
127 private:
128  std::list<AGAdult> myAdults;
129  std::list<AGChild> myChildren;
130  std::list<AGCar> myCars;
131 };
132 
133 #endif
134 
135 /****************************************************************************/
const std::list< AGAdult > & getAdults() const
void generateCars(double rate)
Definition: AGHousehold.cpp:71
int getAdultNbr()
Definition: AGHousehold.cpp:98
bool allocateChildrenSchool()
A location in the 2D plane freely positioned on a street.
Definition: AGPosition.h:62
AGCity * myCity
Definition: AGHousehold.h:123
A model of the street in the city.
Definition: AGStreet.h:59
void addACar()
Definition: AGHousehold.cpp:82
void regenerate()
void generatePeople(int numAdults, int numChilds, bool firstRetired)
Definition: AGHousehold.cpp:45
int getCarNbr()
Definition: AGHousehold.cpp:88
Definition: AGCity.h:59
const std::list< AGChild > & getChildren() const
AGHousehold(AGPosition pos, AGCity *city, int idHouseholds)
Definition: AGHousehold.h:60
std::list< AGAdult > myAdults
Definition: AGHousehold.h:128
AGPosition getPosition()
bool isCloseFromPubTransport(std::list< AGPosition > *pubTransport)
bool retiredHouseholders()
int getPeopleNbr()
Definition: AGHousehold.cpp:93
AGCity * getTheCity()
AGPosition myLocation
Definition: AGHousehold.h:124
std::list< AGCar > myCars
Definition: AGHousehold.h:130
AGHousehold(AGStreet *str, AGCity *city, int idHouseholds)
Definition: AGHousehold.h:64
bool allocateAdultsWork()
std::list< AGChild > myChildren
Definition: AGHousehold.h:129
const std::list< AGCar > & getCars() const