Interface for the AIRINV Services. More...
#include <airinv/AIRINV_Master_Service.hpp>
Public Member Functions | |
AIRINV_Master_Service (const stdair::BasLogParams &, const stdair::BasDBParams &) | |
AIRINV_Master_Service (const stdair::BasLogParams &) | |
AIRINV_Master_Service (stdair::STDAIR_ServicePtr_T) | |
void | parseAndLoad (const stdair::Filename_T &iInventoryFilename) |
void | parseAndLoad (const stdair::Filename_T &iScheduleFilename, const stdair::Filename_T &iODInputFilename, const AIRRAC::YieldFilePath &iYieldFilename) |
~AIRINV_Master_Service () | |
void | initSnapshotAndRMEvents (const stdair::Date_T &, const stdair::Date_T &) |
void | buildSampleBom () |
void | calculateAvailability (stdair::TravelSolutionStruct &, const stdair::PartnershipTechnique &) |
bool | sell (const std::string &iSegmentDateKey, const stdair::ClassCode_T &, const stdair::PartySize_T &) |
bool | cancel (const std::string &iSegmentDateKey, const stdair::ClassCode_T &, const stdair::PartySize_T &) |
void | takeSnapshots (const stdair::SnapshotStruct &) |
void | optimise (const stdair::RMEventStruct &, const stdair::ForecastingMethod &, const stdair::PartnershipTechnique &) |
std::string | jsonExport (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const |
std::string | list (const stdair::AirlineCode_T &iAirlineCode="all", const stdair::FlightNumber_T &iFlightNumber=0) const |
bool | check (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const |
std::string | csvDisplay () const |
std::string | csvDisplay (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const |
Interface for the AIRINV Services.
AIRINV::AIRINV_Master_Service::AIRINV_Master_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::BasDBParams & | iDBParams | ||
) |
Constructor.
The initSlaveAirinvService() 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. |
Definition at line 44 of file AIRINV_Master_Service.cpp.
AIRINV::AIRINV_Master_Service::AIRINV_Master_Service | ( | const stdair::BasLogParams & | iLogParams | ) |
Constructor.
The initSlaveAirinvService() 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. |
Definition at line 66 of file AIRINV_Master_Service.cpp.
AIRINV::AIRINV_Master_Service::AIRINV_Master_Service | ( | stdair::STDAIR_ServicePtr_T | ioSTDAIR_Service_ptr | ) |
Constructor.
The initSlaveAirinvService() method is called; see the corresponding documentation for more details.
Moreover, as no reference on any output stream 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 AIRINV_Master_Service is itself being initialised by another library service such as SIMCRS_Service).
stdair::STDAIR_ServicePtr_T | Reference on the STDAIR service. |
Definition at line 87 of file AIRINV_Master_Service.cpp.
AIRINV::AIRINV_Master_Service::~AIRINV_Master_Service | ( | ) |
Destructor.
Definition at line 103 of file AIRINV_Master_Service.cpp.
void AIRINV::AIRINV_Master_Service::parseAndLoad | ( | const stdair::Filename_T & | iInventoryFilename | ) |
Parse the inventory dump and load it into memory.
The CSV file, describing the airline inventory for the simulator, is parsed and instantiated in memory accordingly.
const | stdair::Filename_T& Filename of the input demand file. |
Definition at line 204 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::parseAndLoad().
void AIRINV::AIRINV_Master_Service::parseAndLoad | ( | const stdair::Filename_T & | iScheduleFilename, |
const stdair::Filename_T & | iODInputFilename, | ||
const AIRRAC::YieldFilePath & | iYieldFilename | ||
) |
Parse the schedule and O&D input files, and load them into memory.
The CSV files, describing the airline schedule and the O&Ds for the simulator, are parsed and instantiated in memory accordingly.
const | stdair::Filename_T& Filename of the input schedule file. |
const | stdair::Filename_T& Filename of the input O&D file. |
const | AIRRAC::YieldFilePath& Filename of the input yield file. |
Definition at line 227 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::parseAndLoad().
void AIRINV::AIRINV_Master_Service::initSnapshotAndRMEvents | ( | const stdair::Date_T & | iStartDate, |
const stdair::Date_T & | iEndDate | ||
) |
Initialise the snapshot and RM events for the inventories.
const | stdiar::Date_T& Parameters for the start date. |
const | stdiar::Date_T& Parameters for the end date. |
Definition at line 429 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::initRMEvents().
void AIRINV::AIRINV_Master_Service::buildSampleBom | ( | ) |
Build a sample BOM tree, and attach it to the BomRoot instance.
The BOM tree is based on two actual inventories (one for BA, another for AF). Each inventory contains one flight. One of those flights has two legs (and therefore three segments).
Definition at line 252 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::buildSampleBom().
void AIRINV::AIRINV_Master_Service::calculateAvailability | ( | stdair::TravelSolutionStruct & | ioTravelSolution, |
const stdair::PartnershipTechnique & | iPartnershipTechnique | ||
) |
Compute the availability for the given travel solution.
Definition at line 468 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::calculateAvailability().
bool AIRINV::AIRINV_Master_Service::sell | ( | const std::string & | iSegmentDateKey, |
const stdair::ClassCode_T & | iClassCode, | ||
const stdair::PartySize_T & | iPartySize | ||
) |
Register a booking.
const | std::string& Key for the segment on which the sale is made. |
const | stdair::ClassCode_T& Class code where the sale is made. |
const | stdair::PartySize_T& Party size. |
Definition at line 499 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::sell().
bool AIRINV::AIRINV_Master_Service::cancel | ( | const std::string & | iSegmentDateKey, |
const stdair::ClassCode_T & | iClassCode, | ||
const stdair::PartySize_T & | iPartySize | ||
) |
Register a cancellation.
const | std::string& Key for the segment on which the cancellation is made. |
const | stdair::ClassCode_T& Class code where the sale is made. |
const | stdair::PartySize_T& Party size. |
Definition at line 541 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::cancel().
void AIRINV::AIRINV_Master_Service::takeSnapshots | ( | const stdair::SnapshotStruct & | iSnapshot | ) |
Take inventory snapshots.
Definition at line 584 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::takeSnapshots().
void AIRINV::AIRINV_Master_Service::optimise | ( | const stdair::RMEventStruct & | iRMEvent, |
const stdair::ForecastingMethod & | iForecastingMethod, | ||
const stdair::PartnershipTechnique & | iPartnershipTechnique | ||
) |
Optimise (revenue management) an flight-date/network-date
Definition at line 610 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::optimise().
std::string AIRINV::AIRINV_Master_Service::jsonExport | ( | const stdair::AirlineCode_T & | iAirlineCode, |
const stdair::FlightNumber_T & | iFlightNumber, | ||
const stdair::Date_T & | iDepartureDate | ||
) | const |
Recursively dump, in the returned string and in JSON format, the flight-date corresponding to the parameters given as input.
const | stdair::AirlineCode_T& Airline code of the flight to dump. |
const | stdair::FlightNumber_T& Flight number of the flight to dump. |
const | stdair::Date_T& Departure date of the flight to dump. |
Definition at line 304 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::jsonExport().
std::string AIRINV::AIRINV_Master_Service::list | ( | const stdair::AirlineCode_T & | iAirlineCode = "all" , |
const stdair::FlightNumber_T & | iFlightNumber = 0 |
||
) | const |
Display the list of flight-dates (contained within the BOM tree) corresponding to the parameters given as input.
const | AirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (the default), all the inventories will be displayed. |
const | FlightNumber_T& Flight number for which all the departure dates should be displayed. If set to 0 (the default), all the flight numbers will be displayed. |
Definition at line 330 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::list().
bool AIRINV::AIRINV_Master_Service::check | ( | const stdair::AirlineCode_T & | iAirlineCode, |
const stdair::FlightNumber_T & | iFlightNumber, | ||
const stdair::Date_T & | iDepartureDate | ||
) | const |
Check whether the given flight-date is a valid one.
const | stdair::AirlineCode_T& Airline code of the flight to check. |
const | stdair::FlightNumber_T& Flight number of the flight to check. |
const | stdair::Date_T& Departure date of the flight to check. |
Definition at line 355 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::check().
std::string AIRINV::AIRINV_Master_Service::csvDisplay | ( | ) | const |
Recursively display (dump in the returned string) the objects of the BOM tree.
Definition at line 380 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::csvDisplay().
std::string AIRINV::AIRINV_Master_Service::csvDisplay | ( | const stdair::AirlineCode_T & | iAirlineCode, |
const stdair::FlightNumber_T & | iFlightNumber, | ||
const stdair::Date_T & | iDepartureDate | ||
) | const |
Recursively display (dump in the returned string) the flight-date corresponding to the parameters given as input.
const | stdair::AirlineCode_T& Airline code of the flight to display. |
const | stdair::FlightNumber_T& Flight number of the flight to display. |
const | stdair::Date_T& Departure date of the flight to display. |
Definition at line 403 of file AIRINV_Master_Service.cpp.
References AIRINV::AIRINV_Service::csvDisplay().