SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGHousehold Class Reference

#include <AGHousehold.h>

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 (SUMOReal rate)
void generatePeople ()
int getAdultNbr ()
int getCarNbr ()
int getPeopleNbr ()
AGPosition getPosition ()
AGCitygetTheCity ()
bool isCloseFromPubTransport (std::list< AGPosition > *pubTransport)
bool isCloseFromPubTransport (std::map< int, AGPosition > *pubTransport)
void regenerate ()
bool retiredHouseholders ()

Data Fields

std::list< AGAdultadults
std::list< AGCarcars
std::list< AGChildchildren

Private Member Functions

bool decisionProba (SUMOReal p)

Private Attributes

int idHH
AGPosition location
AGCitymyCity
int numberOfCars
int numberOfPeople

Detailed Description

Definition at line 58 of file AGHousehold.h.


Constructor & Destructor Documentation

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

Definition at line 60 of file AGHousehold.h.

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

Definition at line 64 of file AGHousehold.h.


Member Function Documentation

void AGHousehold::addACar ( )

generates one (more) car in this household

Definition at line 86 of file AGHousehold.cpp.

References cars, and idHH.

Referenced by generateCars().

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 166 of file AGHousehold.cpp.

References adults, myCity, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.

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 153 of file AGHousehold.cpp.

References children, location, myCity, and AGCity::schools.

bool AGHousehold::decisionProba ( SUMOReal  p)
private

Definition at line 181 of file AGHousehold.cpp.

References RandHelper::rand().

Referenced by generateCars(), and generatePeople().

void AGHousehold::generateCars ( SUMOReal  rate)

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

Definition at line 75 of file AGHousehold.cpp.

References addACar(), adults, cars, and decisionProba().

void AGHousehold::generatePeople ( )
  • function generating one first Adult.
  • a second person is created depending on the mean number of adults per Households (and depending on the age of the first person)
  • and children are created for households of one or two people in age to work. Children are created in relation to the mean number of children and they are distributed with the POISSON's lay of probability.

Definition at line 46 of file AGHousehold.cpp.

References adults, children, decisionProba(), AGDataAndStatistics::getPoissonsNumberOfChildren(), AGDataAndStatistics::getRandomPopDistributed(), AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, AGDataAndStatistics::limitEndAge, AGDataAndStatistics::meanNbrChildren, myCity, AGDataAndStatistics::secondPersProb, and AGCity::statData.

int AGHousehold::getAdultNbr ( )
int AGHousehold::getPeopleNbr ( )

Definition at line 97 of file AGHousehold.cpp.

References adults, and children.

Referenced by AGFreeTime::possibleTypeOfTrip().

AGCity * AGHousehold::getTheCity ( )

returns the city pointer in which the household is.

Definition at line 191 of file AGHousehold.cpp.

References myCity.

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

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

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

Definition at line 107 of file AGHousehold.cpp.

References location, AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), myCity, AGCity::statData, and SUMOReal.

bool AGHousehold::isCloseFromPubTransport ( std::map< int, AGPosition > *  pubTransport)
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 125 of file AGHousehold.cpp.

References adults, children, getPosition(), myCity, AGCity::schools, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.

Referenced by AGActivities::generateTrips().

bool AGHousehold::retiredHouseholders ( )

returns if adults are retired or in working age

Definition at line 196 of file AGHousehold.cpp.

References adults, AGDataAndStatistics::limitAgeRetirement, myCity, and AGCity::statData.


Field Documentation

std::list<AGChild> AGHousehold::children
int AGHousehold::idHH
private

Definition at line 135 of file AGHousehold.h.

Referenced by addACar().

AGPosition AGHousehold::location
private

Definition at line 132 of file AGHousehold.h.

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

int AGHousehold::numberOfCars
private

Definition at line 134 of file AGHousehold.h.

int AGHousehold::numberOfPeople
private

Definition at line 133 of file AGHousehold.h.


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