Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGHousehold Class Reference

#include <AGHousehold.h>

Collaboration diagram for AGHousehold:
[legend]

Public Member Functions

void addACar ()
 AGHousehold (AGPosition pos, AGCity *city, int idHouseholds)
 AGHousehold (AGStreet *str, AGCity *city, int idHouseholds)
bool allocateAdultsWork ()
bool allocateChildrenSchool ()
void generateCars (double rate)
void generatePeople (int numAdults, int numChilds, bool firstRetired)
int getAdultNbr ()
const std::list< AGAdult > & getAdults () const
int getCarNbr ()
const std::list< AGCar > & getCars () const
const std::list< AGChild > & getChildren () const
int getPeopleNbr ()
AGPosition getPosition ()
AGCitygetTheCity ()
bool isCloseFromPubTransport (std::list< AGPosition > *pubTransport)
bool isCloseFromPubTransport (std::map< int, AGPosition > *pubTransport)
void regenerate ()
bool retiredHouseholders ()

Private Attributes

std::list< AGAdultmyAdults
std::list< AGCarmyCars
std::list< AGChildmyChildren
AGCitymyCity
int myId
AGPosition myLocation

Detailed Description

Definition at line 49 of file AGHousehold.h.

Constructor & Destructor Documentation

◆ AGHousehold() [1/2]

AGHousehold::AGHousehold ( AGPosition pos,
AGCity * city,
int idHouseholds )
inline

Definition at line 51 of file AGHousehold.h.

References myCity, myId, and myLocation.

◆ AGHousehold() [2/2]

AGHousehold::AGHousehold ( AGStreet * str,
AGCity * city,
int idHouseholds )
inline

Definition at line 55 of file AGHousehold.h.

References myCity, myId, and myLocation.

Member Function Documentation

◆ addACar()

void AGHousehold::addACar ( )

generates one (more) car in this household

Definition at line 77 of file AGHousehold.cpp.

References myCars, and myId.

Referenced by generateCars().

Here is the caller graph for this function:

◆ allocateAdultsWork()

bool AGHousehold::allocateAdultsWork ( )

associates a work position to every working adult is taken in account the unemployment and the number of work positions

Definition at line 172 of file AGHousehold.cpp.

References myAdults, and myCity.

◆ allocateChildrenSchool()

bool AGHousehold::allocateChildrenSchool ( )

associates a school to each children. return false if not done (not enough place at school in the city...

Definition at line 159 of file AGHousehold.cpp.

References myChildren, myCity, and myLocation.

◆ generateCars()

void AGHousehold::generateCars ( double rate)

function allocating cars to this household in relation to the given rate for each adult

Definition at line 66 of file AGHousehold.cpp.

References addACar(), myAdults, myCars, and RandHelper::rand().

◆ generatePeople()

void AGHousehold::generatePeople ( int numAdults,
int numChilds,
bool firstRetired )

function generating the given number of adults (1 or 2) and possibly children

Definition at line 40 of file AGHousehold.cpp.

References AGDataAndStatistics::getRandomPopDistributed(), AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, AGDataAndStatistics::limitEndAge, myAdults, myChildren, and myCity.

◆ getAdultNbr()

int AGHousehold::getAdultNbr ( )

Definition at line 93 of file AGHousehold.cpp.

References myAdults.

◆ getAdults()

const std::list< AGAdult > & AGHousehold::getAdults ( ) const

Definition at line 98 of file AGHousehold.cpp.

References myAdults.

◆ getCarNbr()

int AGHousehold::getCarNbr ( )

Definition at line 83 of file AGHousehold.cpp.

References myCars.

◆ getCars()

const std::list< AGCar > & AGHousehold::getCars ( ) const

Definition at line 108 of file AGHousehold.cpp.

References myCars.

◆ getChildren()

const std::list< AGChild > & AGHousehold::getChildren ( ) const

Definition at line 103 of file AGHousehold.cpp.

References myChildren.

◆ getPeopleNbr()

int AGHousehold::getPeopleNbr ( )

Definition at line 88 of file AGHousehold.cpp.

References myAdults, and myChildren.

◆ getPosition()

AGPosition AGHousehold::getPosition ( )

returns the position of the household and other private entities

Definition at line 187 of file AGHousehold.cpp.

References myLocation.

Referenced by regenerate().

Here is the caller graph for this function:

◆ getTheCity()

AGCity * AGHousehold::getTheCity ( )

returns the city pointer in which the household is.

Definition at line 192 of file AGHousehold.cpp.

References myCity.

◆ isCloseFromPubTransport() [1/2]

bool AGHousehold::isCloseFromPubTransport ( std::list< AGPosition > * pubTransport)

function returning true if the household is close to the given stations stations

Definition at line 113 of file AGHousehold.cpp.

References myCity, and myLocation.

◆ isCloseFromPubTransport() [2/2]

bool AGHousehold::isCloseFromPubTransport ( std::map< int, AGPosition > * pubTransport)

Definition at line 122 of file AGHousehold.cpp.

References myCity, and myLocation.

◆ regenerate()

void AGHousehold::regenerate ( )

function regenerating the household: --> work positions and schools are resigned --> cars and people are deleted --> number of people are MAINTAINED --> work positions, schools and cars are reallocated

Definition at line 131 of file AGHousehold.cpp.

References getPosition(), myAdults, myChildren, and myCity.

Referenced by AGActivities::generateTrips().

Here is the caller graph for this function:

◆ retiredHouseholders()

bool AGHousehold::retiredHouseholders ( )

returns if adults are retired or in working age

Definition at line 197 of file AGHousehold.cpp.

References myAdults, and myCity.

Field Documentation

◆ myAdults

std::list<AGAdult> AGHousehold::myAdults
private

◆ myCars

std::list<AGCar> AGHousehold::myCars
private

Definition at line 121 of file AGHousehold.h.

Referenced by addACar(), generateCars(), getCarNbr(), and getCars().

◆ myChildren

std::list<AGChild> AGHousehold::myChildren
private

◆ myCity

◆ myId

int AGHousehold::myId
private

Definition at line 116 of file AGHousehold.h.

Referenced by addACar(), AGHousehold(), and AGHousehold().

◆ myLocation

AGPosition AGHousehold::myLocation
private

The documentation for this class was generated from the following files: