Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGHousehold.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2010-2024 German Aerospace Center (DLR) and others.
4// activitygen module
5// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6// This program and the accompanying materials are made available under the
7// terms of the Eclipse Public License 2.0 which is available at
8// https://www.eclipse.org/legal/epl-2.0/
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License 2.0 are satisfied: GNU General Public License, version 2
12// or later which is available at
13// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15/****************************************************************************/
23// A household contains the people and cars of the city: roughly represents
24// families with their address, cars, adults and possibly children
25/****************************************************************************/
26#pragma once
27#include <config.h>
28
29#include <iostream>
30#include <list>
31#include "AGPerson.h"
32#include "AGAdult.h"
33#include "AGChild.h"
34#include "AGCar.h"
35#include "AGStreet.h"
36#include "AGPosition.h"
37#include "AGCity.h"
38
39
40// ===========================================================================
41// class declarations
42// ===========================================================================
43class AGCity;
44
45
46// ===========================================================================
47// class definitions
48// ===========================================================================
50public:
51 AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) :
52 myCity(city),
53 myLocation(pos),
54 myId(idHouseholds) {};
55 AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) :
56 myCity(city),
57 myLocation(*str),
58 myId(idHouseholds) {};
62 void generatePeople(int numAdults, int numChilds, bool firstRetired);
63 int getPeopleNbr();
64 int getAdultNbr();
65 const std::list<AGAdult>& getAdults() const;
66 const std::list<AGChild>& getChildren() const;
67 const std::list<AGCar>& getCars() const;
71 bool isCloseFromPubTransport(std::list<AGPosition>* pubTransport);
72 bool isCloseFromPubTransport(std::map<int, AGPosition>* pubTransport);
80 void regenerate();
90 bool allocateAdultsWork();
94 void generateCars(double rate);
95 int getCarNbr();
99 void addACar();
107 bool retiredHouseholders();
112
113private:
116 int myId;
117
118private:
119 std::list<AGAdult> myAdults;
120 std::list<AGChild> myChildren;
121 std::list<AGCar> myCars;
122};
void generateCars(double rate)
AGPosition getPosition()
AGCity * myCity
AGHousehold(AGStreet *str, AGCity *city, int idHouseholds)
Definition AGHousehold.h:55
const std::list< AGCar > & getCars() const
AGCity * getTheCity()
std::list< AGAdult > myAdults
void generatePeople(int numAdults, int numChilds, bool firstRetired)
void regenerate()
bool isCloseFromPubTransport(std::list< AGPosition > *pubTransport)
AGHousehold(AGPosition pos, AGCity *city, int idHouseholds)
Definition AGHousehold.h:51
std::list< AGChild > myChildren
bool allocateAdultsWork()
std::list< AGCar > myCars
int getPeopleNbr()
AGPosition myLocation
int getAdultNbr()
bool retiredHouseholders()
const std::list< AGChild > & getChildren() const
bool allocateChildrenSchool()
const std::list< AGAdult > & getAdults() const
A location in the 2D plane freely positioned on a street.
Definition AGPosition.h:53
A model of the street in the city.
Definition AGStreet.h:50