Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGActivity Class Referenceabstract

#include <AGActivity.h>

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

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

Detailed Description

Definition at line 42 of file AGActivity.h.

Constructor & Destructor Documentation

◆ AGActivity()

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

Definition at line 44 of file AGActivity.h.

◆ ~AGActivity()

virtual AGActivity::~AGActivity ( )
inlinevirtual

empty destructor

Definition at line 54 of file AGActivity.h.

Member Function Documentation

◆ arrHour()

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

Here is the caller graph for this function:

◆ availableTranspMeans()

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

Here is the caller graph for this function:

◆ depHour()

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

Here is the caller graph for this function:

◆ generateTrips()

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

◆ getPartialActivityTrips()

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

Definition at line 137 of file AGActivity.cpp.

References myPartialActivityTrips.

Referenced by AGActivities::generateTrips().

Here is the caller graph for this function:

◆ isGenerated()

bool AGActivity::isGenerated ( )

returns whether the generation could have been well done

Definition at line 37 of file AGActivity.cpp.

References genDone.

◆ possibleTranspMean()

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

Here is the caller graph for this function:

◆ randomTimeBetween()

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

Here is the caller graph for this function:

◆ timeToDrive()

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

Here is the caller graph for this function:

Field Documentation

◆ activityPriority

int AGActivity::activityPriority
protected

Definition at line 114 of file AGActivity.h.

◆ carPreference

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

◆ genDone

bool AGActivity::genDone
protected

◆ myHousehold

◆ myPartialActivityTrips

◆ myPreviousTrips

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

◆ myStatData

AGDataAndStatistics* AGActivity::myStatData
protected

◆ timePerKm


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