class holding the services related to Travel Demand Generation. More...
#include <trademgen/TRADEMGEN_Service.hpp>
Public Member Functions | |
TRADEMGEN_Service (const stdair::BasLogParams &, const stdair::BasDBParams &, const stdair::RandomSeed_T &) | |
Constructor. | |
TRADEMGEN_Service (const stdair::BasLogParams &, const stdair::RandomSeed_T &) | |
TRADEMGEN_Service (stdair::STDAIR_ServicePtr_T, const stdair::RandomSeed_T &) | |
void | parseAndLoad (const stdair::Filename_T &iDemandInputFilename) |
~TRADEMGEN_Service () | |
void | buildSampleBom () |
stdair::BookingRequestStruct | buildSampleBookingRequest (const bool isForCRS=false) |
void | displayAirlineListFromDB () const |
const stdair::Count_T & | getExpectedTotalNumberOfRequestsToBeGenerated () const |
const stdair::Count_T & | getActualTotalNumberOfRequestsToBeGenerated () const |
const bool | stillHavingRequestsToBeGenerated (const stdair::DemandStreamKeyStr_T &, stdair::ProgressStatusSet &, const stdair::DemandGenerationMethod &) const |
stdair::Count_T | generateFirstRequests (const stdair::DemandGenerationMethod &) const |
stdair::BookingRequestPtr_T | generateNextRequest (const stdair::DemandStreamKeyStr_T &, const stdair::DemandGenerationMethod &) const |
stdair::ProgressStatusSet | popEvent (stdair::EventStruct &) const |
bool | isQueueDone () const |
bool | generateCancellation (const stdair::TravelSolutionStruct &, const stdair::PartySize_T &, const stdair::DateTime_T &, const stdair::Date_T &) const |
void | reset () const |
std::string | csvDisplay () const |
class holding the services related to Travel Demand Generation.
TRADEMGEN::TRADEMGEN_Service::TRADEMGEN_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::BasDBParams & | iDBParams, | ||
const stdair::RandomSeed_T & | iRandomSeed | ||
) |
Constructor.
The initTrademgenService() method is called; see the corresponding documentation for more details.
A reference on an output stream is given, so that log outputs can be directed onto that stream.
Moreover, database connection parameters are given, so that a session can be created on the corresponding database.
const | stdair::BasLogParams& Parameters for the output log stream. |
const | stdair::BasDBParams& Parameters for the database access. |
const | stdair::RandomSeed_T& Seed for the random generation. |
Definition at line 71 of file TRADEMGEN_Service.cpp.
TRADEMGEN::TRADEMGEN_Service::TRADEMGEN_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::RandomSeed_T & | iRandomSeed | ||
) |
Constructor.
The initTrademgenService() method is called; see the corresponding documentation for more details.
A reference on an output stream is given, so that log outputs can be directed onto that stream.
const | stdair::BasLogParams& Parameters for the output log stream. |
const | stdair::RandomSeed_T& Seed for the random generation. |
Definition at line 50 of file TRADEMGEN_Service.cpp.
TRADEMGEN::TRADEMGEN_Service::TRADEMGEN_Service | ( | stdair::STDAIR_ServicePtr_T | ioSTDAIR_Service_ptr, |
const stdair::RandomSeed_T & | iRandomSeed | ||
) |
Constructor.
The initTrademgenService() method is called; see the corresponding documentation for more details.
Moreover, as no reference on any output stream is given, neither any database access parameter is given, it is assumed that the StdAir log service has already been initialised with the proper log output stream by some other methods in the calling chain (for instance, when the TRADEMGEN_Service is itself being initialised by another library service such as DSIM_Service).
stdair::STDAIR_ServicePtr_T | Handler on the STDAIR_Service. |
const | stdair::RandomSeed_T& Seed for the random generation. |
Definition at line 94 of file TRADEMGEN_Service.cpp.
TRADEMGEN::TRADEMGEN_Service::~TRADEMGEN_Service | ( | ) |
Destructor.
Definition at line 111 of file TRADEMGEN_Service.cpp.
void TRADEMGEN::TRADEMGEN_Service::parseAndLoad | ( | const stdair::Filename_T & | iDemandInputFilename | ) |
Parse the demand input file.
The CSV file, describing the parameters of the demand to be generated for the simulator, is parsed and instantiated in memory accordingly.
const | stdair::Filename_T& Filename of the input demand file. |
Definition at line 187 of file TRADEMGEN_Service.cpp.
References generateDemand().
Referenced by main(), and TRADEMGEN::Trademgener::init().
void TRADEMGEN::TRADEMGEN_Service::buildSampleBom | ( | ) |
Build a sample BOM tree, made of a single DemandStream object.
As of now (March 2011), it corresponds to:
Definition at line 220 of file TRADEMGEN_Service.cpp.
Referenced by main().
stdair::BookingRequestStruct TRADEMGEN::TRADEMGEN_Service::buildSampleBookingRequest | ( | const bool | isForCRS = false | ) |
Build a sample booking request structure.
As of now (March 2011), the sample booking request is made of the following parameters:
As of now (March 2011), the CRS-related booking request is made of the following parameters:
const | bool isForCRS Whether the sample booking request is for CRS. |
Definition at line 279 of file TRADEMGEN_Service.cpp.
void TRADEMGEN::TRADEMGEN_Service::displayAirlineListFromDB | ( | ) | const |
Display the list of airlines, as held within the sample database.
Definition at line 324 of file TRADEMGEN_Service.cpp.
Referenced by main(), and TRADEMGEN::Trademgener::trademgen().
const stdair::Count_T & TRADEMGEN::TRADEMGEN_Service::getExpectedTotalNumberOfRequestsToBeGenerated | ( | ) | const |
Get the expected number of events/requests to be generated for all the demand streams.
The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
Definition at line 385 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
const stdair::Count_T & TRADEMGEN::TRADEMGEN_Service::getActualTotalNumberOfRequestsToBeGenerated | ( | ) | const |
Get the actual number of events/requests to be generated for all the demand streams.
The getActualTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.
Definition at line 409 of file TRADEMGEN_Service.cpp.
const bool TRADEMGEN::TRADEMGEN_Service::stillHavingRequestsToBeGenerated | ( | const stdair::DemandStreamKeyStr_T & | iKey, |
stdair::ProgressStatusSet & | ioPSS, | ||
const stdair::DemandGenerationMethod & | iDemandGenerationMethod | ||
) | const |
Check whether enough requests have already been generated for the demand stream which corresponds to the given key.
const | DemandStreamKey& A string identifying uniquely the demand stream (e.g., "SIN-HND 2010-Feb-08 Y"). |
const | stdair::DemandGenerationMethod& States whether the demand generation must be performed following the method based on statistic orders. The alternative method, while more "intuitive", is also a sequential algorithm. |
Definition at line 433 of file TRADEMGEN_Service.cpp.
stdair::Count_T TRADEMGEN::TRADEMGEN_Service::generateFirstRequests | ( | const stdair::DemandGenerationMethod & | iDemandGenerationMethod | ) | const |
Browse the list of demand streams and generate the first request of each stream.
const | stdair::DemandGenerationMethod& States whether the demand generation must be performed following the method based on statistic orders. The alternative method, while more "intuitive", is also a sequential algorithm. |
Definition at line 460 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
stdair::BookingRequestPtr_T TRADEMGEN::TRADEMGEN_Service::generateNextRequest | ( | const stdair::DemandStreamKeyStr_T & | iKey, |
const stdair::DemandGenerationMethod & | iDemandGenerationMethod | ||
) | const |
Generate a request with the demand stream which corresponds to the given key.
const | DemandStreamKey& A string identifying uniquely the demand stream (e.g., "SIN-HND 2010-Feb-08 Y"). |
const | stdair::DemandGenerationMethod& States whether the demand generation must be performed following the method based on statistic orders. The alternative method, while more "intuitive", is also a sequential algorithm. |
Definition at line 489 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
stdair::ProgressStatusSet TRADEMGEN::TRADEMGEN_Service::popEvent | ( | stdair::EventStruct & | ioEventStruct | ) | const |
Pop the next coming (in time) event, and remove it from the event queue.
Definition at line 515 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
bool TRADEMGEN::TRADEMGEN_Service::isQueueDone | ( | ) | const |
States whether the event queue has reached the end.
For now, that method states whether the event queue is empty.
Definition at line 534 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
bool TRADEMGEN::TRADEMGEN_Service::generateCancellation | ( | const stdair::TravelSolutionStruct & | iTravelSolution, |
const stdair::PartySize_T & | iPartySize, | ||
const stdair::DateTime_T & | iRequestTime, | ||
const stdair::Date_T & | iDepartureDate | ||
) | const |
Generate the potential cancellation event.
Definition at line 557 of file TRADEMGEN_Service.cpp.
void TRADEMGEN::TRADEMGEN_Service::reset | ( | ) | const |
Reset the context of the demand streams for another demand generation without having to reparse the demand input file.
Definition at line 584 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().
std::string TRADEMGEN::TRADEMGEN_Service::csvDisplay | ( | ) | const |
Recursively display (dump in the returned string) the objects of the BOM tree.
Definition at line 300 of file TRADEMGEN_Service.cpp.
Referenced by generateDemand().