/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2010-2025 German Aerospace Center (DLR) and others.3// activitygen module4// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)5// This program and the accompanying materials are made available under the6// terms of the Eclipse Public License 2.0 which is available at7// https://www.eclipse.org/legal/epl-2.0/8// This Source Code may also be made available under the following Secondary9// Licenses when the conditions for such availability set forth in the Eclipse10// Public License 2.0 are satisfied: GNU General Public License, version 211// or later which is available at12// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html13// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later14/****************************************************************************/15/// @file AGHousehold.h16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Walter Bamberger19/// @author Michael Behrisch20/// @date July 201021///22// A household contains the people and cars of the city: roughly represents23// families with their address, cars, adults and possibly children24/****************************************************************************/25#pragma once26#include <config.h>2728#include <iostream>29#include <list>30#include "AGPerson.h"31#include "AGAdult.h"32#include "AGChild.h"33#include "AGCar.h"34#include "AGStreet.h"35#include "AGPosition.h"36#include "AGCity.h"373839// ===========================================================================40// class declarations41// ===========================================================================42class AGCity;434445// ===========================================================================46// class definitions47// ===========================================================================48class AGHousehold {49public:50AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) :51myCity(city),52myLocation(pos),53myId(idHouseholds) {};54AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) :55myCity(city),56myLocation(*str),57myId(idHouseholds) {};58/**59* function generating the given number of adults (1 or 2) and possibly children60*/61void generatePeople(int numAdults, int numChilds, bool firstRetired);62int getPeopleNbr();63int getAdultNbr();64const std::list<AGAdult>& getAdults() const;65const std::list<AGChild>& getChildren() const;66const std::list<AGCar>& getCars() const;67/**68* function returning true if the household is close to the given stations stations69*/70bool isCloseFromPubTransport(std::list<AGPosition>* pubTransport);71bool isCloseFromPubTransport(std::map<int, AGPosition>* pubTransport);72/**73* function regenerating the household:74* --> work positions and schools are resigned75* --> cars and people are deleted76* --> number of people are MAINTAINED77* --> work positions, schools and cars are reallocated78*/79void regenerate();80/**81* associates a school to each children.82* return false if not done (not enough place at school in the city...83*/84bool allocateChildrenSchool();85/**86* associates a work position to every working adult87* is taken in account the unemployment and the number of work positions88*/89bool allocateAdultsWork();90/**91* function allocating cars to this household in relation to the given rate for each adult92*/93void generateCars(double rate);94int getCarNbr();95/**96* generates one (more) car in this household97*/98void addACar();99/**100* returns the city pointer in which the household is.101*/102AGCity* getTheCity();103/**104* returns if adults are retired or in working age105*/106bool retiredHouseholders();107/**108* returns the position of the household and other private entities109*/110AGPosition getPosition();111112private:113AGCity* myCity;114AGPosition myLocation;115int myId;116117private:118std::list<AGAdult> myAdults;119std::list<AGChild> myChildren;120std::list<AGCar> myCars;121};122123124