![]() |
SUMO - Simulation of Urban MObility
|
#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 (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 () |
AGCity * | getTheCity () |
bool | isCloseFromPubTransport (std::list< AGPosition > *pubTransport) |
bool | isCloseFromPubTransport (std::map< int, AGPosition > *pubTransport) |
void | regenerate () |
bool | retiredHouseholders () |
Private Attributes | |
std::list< AGAdult > | myAdults |
std::list< AGCar > | myCars |
std::list< AGChild > | myChildren |
AGCity * | myCity |
int | myId |
AGPosition | myLocation |
Definition at line 52 of file AGHousehold.h.
|
inline |
Definition at line 54 of file AGHousehold.h.
Definition at line 58 of file AGHousehold.h.
References addACar(), allocateAdultsWork(), allocateChildrenSchool(), generateCars(), generatePeople(), getAdultNbr(), getAdults(), getCarNbr(), getCars(), getChildren(), getPeopleNbr(), getPosition(), getTheCity(), isCloseFromPubTransport(), regenerate(), and retiredHouseholders().
void AGHousehold::addACar | ( | ) |
generates one (more) car in this household
Definition at line 76 of file AGHousehold.cpp.
Referenced by AGHousehold(), and 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 171 of file AGHousehold.cpp.
References myAdults, myCity, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.
Referenced by AGHousehold().
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 158 of file AGHousehold.cpp.
References myChildren, myCity, myLocation, and AGCity::schools.
Referenced by AGHousehold().
void AGHousehold::generateCars | ( | double | rate | ) |
function allocating cars to this household in relation to the given rate for each adult
Definition at line 65 of file AGHousehold.cpp.
References addACar(), myAdults, myCars, and RandHelper::rand().
Referenced by AGHousehold().
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 39 of file AGHousehold.cpp.
References AGDataAndStatistics::getRandomPopDistributed(), AGDataAndStatistics::limitAgeChildren, AGDataAndStatistics::limitAgeRetirement, AGDataAndStatistics::limitEndAge, myAdults, myChildren, myCity, and AGCity::statData.
Referenced by AGHousehold().
int AGHousehold::getAdultNbr | ( | ) |
Definition at line 92 of file AGHousehold.cpp.
References myAdults.
Referenced by AGHousehold(), AGWorkAndSchool::carAllocation(), AGWorkAndSchool::makePossibleDriversDrive(), and AGFreeTime::possibleTypeOfTrip().
const std::list< AGAdult > & AGHousehold::getAdults | ( | ) | const |
Definition at line 97 of file AGHousehold.cpp.
References myAdults.
Referenced by AGHousehold(), AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::carAllocation(), AGFreeTime::decideTypeOfTrip(), AGWorkAndSchool::makePossibleDriversDrive(), and AGFreeTime::possibleTypeOfTrip().
int AGHousehold::getCarNbr | ( | ) |
Definition at line 82 of file AGHousehold.cpp.
References myCars.
Referenced by AGHousehold(), AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::generateTrips(), AGWorkAndSchool::isThereUnusedCar(), and AGActivity::possibleTranspMean().
const std::list< AGCar > & AGHousehold::getCars | ( | ) | const |
Definition at line 107 of file AGHousehold.cpp.
References myCars.
Referenced by AGHousehold(), AGWorkAndSchool::carsToTrips(), AGWorkAndSchool::getUnusedCar(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
const std::list< AGChild > & AGHousehold::getChildren | ( | ) | const |
Definition at line 102 of file AGHousehold.cpp.
References myChildren.
Referenced by AGHousehold(), and AGWorkAndSchool::buildChildrenAccompaniment().
int AGHousehold::getPeopleNbr | ( | ) |
Definition at line 87 of file AGHousehold.cpp.
References myAdults, and myChildren.
Referenced by AGHousehold(), and AGFreeTime::possibleTypeOfTrip().
AGPosition AGHousehold::getPosition | ( | ) |
returns the position of the household and other private entities
Definition at line 186 of file AGHousehold.cpp.
References myLocation.
Referenced by AGHousehold(), AGWorkAndSchool::buildChildrenAccompaniment(), AGWorkAndSchool::carsToTrips(), AGWorkAndSchool::generateListTrips(), AGActivity::possibleTranspMean(), regenerate(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
AGCity * AGHousehold::getTheCity | ( | ) |
returns the city pointer in which the household is.
Definition at line 191 of file AGHousehold.cpp.
References myCity.
Referenced by AGHousehold(), 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 112 of file AGHousehold.cpp.
References AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), myCity, myLocation, and AGCity::statData.
Referenced by AGHousehold().
bool AGHousehold::isCloseFromPubTransport | ( | std::map< int, AGPosition > * | pubTransport | ) |
Definition at line 121 of file AGHousehold.cpp.
References AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), myCity, myLocation, and AGCity::statData.
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 130 of file AGHousehold.cpp.
References getPosition(), myAdults, myChildren, myCity, AGCity::schools, AGCity::statData, AGDataAndStatistics::unemployement, AGCity::workPositions, and AGDataAndStatistics::workPositions.
Referenced by AGHousehold(), and AGActivities::generateTrips().
bool AGHousehold::retiredHouseholders | ( | ) |
returns if adults are retired or in working age
Definition at line 196 of file AGHousehold.cpp.
References AGDataAndStatistics::limitAgeRetirement, myAdults, myCity, and AGCity::statData.
Referenced by AGHousehold().
|
private |
Definition at line 122 of file AGHousehold.h.
Referenced by allocateAdultsWork(), generateCars(), generatePeople(), getAdultNbr(), getAdults(), getPeopleNbr(), regenerate(), and retiredHouseholders().
|
private |
Definition at line 124 of file AGHousehold.h.
Referenced by addACar(), generateCars(), getCarNbr(), and getCars().
|
private |
Definition at line 123 of file AGHousehold.h.
Referenced by allocateChildrenSchool(), generatePeople(), getChildren(), getPeopleNbr(), and regenerate().
|
private |
Definition at line 117 of file AGHousehold.h.
Referenced by allocateAdultsWork(), allocateChildrenSchool(), generatePeople(), getTheCity(), isCloseFromPubTransport(), regenerate(), and retiredHouseholders().
|
private |
Definition at line 119 of file AGHousehold.h.
Referenced by addACar().
|
private |
Definition at line 118 of file AGHousehold.h.
Referenced by allocateChildrenSchool(), getPosition(), and isCloseFromPubTransport().