Eclipse SUMO - Simulation of Urban MObility
AGWorkAndSchool Class Reference

#include <AGWorkAndSchool.h>

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

Public Member Functions

 AGWorkAndSchool (AGHousehold *hh, AGDataAndStatistics *das, std::list< AGTrip > *prevTrips)
 
int arrHour (AGPosition from, AGPosition to, int departure)
 
int availableTranspMeans (AGPosition from, AGPosition to)
 
void buildChildrenAccompaniment ()
 
void buildWorkDestinations ()
 
void carAllocation ()
 
bool carsToTrips ()
 
bool checkAndBuildTripConsistancy ()
 
bool checkDriversScheduleMatching ()
 
int depHour (AGPosition from, AGPosition to, int arrival)
 
void generateListTrips ()
 
bool generateTrips ()
 
std::list< AGTrip > & getPartialActivityTrips ()
 
std::string getUnusedCar ()
 
bool isGenerated ()
 
bool isThereUnusedCar ()
 
void makePossibleDriversDrive ()
 
int possibleTranspMean (AGPosition destination)
 
int randomTimeBetween (int begin, int end)
 
int timeToDrive (AGPosition from, AGPosition to)
 

Protected Attributes

int activityPriority
 
double carPreference
 
bool genDone
 
AGHouseholdmyHousehold
 
std::list< AGTripmyPartialActivityTrips
 
std::list< AGTrip > * myPreviousTrips
 
AGDataAndStatisticsmyStatData
 
double timePerKm
 

Private Attributes

std::list< AGAdultadultNeedingCarAccompaniment
 
std::list< AGChildchildrenNeedingCarAccompaniment
 
std::list< AGAdultnotNeedingDrivers
 
std::list< AGAdultpersonsDrivingCars
 
std::list< AGTriptempAccTrip
 
std::list< AGTriptempTrip
 
std::list< AGAdultworkingPeoplePossCar
 

Detailed Description

Definition at line 35 of file AGWorkAndSchool.h.

Constructor & Destructor Documentation

◆ AGWorkAndSchool()

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

Definition at line 37 of file AGWorkAndSchool.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 AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::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 buildChildrenAccompaniment().

Here is the caller graph for this function:

◆ buildChildrenAccompaniment()

void AGWorkAndSchool::buildChildrenAccompaniment ( )

generate objects

Definition at line 74 of file AGWorkAndSchool.cpp.

References AGActivity::availableTranspMeans(), childrenNeedingCarAccompaniment, AGHousehold::getChildren(), AGHousehold::getPosition(), and AGActivity::myHousehold.

Referenced by generateTrips().

Here is the caller graph for this function:

◆ buildWorkDestinations()

void AGWorkAndSchool::buildWorkDestinations ( )

Definition at line 87 of file AGWorkAndSchool.cpp.

References adultNeedingCarAccompaniment, AGHousehold::getAdults(), AGHousehold::getCarNbr(), AGActivity::myHousehold, personsDrivingCars, AGActivity::possibleTranspMean(), and workingPeoplePossCar.

Referenced by generateTrips().

Here is the caller graph for this function:

◆ carAllocation()

void AGWorkAndSchool::carAllocation ( )

allocation of cars to the convenient adult: the adult able to accompany the other (adult) and children in need.

Definition at line 121 of file AGWorkAndSchool.cpp.

References adultNeedingCarAccompaniment, childrenNeedingCarAccompaniment, AGHousehold::getAdultNbr(), AGHousehold::getAdults(), AGActivity::myHousehold, notNeedingDrivers, personsDrivingCars, and workingPeoplePossCar.

Referenced by generateTrips().

Here is the caller graph for this function:

◆ carsToTrips()

bool AGWorkAndSchool::carsToTrips ( )

◆ checkAndBuildTripConsistancy()

bool AGWorkAndSchool::checkAndBuildTripConsistancy ( )

main function of Accompaniment trip management: simple trips are analyzed whether they can be grouped together or not. return true if every thing worked well

Definition at line 200 of file AGWorkAndSchool.cpp.

References tempAccTrip, and AGActivity::timePerKm.

Referenced by carsToTrips().

Here is the caller graph for this function:

◆ checkDriversScheduleMatching()

bool AGWorkAndSchool::checkDriversScheduleMatching ( )

checks whether the driver is able to accompany all people or if the others have to go too late to work for him

Definition at line 241 of file AGWorkAndSchool.cpp.

References notNeedingDrivers, tempAccTrip, and tempTrip.

Referenced by carsToTrips().

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 carsToTrips(), and AGFreeTime::typeFromHomeNight().

Here is the caller graph for this function:

◆ generateListTrips()

void AGWorkAndSchool::generateListTrips ( )

function generating Trip objects using the local objects

1 / 3 : Accompaniment

2/3 : drivers way

3/3: way return

Definition at line 268 of file AGWorkAndSchool.cpp.

References AGHousehold::getPosition(), getUnusedCar(), AGActivity::myHousehold, AGActivity::myPartialActivityTrips, notNeedingDrivers, personsDrivingCars, tempAccTrip, tempTrip, and AGActivity::timePerKm.

Referenced by carsToTrips().

Here is the caller graph for this function:

◆ generateTrips()

bool AGWorkAndSchool::generateTrips ( )
virtual

@Overwrite

Implements AGActivity.

Definition at line 41 of file AGWorkAndSchool.cpp.

References adultNeedingCarAccompaniment, buildChildrenAccompaniment(), buildWorkDestinations(), carAllocation(), carsToTrips(), childrenNeedingCarAccompaniment, AGActivity::genDone, AGHousehold::getCarNbr(), AGActivity::myHousehold, notNeedingDrivers, and personsDrivingCars.

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:

◆ getUnusedCar()

std::string AGWorkAndSchool::getUnusedCar ( )

return the name of a car that is not used by another adult driver of the household in fact there is only 1 or 2 adults, so if the number of cars is greater that 1 at least one car isn't used

Definition at line 350 of file AGWorkAndSchool.cpp.

References AGHousehold::getCars(), AGActivity::myHousehold, AGActivity::myPartialActivityTrips, and tempTrip.

Referenced by generateListTrips().

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.

◆ isThereUnusedCar()

bool AGWorkAndSchool::isThereUnusedCar ( )

returns true if there is an unused car that can be driven by an adult

Definition at line 195 of file AGWorkAndSchool.cpp.

References AGHousehold::getCarNbr(), AGActivity::myHousehold, notNeedingDrivers, and personsDrivingCars.

Referenced by carsToTrips().

Here is the caller graph for this function:

◆ makePossibleDriversDrive()

void AGWorkAndSchool::makePossibleDriversDrive ( )

function adding new drivers when a not used car is needed

  • when the person prefer the car to the bus (choice variable)

Definition at line 371 of file AGWorkAndSchool.cpp.

References adultNeedingCarAccompaniment, AGHousehold::getAdultNbr(), AGHousehold::getAdults(), AGActivity::myHousehold, notNeedingDrivers, personsDrivingCars, and workingPeoplePossCar.

Referenced by carsToTrips().

Here is the caller graph for this function:

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

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 AGFreeTime::typeFromHomeDay(), AGFreeTime::typeFromHomeEvening(), and AGFreeTime::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:

Field Documentation

◆ activityPriority

int AGActivity::activityPriority
protectedinherited

Definition at line 114 of file AGActivity.h.

◆ adultNeedingCarAccompaniment

std::list<AGAdult> AGWorkAndSchool::adultNeedingCarAccompaniment
private

adult needing a car having a car but this car is not available because of an other person

Definition at line 111 of file AGWorkAndSchool.h.

Referenced by buildWorkDestinations(), carAllocation(), carsToTrips(), generateTrips(), and makePossibleDriversDrive().

◆ 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.

◆ childrenNeedingCarAccompaniment

std::list<AGChild> AGWorkAndSchool::childrenNeedingCarAccompaniment
private

list of destinations for children, which can be reach only using a car (too far from home) and therefore need to be accompanied: waiting list for the accompaniment

Definition at line 106 of file AGWorkAndSchool.h.

Referenced by buildChildrenAccompaniment(), carAllocation(), carsToTrips(), and generateTrips().

◆ genDone

bool AGActivity::genDone
protectedinherited

Definition at line 115 of file AGActivity.h.

Referenced by AGFreeTime::generateTrips(), generateTrips(), and AGActivity::isGenerated().

◆ myHousehold

◆ myPartialActivityTrips

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

◆ myPreviousTrips

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

◆ myStatData

AGDataAndStatistics* AGActivity::myStatData
protectedinherited

◆ notNeedingDrivers

std::list<AGAdult> AGWorkAndSchool::notNeedingDrivers
private

adults of the household who are not in need of car for work but are able to accompany someone. used only in case of need.

Definition at line 127 of file AGWorkAndSchool.h.

Referenced by carAllocation(), checkDriversScheduleMatching(), generateListTrips(), generateTrips(), isThereUnusedCar(), and makePossibleDriversDrive().

◆ personsDrivingCars

std::list<AGAdult> AGWorkAndSchool::personsDrivingCars
private

◆ tempAccTrip

std::list<AGTrip> AGWorkAndSchool::tempAccTrip
private

list of temporary trips: contains accompaniment trips without any return to home.

Definition at line 132 of file AGWorkAndSchool.h.

Referenced by carsToTrips(), checkAndBuildTripConsistancy(), checkDriversScheduleMatching(), and generateListTrips().

◆ tempTrip

std::list<AGTrip> AGWorkAndSchool::tempTrip
private

◆ timePerKm

double AGActivity::timePerKm
protectedinherited

◆ workingPeoplePossCar

std::list<AGAdult> AGWorkAndSchool::workingPeoplePossCar
private

list of destinations for work by bus or car, car being possible (other wise bus or feet)

Definition at line 117 of file AGWorkAndSchool.h.

Referenced by buildWorkDestinations(), carAllocation(), and makePossibleDriversDrive().


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