Eclipse SUMO - Simulation of Urban MObility
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.

◆ AGHousehold() [2/2]

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

Definition at line 55 of file AGHousehold.h.

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, myCity, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.

◆ 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, myLocation, and AGCity::schools.

◆ 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 
)

◆ getAdultNbr()

int AGHousehold::getAdultNbr ( )

Definition at line 93 of file AGHousehold.cpp.

References myAdults.

Referenced by AGWorkAndSchool::carAllocation(), AGWorkAndSchool::makePossibleDriversDrive(), and AGFreeTime::possibleTypeOfTrip().

Here is the caller graph for this function:

◆ getAdults()

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

Definition at line 98 of file AGHousehold.cpp.

References myAdults.

Referenced by AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::carAllocation(), AGFreeTime::decideTypeOfTrip(), AGWorkAndSchool::makePossibleDriversDrive(), and AGFreeTime::possibleTypeOfTrip().

Here is the caller graph for this function:

◆ getCarNbr()

int AGHousehold::getCarNbr ( )

Definition at line 83 of file AGHousehold.cpp.

References myCars.

Referenced by AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::generateTrips(), AGWorkAndSchool::isThereUnusedCar(), and AGActivity::possibleTranspMean().

Here is the caller graph for this function:

◆ getCars()

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

Definition at line 108 of file AGHousehold.cpp.

References myCars.

Referenced by AGWorkAndSchool::carsToTrips(), AGWorkAndSchool::getUnusedCar(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().

Here is the caller graph for this function:

◆ getChildren()

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

Definition at line 103 of file AGHousehold.cpp.

References myChildren.

Referenced by AGWorkAndSchool::buildChildrenAccompaniment().

Here is the caller graph for this function:

◆ getPeopleNbr()

int AGHousehold::getPeopleNbr ( )

Definition at line 88 of file AGHousehold.cpp.

References myAdults, and myChildren.

Referenced by AGFreeTime::possibleTypeOfTrip().

Here is the caller graph for this function:

◆ 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 AGWorkAndSchool::buildChildrenAccompaniment(), AGWorkAndSchool::carsToTrips(), AGWorkAndSchool::generateListTrips(), AGActivity::possibleTranspMean(), regenerate(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().

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.

Referenced by AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().

Here is the caller graph for this function:

◆ 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 AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), myCity, myLocation, and AGCity::statData.

◆ isCloseFromPubTransport() [2/2]

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

◆ 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, myCity, AGCity::schools, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.

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 AGDataAndStatistics::limitAgeRetirement, myAdults, myCity, and AGCity::statData.

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().

◆ myLocation

AGPosition AGHousehold::myLocation
private

Definition at line 115 of file AGHousehold.h.

Referenced by allocateChildrenSchool(), getPosition(), and isCloseFromPubTransport().


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