|
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 () |
| 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) |
Data Fields | |
| int | activityPriority |
| SUMOReal | carPreference |
| AGDataAndStatistics * | ds |
| bool | genDone |
| AGHousehold * | hh |
| std::list< AGTrip > | partialActivityTrips |
| std::list< AGTrip > * | previousTrips |
| 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 45 of file AGFreeTime.h.
| AGFreeTime::AGFreeTime | ( | AGHousehold * | hh, |
| AGDataAndStatistics * | das, | ||
| std::list< AGTrip > * | prevTrips | ||
| ) | [inline] |
Definition at line 47 of file AGFreeTime.h.
| AGFreeTime::AGFreeTime | ( | AGHousehold * | hh, |
| AGDataAndStatistics * | das, | ||
| std::list< AGTrip > * | prevTrips, | ||
| int | days | ||
| ) | [inline] |
Definition at line 51 of file AGFreeTime.h.
| int AGActivity::arrHour | ( | AGPosition | from, |
| AGPosition | to, | ||
| int | departure | ||
| ) | [inherited] |
Definition at line 122 of file AGActivity.cpp.
References AGActivity::timeToDrive().
Referenced by typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
| int AGActivity::availableTranspMeans | ( | AGPosition | from, |
| AGPosition | to | ||
| ) | [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(), AGActivity::ds, AGDataAndStatistics::maxFootDistance, and AGPosition::minDistanceTo().
Referenced by AGWorkAndSchool::buildChildrenAccompaniment().
| int AGFreeTime::decideTypeOfTrip | ( | ) |
Definition at line 62 of file AGFreeTime.cpp.
References AGHousehold::adults, DAY, EVENING, freqOut, AGActivity::hh, NIGHT, possibleType, RandHelper::rand(), and SUMOReal.
Referenced by generateTrips().
| int AGActivity::depHour | ( | AGPosition | from, |
| AGPosition | to, | ||
| int | arrival | ||
| ) | [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().
| bool AGFreeTime::generateTrips | ( | ) |
Reimplemented from AGActivity.
Definition at line 209 of file AGFreeTime.cpp.
References DAY, decideTypeOfTrip(), EVENING, AGActivity::genDone, nbrDays, NIGHT, possibleType, possibleTypeOfTrip(), tReady, typeFromHomeDay(), typeFromHomeEvening(), typeFromHomeNight(), and whenBackHome().
Referenced by AGActivities::generateTrips().
| bool AGActivity::isGenerated | ( | ) | [inherited] |
returns whether the generation could have been well done
Definition at line 45 of file AGActivity.cpp.
References AGActivity::genDone.
| int AGActivity::possibleTranspMean | ( | AGPosition | destination | ) | [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(), AGActivity::ds, AGHousehold::getCarNbr(), AGHousehold::getPosition(), AGActivity::hh, AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), 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 105 of file AGFreeTime.cpp.
References AGHousehold::adults, DAY, AGActivity::ds, EVENING, AGHousehold::getAdultNbr(), AGHousehold::getPeopleNbr(), AGActivity::hh, AGDataAndStatistics::limitAgeRetirement, NIGHT, and tReady.
Referenced by generateTrips().
| int AGActivity::randomTimeBetween | ( | int | begin, |
| int | end | ||
| ) | [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().
| int AGActivity::timeToDrive | ( | AGPosition | from, |
| AGPosition | to | ||
| ) | [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 133 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGHousehold::cars, AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), AGActivity::hh, MAX2(), AGActivity::partialActivityTrips, AGActivity::randomTimeBetween(), TB_DAY, TE_DAY, and whenBackHomeThisDay().
Referenced by generateTrips().
| bool AGFreeTime::typeFromHomeEvening | ( | int | day | ) |
Definition at line 154 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGHousehold::cars, AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), AGActivity::hh, MAX2(), AGActivity::partialActivityTrips, AGActivity::randomTimeBetween(), TB_EVENING, TE_EVENING, and whenBackHomeThisDay().
Referenced by generateTrips().
| bool AGFreeTime::typeFromHomeNight | ( | int | day | ) |
Definition at line 175 of file AGFreeTime.cpp.
References AGActivity::arrHour(), AGHousehold::cars, AGActivity::depHour(), AGTime::getDay(), AGHousehold::getPosition(), AGCity::getRandomStreet(), AGHousehold::getTheCity(), AGTime::getTime(), AGActivity::hh, MAX2(), MIN2(), AGActivity::partialActivityTrips, 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 237 of file AGFreeTime.cpp.
References AGActivity::previousTrips, 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 251 of file AGFreeTime.cpp.
References AGActivity::previousTrips, 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 265 of file AGFreeTime.cpp.
References AGTime::addDays(), AGTime::getTime(), AGActivity::previousTrips, and AGTime::setTime().
Referenced by typeFromHomeNight().
int AGActivity::activityPriority [inherited] |
Definition at line 111 of file AGActivity.h.
SUMOReal AGActivity::carPreference [inherited] |
rate of taking the car instead of the bus because of personal preference
Definition at line 116 of file AGActivity.h.
Referenced by AGWorkAndSchool::buildWorkDestinations().
const int AGFreeTime::DAY = 1 [static, private] |
Definition at line 116 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
AGDataAndStatistics* AGActivity::ds [inherited] |
Definition at line 120 of file AGActivity.h.
Referenced by AGActivity::availableTranspMeans(), AGActivity::possibleTranspMean(), and possibleTypeOfTrip().
const int AGFreeTime::EVENING = 2 [static, private] |
Definition at line 117 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
SUMOReal AGFreeTime::freqOut [private] |
frequency of going out or see family is assumed to be once a week (in mean)
Definition at line 114 of file AGFreeTime.h.
Referenced by decideTypeOfTrip().
bool AGActivity::genDone [inherited] |
Definition at line 110 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateTrips(), generateTrips(), and AGActivity::isGenerated().
AGHousehold* AGActivity::hh [inherited] |
Definition at line 118 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().
int AGFreeTime::nbrDays [private] |
number of days for the simulation households are likely to go out some days but not others
Definition at line 101 of file AGFreeTime.h.
Referenced by generateTrips().
const int AGFreeTime::NIGHT = 4 [static, private] |
Definition at line 118 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().
std::list<AGTrip> AGActivity::partialActivityTrips [inherited] |
Definition at line 108 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateListTrips(), AGActivities::generateTrips(), AGWorkAndSchool::getUnusedCar(), typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().
int AGFreeTime::possibleType [private] |
possible type of trips for this household
Definition at line 110 of file AGFreeTime.h.
Referenced by decideTypeOfTrip(), and generateTrips().
std::list<AGTrip>* AGActivity::previousTrips [inherited] |
Definition at line 109 of file AGActivity.h.
Referenced by whenBackHome(), whenBackHomeThisDay(), and whenBeginActivityNextDay().
const int AGFreeTime::TB_DAY = (new AGTime(0, 8, 0))->getTime() [static, private] |
Definition at line 120 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
const int AGFreeTime::TB_EVENING = (new AGTime(0, 19, 0))->getTime() [static, private] |
Definition at line 122 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
const int AGFreeTime::TB_NIGHT = (new AGTime(0, 23, 0))->getTime() [static, private] |
Definition at line 124 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
const int AGFreeTime::TE_DAY = (new AGTime(0, 18, 0))->getTime() [static, private] |
Definition at line 121 of file AGFreeTime.h.
Referenced by typeFromHomeDay().
const int AGFreeTime::TE_EVENING = (new AGTime(0, 23, 59))->getTime() [static, private] |
Definition at line 123 of file AGFreeTime.h.
Referenced by typeFromHomeEvening().
const int AGFreeTime::TE_NIGHT = (new AGTime(1, 5, 0))->getTime() [static, private] |
Definition at line 125 of file AGFreeTime.h.
Referenced by typeFromHomeNight().
SUMOReal AGActivity::timePerKm [inherited] |
Definition at line 112 of file AGActivity.h.
Referenced by AGWorkAndSchool::checkAndBuildTripConsistancy(), AGWorkAndSchool::checkDriversScheduleMatching(), AGWorkAndSchool::generateListTrips(), AGActivity::timeToDrive(), whenBackHome(), and whenBackHomeThisDay().
int AGFreeTime::tReady [private] |
time ready to do something else everybody is back home
Definition at line 106 of file AGFreeTime.h.
Referenced by generateTrips(), and possibleTypeOfTrip().