SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGActivity Class Referenceabstract

#include <AGActivity.h>

Inheritance diagram for AGActivity:
AGFreeTime AGWorkAndSchool

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)
 

Protected Attributes

int activityPriority
 
SUMOReal carPreference
 
bool genDone
 
AGHousehold * myHousehold
 
std::list< AGTrip > myPartialActivityTrips
 
std::list< AGTrip > * myPreviousTrips
 
AGDataAndStatistics * myStatData
 
SUMOReal timePerKm
 

Detailed Description

Definition at line 46 of file AGActivity.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file AGActivity.h.

Member Function Documentation

int AGActivity::arrHour ( AGPosition  from,
AGPosition  to,
int  departure 
)
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. : 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 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 115 of file AGActivity.cpp.

References timeToDrive().

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

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

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

Definition at line 139 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 45 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 55 of file AGActivity.cpp.

References AGDataAndStatistics::busStations, AGPosition::distanceTo(), AGHousehold::getCarNbr(), AGHousehold::getPosition(), AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), myHousehold, myStatData, and SUMOReal.

Referenced by AGWorkAndSchool::buildWorkDestinations().

int AGActivity::randomTimeBetween ( int  begin,
int  end 
)

evaluates a random time between the given two time instants

Definition at line 127 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 109 of file AGActivity.cpp.

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

Referenced by arrHour(), and depHour().

Field Documentation

int AGActivity::activityPriority
protected

Definition at line 115 of file AGActivity.h.

SUMOReal AGActivity::carPreference
protected

rate of taking the car instead of the bus because of personal preference

Definition at line 121 of file AGActivity.h.

Referenced by AGWorkAndSchool::buildWorkDestinations().

bool AGActivity::genDone
protected
std::list<AGTrip>* AGActivity::myPreviousTrips
protected
AGDataAndStatistics* AGActivity::myStatData
protected

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