Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGFreeTime Class Reference

#include <AGFreeTime.h>

Inheritance diagram for AGFreeTime:
[legend]
Collaboration diagram for AGFreeTime:
[legend]

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

Detailed Description

Definition at line 36 of file AGFreeTime.h.

Constructor & Destructor Documentation

◆ AGFreeTime() [1/2]

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

Definition at line 38 of file AGFreeTime.h.

◆ AGFreeTime() [2/2]

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

Definition at line 42 of file AGFreeTime.h.

Member Function Documentation

◆ arrHour()

int AGActivity::arrHour ( AGPosition  from,
AGPosition  to,
int  departure 
)
inherited

Definition at line 118 of file AGActivity.cpp.

References AGActivity::timeToDrive().

Referenced by typeFromHomeDay(), typeFromHomeEvening(), and typeFromHomeNight().

Here is the caller graph for this function:

◆ availableTranspMeans()

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

Here is the caller graph for this function:

◆ decideTypeOfTrip()

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

Here is the caller graph for this function:

◆ depHour()

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 110 of file AGActivity.cpp.

References AGActivity::timeToDrive().

Referenced by AGWorkAndSchool::carsToTrips(), and typeFromHomeNight().

Here is the caller graph for this function:

◆ generateTrips()

bool AGFreeTime::generateTrips ( )
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().

Here is the caller graph for this function:

◆ getPartialActivityTrips()

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

Definition at line 137 of file AGActivity.cpp.

References AGActivity::myPartialActivityTrips.

Referenced by AGActivities::generateTrips().

Here is the caller graph for this function:

◆ isGenerated()

bool AGActivity::isGenerated ( )
inherited

returns whether the generation could have been well done

Definition at line 37 of file AGActivity.cpp.

References AGActivity::genDone.

◆ possibleTranspMean()

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

Here is the caller graph for this function:

◆ possibleTypeOfTrip()

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

Here is the caller graph for this function:

◆ randomTimeBetween()

int AGActivity::randomTimeBetween ( int  begin,
int  end 
)
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().

Here is the caller graph for this function:

◆ timeToDrive()

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 103 of file AGActivity.cpp.

References AGPosition::distanceTo(), and AGActivity::timePerKm.

Referenced by AGActivity::arrHour(), and AGActivity::depHour().

Here is the caller graph for this function:

◆ typeFromHomeDay()

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

Here is the caller graph for this function:

◆ typeFromHomeEvening()

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

Here is the caller graph for this function:

◆ typeFromHomeNight()

bool AGFreeTime::typeFromHomeNight ( int  day)

◆ whenBackHome()

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

Here is the caller graph for this function:

◆ whenBackHomeThisDay()

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

Here is the caller graph for this function:

◆ whenBeginActivityNextDay()

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

Here is the caller graph for this function:

Field Documentation

◆ activityPriority

int AGActivity::activityPriority
protectedinherited

Definition at line 114 of file AGActivity.h.

◆ carPreference

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

◆ DAY

const int AGFreeTime::DAY = 1
staticprivate

Definition at line 107 of file AGFreeTime.h.

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

◆ EVENING

const int AGFreeTime::EVENING = 2
staticprivate

Definition at line 108 of file AGFreeTime.h.

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

◆ freqOut

double AGFreeTime::freqOut
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().

◆ genDone

bool AGActivity::genDone
protectedinherited

◆ myHousehold

◆ myPartialActivityTrips

std::list<AGTrip> AGActivity::myPartialActivityTrips
protectedinherited

◆ myPreviousTrips

std::list<AGTrip>* AGActivity::myPreviousTrips
protectedinherited

Definition at line 112 of file AGActivity.h.

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

◆ myStatData

AGDataAndStatistics* AGActivity::myStatData
protectedinherited

◆ nbrDays

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

◆ NIGHT

const int AGFreeTime::NIGHT = 4
staticprivate

Definition at line 109 of file AGFreeTime.h.

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

◆ possibleType

int AGFreeTime::possibleType
private

possible type of trips for this household

Definition at line 105 of file AGFreeTime.h.

Referenced by decideTypeOfTrip(), and generateTrips().

◆ TB_DAY

const int AGFreeTime::TB_DAY = AGTime(0, 8, 0).getTime()
staticprivate

Definition at line 111 of file AGFreeTime.h.

Referenced by typeFromHomeDay().

◆ TB_EVENING

const int AGFreeTime::TB_EVENING = AGTime(0, 19, 0).getTime()
staticprivate

Definition at line 113 of file AGFreeTime.h.

Referenced by typeFromHomeEvening().

◆ TB_NIGHT

const int AGFreeTime::TB_NIGHT = AGTime(0, 23, 0).getTime()
staticprivate

Definition at line 115 of file AGFreeTime.h.

Referenced by typeFromHomeNight().

◆ TE_DAY

const int AGFreeTime::TE_DAY = AGTime(0, 18, 0).getTime()
staticprivate

Definition at line 112 of file AGFreeTime.h.

Referenced by typeFromHomeDay().

◆ TE_EVENING

const int AGFreeTime::TE_EVENING = AGTime(0, 23, 59).getTime()
staticprivate

Definition at line 114 of file AGFreeTime.h.

Referenced by typeFromHomeEvening().

◆ TE_NIGHT

const int AGFreeTime::TE_NIGHT = AGTime(1, 5, 0).getTime()
staticprivate

Definition at line 116 of file AGFreeTime.h.

Referenced by typeFromHomeNight().

◆ timePerKm

◆ tReady

int AGFreeTime::tReady
private

time ready to do something else everybody is back home

Definition at line 101 of file AGFreeTime.h.

Referenced by generateTrips(), and possibleTypeOfTrip().


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