Eclipse SUMO - Simulation of Urban MObility
|
#include <AGFreeTime.h>
Public Member Functions | |
AGFreeTime (AGHousehold *hh, AGDataAndStatistics *das, std::list< AGTrip > *prevTrips) | |
AGFreeTime (AGHousehold *hh, AGDataAndStatistics *das, std::list< AGTrip > *prevTrips, int days) | |
int | arrHour (AGPosition from, AGPosition to, int departure) |
int | availableTranspMeans (AGPosition from, AGPosition to) |
int | decideTypeOfTrip () |
int | depHour (AGPosition from, AGPosition to, int arrival) |
bool | generateTrips () |
std::list< AGTrip > & | getPartialActivityTrips () |
bool | isGenerated () |
int | possibleTranspMean (AGPosition destination) |
int | possibleTypeOfTrip () |
int | randomTimeBetween (int begin, int end) |
int | timeToDrive (AGPosition from, AGPosition to) |
bool | typeFromHomeDay (int day) |
bool | typeFromHomeEvening (int day) |
bool | typeFromHomeNight (int day) |
int | whenBackHome () |
int | whenBackHomeThisDay (int day) |
int | whenBeginActivityNextDay (int day) |
Protected Attributes | |
int | activityPriority |
double | carPreference |
bool | genDone |
AGHousehold * | myHousehold |
std::list< AGTrip > | myPartialActivityTrips |
std::list< AGTrip > * | myPreviousTrips |
AGDataAndStatistics * | myStatData |
double | timePerKm |
Private Attributes | |
double | freqOut |
int | nbrDays |
int | possibleType |
int | tReady |
Static Private Attributes | |
static const int | DAY = 1 |
static const int | EVENING = 2 |
static const int | NIGHT = 4 |
static const int | TB_DAY = AGTime(0, 8, 0).getTime() |
static const int | TB_EVENING = AGTime(0, 19, 0).getTime() |
static const int | TB_NIGHT = AGTime(0, 23, 0).getTime() |
static const int | TE_DAY = AGTime(0, 18, 0).getTime() |
static const int | TE_EVENING = AGTime(0, 23, 59).getTime() |
static const int | TE_NIGHT = AGTime(1, 5, 0).getTime() |
Definition at line 36 of file AGFreeTime.h.
|
inline |
Definition at line 38 of file AGFreeTime.h.
|
inline |
Definition at line 42 of file AGFreeTime.h.
|
inherited |
Definition at line 118 of file AGActivity.cpp.
References AGActivity::timeToDrive().
Referenced by typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
|
inherited |
determine the possible means for a trip from one position to a destination. whether CAR is necessary or not, BUS available or not... 1 = by foot possible. 2 = by bus possible. 0 = by bus or foot NOT possible => only by car. @NOTE: 4 is useless because it is always possible @NOTE: 3 = 2 + 1 = means bus and foot possible.
Definition at line 85 of file AGActivity.cpp.
References BUS, AGDataAndStatistics::busStations, AGPosition::distanceTo(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), and AGActivity::myStatData.
Referenced by AGWorkAndSchool::buildChildrenAccompaniment().
int AGFreeTime::decideTypeOfTrip | ( | ) |
Definition at line 55 of file AGFreeTime.cpp.
References DAY, EVENING, freqOut, AGHousehold::getAdults(), AGActivity::myHousehold, NIGHT, possibleType, and RandHelper::rand().
Referenced by generateTrips().
|
inherited |
estimates the departure/arrival time given the departure location the arrival location and the wished arrival/departure time
Definition at line 110 of file AGActivity.cpp.
References AGActivity::timeToDrive().
Referenced by AGWorkAndSchool::carsToTrips(), and typeFromHomeNight().
|
virtual |
@Overwrite
Implements AGActivity.
Definition at line 202 of file AGFreeTime.cpp.
References DAY, decideTypeOfTrip(), EVENING, AGActivity::genDone, nbrDays, NIGHT, possibleType, possibleTypeOfTrip(), tReady, typeFromHomeDay(), typeFromHomeEvening(), typeFromHomeNight(), and whenBackHome().
Referenced by AGActivities::generateTrips().
|
inherited |
Definition at line 137 of file AGActivity.cpp.
References AGActivity::myPartialActivityTrips.
Referenced by AGActivities::generateTrips().
|
inherited |
returns whether the generation could have been well done
Definition at line 37 of file AGActivity.cpp.
References AGActivity::genDone.
|
inherited |
determine the possible transportation means, what would be chosen: 1 = foot 2 = bus 4 = car any combination is possible by simply addition of these values (ex. 7 means: 4+2+1 <=> foot, bus and car possible / 5 means: 4+1 <=> only foot and car are possible)
Definition at line 48 of file AGActivity.cpp.
References BUS, AGDataAndStatistics::busStations, CAR, AGPosition::distanceTo(), AGHousehold::getCarNbr(), AGHousehold::getPosition(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), AGActivity::myHousehold, and AGActivity::myStatData.
Referenced by AGWorkAndSchool::buildWorkDestinations().
int AGFreeTime::possibleTypeOfTrip | ( | ) |
returns the type of trip that will be done on this household there is also the case: no free time trip 0 = non 1 = during the day 2 = in the evening 4 = during the night (combinations using '+' are available for possibleTypeOfTrip())
Definition at line 98 of file AGFreeTime.cpp.
References DAY, EVENING, AGHousehold::getAdultNbr(), AGHousehold::getAdults(), AGHousehold::getPeopleNbr(), AGTime::getTime(), AGDataAndStatistics::limitAgeRetirement, AGActivity::myHousehold, AGActivity::myStatData, NIGHT, and tReady.
Referenced by generateTrips().
|
inherited |
evaluates a random time between the given two time instants
Definition at line 124 of file AGActivity.cpp.
References RandHelper::rand().
Referenced by typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
|
inherited |
evaluation of the needed time for going from one point to an other using the car
Definition at line 103 of file AGActivity.cpp.
References AGPosition::distanceTo(), and AGActivity::timePerKm.
Referenced by AGActivity::arrHour(), and AGActivity::depHour().
bool AGFreeTime::typeFromHomeDay | ( | int | day | ) |
The different type of trips that are available: one function is called among all the following
Definition at line 126 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGHousehold::getCars(), AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), MAX2(), AGActivity::myHousehold, AGActivity::myPartialActivityTrips, AGActivity::randomTimeBetween(), TB_DAY, TE_DAY, and whenBackHomeThisDay().
Referenced by generateTrips().
bool AGFreeTime::typeFromHomeEvening | ( | int | day | ) |
Definition at line 147 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGHousehold::getCars(), AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), MAX2(), AGActivity::myHousehold, AGActivity::myPartialActivityTrips, AGActivity::randomTimeBetween(), TB_EVENING, TE_EVENING, and whenBackHomeThisDay().
Referenced by generateTrips().
bool AGFreeTime::typeFromHomeNight | ( | int | day | ) |
Definition at line 168 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGActivity::depHour(), AGHousehold::getCars(), AGTime::getDay(), AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), AGTime::getTime(), MAX2(), MIN2(), AGActivity::myHousehold, AGActivity::myPartialActivityTrips, AGActivity::randomTimeBetween(), AGTime::setDay(), TB_NIGHT, TE_NIGHT, whenBackHomeThisDay(), and whenBeginActivityNextDay().
Referenced by generateTrips().
int AGFreeTime::whenBackHome | ( | ) |
returns the moment when everybody is back home and ready to do some thing else using everyday trips
Definition at line 230 of file AGFreeTime.cpp.
References AGActivity::myPreviousTrips, and AGActivity::timePerKm.
Referenced by generateTrips().
int AGFreeTime::whenBackHomeThisDay | ( | int | day | ) |
moment when everybody is back home using all trips applicable for the given day if no car is used: return 0
Definition at line 241 of file AGFreeTime.cpp.
References AGActivity::myPreviousTrips, and AGActivity::timePerKm.
Referenced by typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
int AGFreeTime::whenBeginActivityNextDay | ( | int | day | ) |
moment when the first person takes the car to go somewhere id no car is used: return 2400 (midnight at the end of the given day)
Definition at line 252 of file AGFreeTime.cpp.
References AGTime::addDays(), AGTime::getTime(), AGActivity::myPreviousTrips, and AGTime::setTime().
Referenced by typeFromHomeNight().
|
protectedinherited |
Definition at line 114 of file AGActivity.h.
|
protectedinherited |
rate of taking the car instead of the bus because of personal preference
Definition at line 120 of file AGActivity.h.
Referenced by AGWorkAndSchool::buildWorkDestinations().
|
staticprivate |
Definition at line 107 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
|
staticprivate |
Definition at line 108 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
|
private |
frequency of going out or see family is assumed to be once a week (in mean)
Definition at line 91 of file AGFreeTime.h.
Referenced by decideTypeOfTrip().
|
protectedinherited |
Definition at line 115 of file AGActivity.h.
Referenced by generateTrips(), AGWorkAndSchool::generateTrips(), and AGActivity::isGenerated().
|
protectedinherited |
Definition at line 108 of file AGActivity.h.
Referenced by AGWorkAndSchool::buildChildrenAccompaniment(), AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::carAllocation(), AGWorkAndSchool::carsToTrips(), decideTypeOfTrip(), AGWorkAndSchool::generateListTrips(), AGWorkAndSchool::generateTrips(), AGWorkAndSchool::getUnusedCar(), AGWorkAndSchool::isThereUnusedCar(), AGWorkAndSchool::makePossibleDriversDrive(), AGActivity::possibleTranspMean(), possibleTypeOfTrip(), typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
|
protectedinherited |
Definition at line 113 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateListTrips(), AGActivity::getPartialActivityTrips(), AGWorkAndSchool::getUnusedCar(), typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
|
protectedinherited |
Definition at line 112 of file AGActivity.h.
Referenced by whenBackHome(), whenBackHomeThisDay(), and whenBeginActivityNextDay().
|
protectedinherited |
Definition at line 110 of file AGActivity.h.
Referenced by AGActivity::availableTranspMeans(), AGActivity::possibleTranspMean(), and possibleTypeOfTrip().
|
private |
number of days for the simulation households are likely to go out some days but not others
Definition at line 96 of file AGFreeTime.h.
Referenced by generateTrips().
|
staticprivate |
Definition at line 109 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
|
private |
possible type of trips for this household
Definition at line 105 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), and generateTrips().
|
staticprivate |
Definition at line 111 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
|
staticprivate |
Definition at line 113 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
|
staticprivate |
Definition at line 115 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
|
staticprivate |
Definition at line 112 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
|
staticprivate |
Definition at line 114 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
|
staticprivate |
Definition at line 116 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
|
protectedinherited |
Definition at line 116 of file AGActivity.h.
Referenced by AGWorkAndSchool::checkAndBuildTripConsistancy(), AGWorkAndSchool::checkDriversScheduleMatching(), AGWorkAndSchool::generateListTrips(), AGActivity::timeToDrive(), whenBackHome(), and whenBackHomeThisDay().
|
private |
time ready to do something else everybody is back home
Definition at line 101 of file AGFreeTime.h.
Referenced by generateTrips(), and possibleTypeOfTrip().