Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGActivityGen Class Reference

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

#include <AGActivityGen.h>

Collaboration diagram for AGActivityGen:
[legend]

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

AGActivityGenoperator= (const AGActivityGen &)
 invalidated assignment operator
 

Detailed Description

Central object handling City, Activities and Trips.

Definition at line 46 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 55 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 132 of file AGActivityGen.cpp.

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

Referenced by makeActivityTrips().

Here is the caller graph for this function:

◆ importInfoCity()

void AGActivityGen::importInfoCity ( )

build the internal city

TO CALL 1: First function to be called: imports the XML input file and generates the whole city.

Definition at line 44 of file AGActivityGen.cpp.

References AGCity::carAllocation(), city, AGCity::completeBusLines(), AGCity::completeStreets(), AGDataAndStatistics::consolidateStat(), AGCity::generatePopulation(), AGCity::generateWorkPositions(), inputFile, net, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_FAILED_MESSAGE, XMLSubSys::runParser(), AGCity::schoolAllocation(), AGCity::statData, TL, and AGCity::workAllocation().

Referenced by main().

Here is the caller graph for this function:

◆ 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 173 of file AGActivityGen.cpp.

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

Referenced by main().

Here is the caller graph for this function:

◆ 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 89 of file AGActivityGen.cpp.

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

Referenced by makeActivityTrips().

Here is the caller graph for this function:

◆ 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 113 of file AGActivityGen.cpp.

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

Referenced by makeActivityTrips().

Here is the caller graph for this function:

Field Documentation

◆ beginTime

int AGActivityGen::beginTime
protected

Definition at line 94 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ city

AGCity AGActivityGen::city
protected

Definition at line 92 of file AGActivityGen.h.

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

◆ durationInDays

int AGActivityGen::durationInDays
protected

Definition at line 94 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ endTime

int AGActivityGen::endTime
protected

Definition at line 94 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

◆ inputFile

std::string AGActivityGen::inputFile
protected

Definition at line 85 of file AGActivityGen.h.

Referenced by importInfoCity().

◆ net

RONet* AGActivityGen::net
protected

Definition at line 89 of file AGActivityGen.h.

Referenced by importInfoCity().

◆ outputFile

OutputDevice& AGActivityGen::outputFile
protected

The generated routes.

Definition at line 87 of file AGActivityGen.h.

Referenced by generateOutputFile().


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