SUMO - Simulation of Urban MObility
AGFreeTime Class Reference

#include <AGFreeTime.h>

Inheritance diagram for AGFreeTime:
AGActivity

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
 
AGHouseholdmyHousehold
 
std::list< AGTripmyPartialActivityTrips
 
std::list< AGTrip > * myPreviousTrips
 
AGDataAndStatisticsmyStatData
 
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()
 

Detailed Description

Definition at line 46 of file AGFreeTime.h.

Constructor & Destructor Documentation

AGFreeTime::AGFreeTime ( AGHousehold hh,
AGDataAndStatistics das,
std::list< AGTrip > *  prevTrips 
)
inline

Definition at line 48 of file AGFreeTime.h.

AGFreeTime::AGFreeTime ( AGHousehold hh,
AGDataAndStatistics das,
std::list< AGTrip > *  prevTrips,
int  days 
)
inline

Definition at line 52 of file AGFreeTime.h.

Member Function Documentation

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(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), and AGActivity::myStatData.

Referenced by AGWorkAndSchool::buildChildrenAccompaniment().

int AGFreeTime::decideTypeOfTrip ( )
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().

std::list< AGTrip > & AGActivity::getPartialActivityTrips ( )
inherited

Definition at line 139 of file AGActivity.cpp.

References AGActivity::myPartialActivityTrips.

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(), 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().

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)
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().

Field Documentation

int AGActivity::activityPriority
protectedinherited

Definition at line 116 of file AGActivity.h.

SUMOReal AGActivity::carPreference
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().

const int AGFreeTime::DAY = 1
staticprivate

Definition at line 117 of file AGFreeTime.h.

Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().

const int AGFreeTime::EVENING = 2
staticprivate

Definition at line 118 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 101 of file AGFreeTime.h.

Referenced by decideTypeOfTrip().

bool AGActivity::genDone
protectedinherited
std::list<AGTrip> AGActivity::myPartialActivityTrips
protectedinherited
std::list<AGTrip>* AGActivity::myPreviousTrips
protectedinherited

Definition at line 114 of file AGActivity.h.

Referenced by whenBackHome(), whenBackHomeThisDay(), and whenBeginActivityNextDay().

AGDataAndStatistics* AGActivity::myStatData
protectedinherited
int AGFreeTime::nbrDays
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().

const int AGFreeTime::NIGHT = 4
staticprivate

Definition at line 119 of file AGFreeTime.h.

Referenced by decideTypeOfTrip(), generateTrips(), and possibleTypeOfTrip().

int AGFreeTime::possibleType
private

possible type of trips for this household

Definition at line 115 of file AGFreeTime.h.

Referenced by decideTypeOfTrip(), and generateTrips().

const int AGFreeTime::TB_DAY = (new AGTime(0, 8, 0))->getTime()
staticprivate

Definition at line 121 of file AGFreeTime.h.

Referenced by typeFromHomeDay().

const int AGFreeTime::TB_EVENING = (new AGTime(0, 19, 0))->getTime()
staticprivate

Definition at line 123 of file AGFreeTime.h.

Referenced by typeFromHomeEvening().

const int AGFreeTime::TB_NIGHT = (new AGTime(0, 23, 0))->getTime()
staticprivate

Definition at line 125 of file AGFreeTime.h.

Referenced by typeFromHomeNight().

const int AGFreeTime::TE_DAY = (new AGTime(0, 18, 0))->getTime()
staticprivate

Definition at line 122 of file AGFreeTime.h.

Referenced by typeFromHomeDay().

const int AGFreeTime::TE_EVENING = (new AGTime(0, 23, 59))->getTime()
staticprivate

Definition at line 124 of file AGFreeTime.h.

Referenced by typeFromHomeEvening().

const int AGFreeTime::TE_NIGHT = (new AGTime(1, 5, 0))->getTime()
staticprivate

Definition at line 126 of file AGFreeTime.h.

Referenced by typeFromHomeNight().

int AGFreeTime::tReady
private

time ready to do something else everybody is back home

Definition at line 111 of file AGFreeTime.h.

Referenced by generateTrips(), and possibleTypeOfTrip().


The documentation for this class was generated from the following files: