Eclipse SUMO - Simulation of Urban MObility
AGActivityGen Class Reference

Central object handling City, Activities and Trips. More...

#include <AGActivityGen.h>

Collaboration diagram for AGActivityGen:

Public Member Functions

 AGActivityGen (std::string input, OutputDevice &output, RONet *net)
 Constructor. More...
 
void importInfoCity ()
 build the internal city More...
 
void makeActivityTrips (int days=1, int beginTime=0, int endTime=0)
 build activities and trips of the population and generate routes More...
 

Protected Member Functions

void generateOutputFile (std::list< AGTrip > &trips)
 generate the output file (trips or routes) using a trip list More...
 
bool timeTripValidation (const AGTrip &trip) const
 validation: compatibility of the given trip More...
 
void varDepTime (AGTrip &trip) const
 

Protected Attributes

int beginTime
 
AGCity city
 
int durationInDays
 
int endTime
 
std::string inputFile
 
RONetnet
 
OutputDeviceoutputFile
 The generated routes. More...
 

Private Member Functions

AGActivityGenoperator= (const AGActivityGen &)
 invalidated assignment operator More...
 

Detailed Description

Central object handling City, Activities and Trips.

Definition at line 49 of file AGActivityGen.h.

Constructor & Destructor Documentation

◆ AGActivityGen()

AGActivityGen::AGActivityGen ( std::string  input,
OutputDevice output,
RONet net 
)
inline

Constructor.

Parameters
[in]inputinput stat-file name (containing information about the city)
[in]outputxml file in which we'll write the routes generated
[in]netnetwork of the city

Definition at line 58 of file AGActivityGen.h.

Member Function Documentation

◆ generateOutputFile()

void AGActivityGen::generateOutputFile ( std::list< AGTrip > &  trips)
protected

generate the output file (trips or routes) using a trip list

Parameters
[in]tripsgenerated by the different activities

Definition at line 134 of file AGActivityGen.cpp.

References AGActivityTripWriter::addTrip(), AGTime::getDay(), AGTime::getHour(), AGTime::getMinute(), AGTime::getSecond(), and outputFile.

Referenced by makeActivityTrips().

◆ importInfoCity()

◆ makeActivityTrips()

void AGActivityGen::makeActivityTrips ( int  days = 1,
int  beginTime = 0,
int  endTime = 0 
)

build activities and trips of the population and generate routes

TO CALL 2: generates City's Activity and the corresponding trips

Parameters
[in]days: duration of the simulation (>=0) (day of the end - day of the beginning)
[in]beginTime: instant of the simulation beginning (in the first day)
[in]endTime: instant of the simulation ending (in the last day) NOTE: if (days==0) : endTime > beginTime

EXAMPLE: if days=1, endTime=0, beginTime=0: The duration will be 24 hours from 12am to 12amof the next day

making the activity trips

validating the trips with the simulation's time limits

re-ordering of trips: SUMO needs routes ordered by departure time.

trip file generation

Definition at line 175 of file AGActivityGen.cpp.

References beginTime, city, durationInDays, endTime, AGActivities::generateActivityTrips(), generateOutputFile(), AGTrip::setType(), timeTripValidation(), AGActivities::trips, and varDepTime().

◆ operator=()

AGActivityGen& AGActivityGen::operator= ( const AGActivityGen )
private

invalidated assignment operator

◆ timeTripValidation()

bool AGActivityGen::timeTripValidation ( const AGTrip trip) const
protected

validation: compatibility of the given trip

Parameters
[in]tripto be validated
Returns
whether the trip is compatible with the time boundaries or not. for this begin, end and duration of the simulation must be defined

Definition at line 91 of file AGActivityGen.cpp.

References beginTime, durationInDays, endTime, AGTrip::getDay(), and AGTrip::getTime().

Referenced by makeActivityTrips().

◆ varDepTime()

void AGActivityGen::varDepTime ( AGTrip trip) const
protected

@breif introduce a slight variation into the departure time of "default" vehicles

Parameters
[in]tripon which a random (normally distributed) variation will be tried

Definition at line 115 of file AGActivityGen.cpp.

References city, AGDataAndStatistics::departureVariation, AGTrip::getDay(), AGTrip::getTime(), AGTrip::getType(), RandHelper::randNorm(), AGTrip::setDay(), AGTrip::setDepTime(), and AGCity::statData.

Referenced by makeActivityTrips().

Field Documentation

◆ beginTime

int AGActivityGen::beginTime
protected

Definition at line 97 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ city

AGCity AGActivityGen::city
protected

Definition at line 95 of file AGActivityGen.h.

Referenced by importInfoCity(), makeActivityTrips(), and varDepTime().

◆ durationInDays

int AGActivityGen::durationInDays
protected

Definition at line 97 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ endTime

int AGActivityGen::endTime
protected

Definition at line 97 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ inputFile

std::string AGActivityGen::inputFile
protected

Definition at line 88 of file AGActivityGen.h.

Referenced by importInfoCity().

◆ net

RONet* AGActivityGen::net
protected

Definition at line 92 of file AGActivityGen.h.

Referenced by importInfoCity().

◆ outputFile

OutputDevice& AGActivityGen::outputFile
protected

The generated routes.

Definition at line 90 of file AGActivityGen.h.

Referenced by generateOutputFile().


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