SUMO - Simulation of Urban MObility
AGActivity Class Reference

#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)
bool generateTrips ()
bool isGenerated ()
int possibleTranspMean (AGPosition destination)
int randomTimeBetween (int begin, int end)
int timeToDrive (AGPosition from, AGPosition to)

Data Fields

int activityPriority
SUMOReal carPreference
AGDataAndStatisticsds
bool genDone
AGHouseholdhh
std::list< AGTrippartialActivityTrips
std::list< AGTrip > * previousTrips
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

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

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

main function called for trip generation this function is overwritten in every child-class (every activity) BE OVERWRITEN

Reimplemented in AGFreeTime, and AGWorkAndSchool.

Definition at line 50 of file AGActivity.cpp.

returns whether the generation could have been well done

Definition at line 45 of file AGActivity.cpp.

References genDone.

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(), ds, AGHousehold::getCarNbr(), AGHousehold::getPosition(), hh, AGDataAndStatistics::maxFootDistance, AGPosition::minDistanceTo(), 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().

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

Definition at line 111 of file AGActivity.h.

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

Definition at line 116 of file AGActivity.h.

Referenced by AGWorkAndSchool::buildWorkDestinations().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines