Eclipse SUMO - Simulation of Urban MObility
|
#include <AGActivity.h>
Public Member Functions | |
AGActivity (AGHousehold *hh, AGDataAndStatistics *das, std::list< AGTrip > *prevTrips, int prio) | |
int | arrHour (AGPosition from, AGPosition to, int departure) |
int | availableTranspMeans (AGPosition from, AGPosition to) |
int | depHour (AGPosition from, AGPosition to, int arrival) |
virtual bool | generateTrips ()=0 |
std::list< AGTrip > & | getPartialActivityTrips () |
bool | isGenerated () |
int | possibleTranspMean (AGPosition destination) |
int | randomTimeBetween (int begin, int end) |
int | timeToDrive (AGPosition from, AGPosition to) |
virtual | ~AGActivity () |
empty destructor | |
Protected Attributes | |
int | activityPriority |
double | carPreference |
bool | genDone |
AGHousehold * | myHousehold |
std::list< AGTrip > | myPartialActivityTrips |
std::list< AGTrip > * | myPreviousTrips |
AGDataAndStatistics * | myStatData |
double | timePerKm |
Definition at line 42 of file AGActivity.h.
|
inline |
Definition at line 44 of file AGActivity.h.
|
inlinevirtual |
empty destructor
Definition at line 54 of file AGActivity.h.
int AGActivity::arrHour | ( | AGPosition | from, |
AGPosition | to, | ||
int | departure | ||
) |
Definition at line 118 of file AGActivity.cpp.
References timeToDrive().
Referenced by AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
int AGActivity::availableTranspMeans | ( | AGPosition | from, |
AGPosition | to | ||
) |
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 myStatData.
Referenced by AGWorkAndSchool::buildChildrenAccompaniment().
int AGActivity::depHour | ( | AGPosition | from, |
AGPosition | to, | ||
int | arrival | ||
) |
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 timeToDrive().
Referenced by AGWorkAndSchool::carsToTrips(), and AGFreeTime::typeFromHomeNight().
|
pure virtual |
main function called for trip generation this function is overwritten in every child-class (every activity)
Implemented in AGFreeTime, and AGWorkAndSchool.
Definition at line 43 of file AGActivity.cpp.
std::list< AGTrip > & AGActivity::getPartialActivityTrips | ( | ) |
Definition at line 137 of file AGActivity.cpp.
References myPartialActivityTrips.
Referenced by AGActivities::generateTrips().
bool AGActivity::isGenerated | ( | ) |
returns whether the generation could have been well done
Definition at line 37 of file AGActivity.cpp.
References genDone.
int AGActivity::possibleTranspMean | ( | AGPosition | destination | ) |
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(), myHousehold, and myStatData.
Referenced by AGWorkAndSchool::buildWorkDestinations().
int AGActivity::randomTimeBetween | ( | int | begin, |
int | end | ||
) |
evaluates a random time between the given two time instants
Definition at line 124 of file AGActivity.cpp.
References RandHelper::rand().
Referenced by AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
int AGActivity::timeToDrive | ( | AGPosition | from, |
AGPosition | to | ||
) |
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 timePerKm.
Referenced by arrHour(), and depHour().
|
protected |
Definition at line 114 of file AGActivity.h.
|
protected |
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().
|
protected |
Definition at line 115 of file AGActivity.h.
Referenced by AGFreeTime::generateTrips(), AGWorkAndSchool::generateTrips(), and isGenerated().
|
protected |
Definition at line 108 of file AGActivity.h.
Referenced by AGWorkAndSchool::buildChildrenAccompaniment(), AGWorkAndSchool::buildWorkDestinations(), AGWorkAndSchool::carAllocation(), AGWorkAndSchool::carsToTrips(), AGFreeTime::decideTypeOfTrip(), AGWorkAndSchool::generateListTrips(), AGWorkAndSchool::generateTrips(), AGWorkAndSchool::getUnusedCar(), AGWorkAndSchool::isThereUnusedCar(), AGWorkAndSchool::makePossibleDriversDrive(), possibleTranspMean(), AGFreeTime::possibleTypeOfTrip(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
|
protected |
Definition at line 113 of file AGActivity.h.
Referenced by AGWorkAndSchool::generateListTrips(), getPartialActivityTrips(), AGWorkAndSchool::getUnusedCar(), AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::typeFromHomeNight().
|
protected |
Definition at line 112 of file AGActivity.h.
Referenced by AGFreeTime::whenBackHome(), AGFreeTime::whenBackHomeThisDay(), and AGFreeTime::whenBeginActivityNextDay().
|
protected |
Definition at line 110 of file AGActivity.h.
Referenced by availableTranspMeans(), possibleTranspMean(), and AGFreeTime::possibleTypeOfTrip().
|
protected |
Definition at line 116 of file AGActivity.h.
Referenced by AGWorkAndSchool::checkAndBuildTripConsistancy(), AGWorkAndSchool::checkDriversScheduleMatching(), AGWorkAndSchool::generateListTrips(), timeToDrive(), AGFreeTime::whenBackHome(), and AGFreeTime::whenBackHomeThisDay().