SUMO - Simulation of Urban MObility
AGActivityGen Class Reference

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

#include <AGActivityGen.h>

Public Member Functions

 AGActivityGen (std::string input, std::string 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 (AGTrip)
 validation: compatibility of the given trip
void varDepTime (AGTrip &trip)

Protected Attributes

int beginTime
AGCity city
int durationInDays
int endTime
std::string inputFile
RONetnet
std::string outputFile

Detailed Description

Central object handling City, Activities and Trips.

Definition at line 49 of file AGActivityGen.h.


Constructor & Destructor Documentation

AGActivityGen::AGActivityGen ( std::string  input,
std::string  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

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

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

Referenced by 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 185 of file AGActivityGen.cpp.

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

Referenced by main().

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

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

Referenced by makeActivityTrips().

void AGActivityGen::varDepTime ( AGTrip trip) [protected]

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 128 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

Definition at line 93 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

Definition at line 91 of file AGActivityGen.h.

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

Definition at line 93 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

Definition at line 93 of file AGActivityGen.h.

Referenced by makeActivityTrips(), and timeTripValidation().

std::string AGActivityGen::inputFile [protected]

Definition at line 88 of file AGActivityGen.h.

Referenced by importInfoCity().

RONet* AGActivityGen::net [protected]

Definition at line 95 of file AGActivityGen.h.

Referenced by importInfoCity().

std::string AGActivityGen::outputFile [protected]

Definition at line 88 of file AGActivityGen.h.

Referenced by generateOutputFile().


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