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 |
SUMOReal | carPreference |
bool | genDone |
AGHousehold * | myHousehold |
std::list< AGTrip > | myPartialActivityTrips |
std::list< AGTrip > * | myPreviousTrips |
AGDataAndStatistics * | myStatData |
SUMOReal | timePerKm |
Private Attributes | |
SUMOReal | 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 = (new AGTime(0, 8, 0))->getTime() |
static const int | TB_EVENING = (new AGTime(0, 19, 0))->getTime() |
static const int | TB_NIGHT = (new AGTime(0, 23, 0))->getTime() |
static const int | TE_DAY = (new AGTime(0, 18, 0))->getTime() |
static const int | TE_EVENING = (new AGTime(0, 23, 59))->getTime() |
static const int | TE_NIGHT = (new AGTime(1, 5, 0))->getTime() |
Definition at line 46 of file AGFreeTime.h.
|
inline |
Definition at line 48 of file AGFreeTime.h.
|
inline |
Definition at line 52 of file AGFreeTime.h.
|
inherited |
Definition at line 122 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. : 4 is useless because it is always possible : 3 = 2 + 1 = means bus and foot possible.
Definition at line 92 of file AGActivity.cpp.
References AGDataAndStatistics::busStations, AGPosition::distanceTo(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), and AGActivity::myStatData.
Referenced by AGWorkAndSchool::buildChildrenAccompaniment().
int AGFreeTime::decideTypeOfTrip | ( | ) |
Definition at line 63 of file AGFreeTime.cpp.
References DAY, EVENING, freqOut, AGHousehold::getAdults(), AGActivity::myHousehold, NIGHT, possibleType, RandHelper::rand(), and SUMOReal.
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 115 of file AGActivity.cpp.
References AGActivity::timeToDrive().
Referenced by AGWorkAndSchool::carsToTrips(), and typeFromHomeNight().
|
virtual |
Implements AGActivity.
Definition at line 210 of file AGFreeTime.cpp.
References DAY, decideTypeOfTrip(), EVENING, AGActivity::genDone, nbrDays, NIGHT, possibleType, possibleTypeOfTrip(), tReady, typeFromHomeDay(), typeFromHomeEvening(), typeFromHomeNight(), and whenBackHome().
|
inherited |
Definition at line 139 of file AGActivity.cpp.
References AGActivity::myPartialActivityTrips.
Referenced by AGActivities::generateTrips().
|
inherited |
returns whether the generation could have been well done
Definition at line 45 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 55 of file AGActivity.cpp.
References AGDataAndStatistics::busStations, AGPosition::distanceTo(), AGHousehold::getCarNbr(), AGHousehold::getPosition(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), AGActivity::myHousehold, AGActivity::myStatData, and SUMOReal.
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 106 of file AGFreeTime.cpp.
References DAY, EVENING, AGHousehold::getAdultNbr(), AGHousehold::getAdults(), AGHousehold::getPeopleNbr(), 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 127 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 109 of file AGActivity.cpp.
References AGPosition::distanceTo(), SUMOReal, 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 134 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 155 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 176 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 238 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 249 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 260 of file AGFreeTime.cpp.
References AGTime::addDays(), AGTime::getTime(), AGActivity::myPreviousTrips, and AGTime::setTime().
Referenced by typeFromHomeNight().
|
protectedinherited |
Definition at line 116 of file AGActivity.h.
|
protectedinherited |
rate of taking the car instead of the bus because of personal preference
Definition at line 122 of file AGActivity.h.
Referenced by AGWorkAndSchool::buildWorkDestinations().
|
staticprivate |
Definition at line 117 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
|
staticprivate |
Definition at line 118 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 101 of file AGFreeTime.h.
Referenced by decideTypeOfTrip().
|
protectedinherited |
Definition at line 117 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateTrips(), generateTrips(), and AGActivity::isGenerated().
|
protectedinherited |
Definition at line 110 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 115 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateListTrips(), AGActivity::getPartialActivityTrips(), AGWorkAndSchool::getUnusedCar(), typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
|
protectedinherited |
Definition at line 114 of file AGActivity.h.
Referenced by whenBackHome(), whenBackHomeThisDay(), and whenBeginActivityNextDay().
|
protectedinherited |
Definition at line 112 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 106 of file AGFreeTime.h.
Referenced by generateTrips().
|
staticprivate |
Definition at line 119 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
|
private |
possible type of trips for this household
Definition at line 115 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), and generateTrips().
Definition at line 121 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
Definition at line 123 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
Definition at line 125 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
Definition at line 122 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
Definition at line 124 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
Definition at line 126 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
|
protectedinherited |
Definition at line 118 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 111 of file AGFreeTime.h.
Referenced by generateTrips(), and possibleTypeOfTrip().