#include <simcrs/SIMCRS_Service.hpp>
Public Member Functions | |
SIMCRS_Service (const stdair::BasLogParams &, const stdair::BasDBParams &, const CRSCode_T &) | |
SIMCRS_Service (const stdair::BasLogParams &, const CRSCode_T &) | |
SIMCRS_Service (stdair::STDAIR_ServicePtr_T, SEVMGR::SEVMGR_ServicePtr_T, const CRSCode_T &) | |
void | parseAndLoad (const stdair::ScheduleFilePath &, const stdair::ODFilePath &, const stdair::FRAT5FilePath &, const stdair::FFDisutilityFilePath &, const AIRRAC::YieldFilePath &, const SIMFQT::FareFilePath &) |
void | initSnapshotAndRMEvents (const stdair::Date_T &iStartDate, const stdair::Date_T &iEndDate) |
~SIMCRS_Service () | |
stdair::TravelSolutionList_T | calculateSegmentPathList (const stdair::BookingRequestStruct &) |
void | fareQuote (const stdair::BookingRequestStruct &, stdair::TravelSolutionList_T &) |
void | calculateAvailability (stdair::TravelSolutionList_T &) |
bool | sell (const stdair::TravelSolutionStruct &, const stdair::PartySize_T &) |
void | takeSnapshots (const stdair::SnapshotStruct &) |
bool | playCancellation (const stdair::CancellationStruct &) |
void | optimise (const stdair::RMEventStruct &) |
bool | sell (const std::string &iSegmentDateKey, const stdair::ClassCode_T &, const stdair::PartySize_T &) |
void | buildSampleBom () |
void | clonePersistentBom () |
void | buildComplementaryLinks (stdair::BomRoot &) |
void | buildSampleTravelSolutions (stdair::TravelSolutionList_T &) |
stdair::BookingRequestStruct | buildSampleBookingRequest (const bool isForCRS=false) |
std::string | jsonHandler (const stdair::JSONString &) const |
std::string | csvDisplay () const |
std::string | csvDisplay (const stdair::TravelSolutionList_T &) const |
std::string | list (const stdair::AirlineCode_T &iAirlineCode="all", const stdair::FlightNumber_T &iFlightNumber=0) const |
std::string | csvDisplay (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const |
Interface for the SIMCRS Services.
Definition at line 42 of file SIMCRS_Service.hpp.
SIMCRS::SIMCRS_Service::SIMCRS_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::BasDBParams & | iDBParams, | ||
const CRSCode_T & | iCRSCode | ||
) |
Constructor.
The init() 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 | CRSCode_T& Code of the owner of the distribution system. |
Definition at line 81 of file SIMCRS_Service.cpp.
SIMCRS::SIMCRS_Service::SIMCRS_Service | ( | const stdair::BasLogParams & | iLogParams, |
const CRSCode_T & | iCRSCode | ||
) |
Constructor.
The init() method is called; see the corresponding documentation for more details.
Moreover, 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 | CRSCode_T& Code of the owner of the distribution system. |
Definition at line 51 of file SIMCRS_Service.cpp.
SIMCRS::SIMCRS_Service::SIMCRS_Service | ( | stdair::STDAIR_ServicePtr_T | ioSTDAIR_Service_ptr, |
SEVMGR::SEVMGR_ServicePtr_T | ioSEVMGR_Service_ptr, | ||
const CRSCode_T & | iCRSCode | ||
) |
Constructor.
The init() 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 SIMCRS_Service is itself being initialised by another library service such as TVLSIM_Service).
stdair::STDAIR_ServicePtr_T | Reference on the STDAIR service. |
SEVMGR::SEVMGR_ServicePtr_T | Reference on the SEVMGR_Service. |
const | stdair::RandomSeed_T& Seed for the random generation. |
const | CRSCode_T& Code of the owner of the distribution system. |
Definition at line 113 of file SIMCRS_Service.cpp.
SIMCRS::SIMCRS_Service::~SIMCRS_Service | ( | ) |
Destructor.
Definition at line 144 of file SIMCRS_Service.cpp.
void SIMCRS::SIMCRS_Service::parseAndLoad | ( | const stdair::ScheduleFilePath & | iScheduleInputFilepath, |
const stdair::ODFilePath & | iODInputFilepath, | ||
const stdair::FRAT5FilePath & | iFRAT5InputFilepath, | ||
const stdair::FFDisutilityFilePath & | iFFDisutilityInputFilepath, | ||
const AIRRAC::YieldFilePath & | iYieldInputFilepath, | ||
const SIMFQT::FareFilePath & | iFareInputFilepath | ||
) |
Parse the schedule, O&D, fare and yield input files.
The CSV files, describing the airline schedule, O&Ds, fares and yields for the simulator, are parsed and instantiated in memory accordingly.
const | stdair::ScheduleFilePath Filename of the input schedule file. |
const | stdair::ODFilePath Filename of the input O&D file. |
const | stdair::FRAT5FilePath& Filename of the input FRAT5 file. |
const | stdair::FFDisutilityFilePath& Filename of the input FF disutility file. |
const | AIRRAC::YieldFilePath& Filename of the input yield file. |
const | SIMFQT::FareFilePath& Filename of the input fare file. |
Definition at line 324 of file SIMCRS_Service.cpp.
References buildComplementaryLinks(), and clonePersistentBom().
Referenced by main().
void SIMCRS::SIMCRS_Service::initSnapshotAndRMEvents | ( | const stdair::Date_T & | iStartDate, |
const stdair::Date_T & | iEndDate | ||
) |
Initialise the snapshot and RM events for the inventories.
const | stdair::Date_T& Start date of the simulation. |
const | stdair::Date_T& End date of the simulation. |
Definition at line 635 of file SIMCRS_Service.cpp.
stdair::TravelSolutionList_T SIMCRS::SIMCRS_Service::calculateSegmentPathList | ( | const stdair::BookingRequestStruct & | iBookingRequest | ) |
Construct the list of travel solutions corresponding to the booking request.
Definition at line 739 of file SIMCRS_Service.cpp.
Referenced by main().
void SIMCRS::SIMCRS_Service::fareQuote | ( | const stdair::BookingRequestStruct & | iBookingRequest, |
stdair::TravelSolutionList_T & | ioTravelSolutionList | ||
) |
Calculate the fare of each travel solutions in the list.
Definition at line 775 of file SIMCRS_Service.cpp.
Referenced by main().
void SIMCRS::SIMCRS_Service::calculateAvailability | ( | stdair::TravelSolutionList_T & | ioTravelSolutionList | ) |
Compute the availability for each travel solution in the list.
Definition at line 806 of file SIMCRS_Service.cpp.
bool SIMCRS::SIMCRS_Service::sell | ( | const stdair::TravelSolutionStruct & | iTravelSolution, |
const stdair::PartySize_T & | iPartySize | ||
) |
void SIMCRS::SIMCRS_Service::takeSnapshots | ( | const stdair::SnapshotStruct & | iSnapshot | ) |
Take inventory snapshots.
Definition at line 925 of file SIMCRS_Service.cpp.
bool SIMCRS::SIMCRS_Service::playCancellation | ( | const stdair::CancellationStruct & | iCancellation | ) |
Play cancellation.
Definition at line 886 of file SIMCRS_Service.cpp.
void SIMCRS::SIMCRS_Service::optimise | ( | const stdair::RMEventStruct & | iRMEvent | ) |
Optimise (revenue management) an flight-date/network-date
Definition at line 944 of file SIMCRS_Service.cpp.
bool SIMCRS::SIMCRS_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 593 of file SIMCRS_Service.cpp.
void SIMCRS::SIMCRS_Service::buildSampleBom | ( | ) |
Build a sample BOM tree, and attach it to the BomRoot instance.
As for now, the BOM sample tree is the one built by the AirInv component.
Definition at line 402 of file SIMCRS_Service.cpp.
References buildComplementaryLinks(), and clonePersistentBom().
Referenced by main().
void SIMCRS::SIMCRS_Service::clonePersistentBom | ( | ) |
Clone the persistent BOM object.
Definition at line 481 of file SIMCRS_Service.cpp.
References buildComplementaryLinks().
Referenced by buildSampleBom(), and parseAndLoad().
void SIMCRS::SIMCRS_Service::buildComplementaryLinks | ( | stdair::BomRoot & | ioBomRoot | ) |
Build all the complementary links in the given bom root object.
Definition at line 548 of file SIMCRS_Service.cpp.
Referenced by buildSampleBom(), clonePersistentBom(), and parseAndLoad().
void SIMCRS::SIMCRS_Service::buildSampleTravelSolutions | ( | stdair::TravelSolutionList_T & | ioTravelSolutionList | ) |
Build a sample list of travel solutions.
As of now (March 2011), that list is made of the following travel solutions:
TravelSolutionList_T& | Sample list of travel solution structures. It should be given empty. It is altered with the returned sample. |
Definition at line 554 of file SIMCRS_Service.cpp.
stdair::BookingRequestStruct SIMCRS::SIMCRS_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 574 of file SIMCRS_Service.cpp.
Referenced by main().
std::string SIMCRS::SIMCRS_Service::jsonHandler | ( | const stdair::JSONString & | iJSONString | ) | const |
Dispatch the JSon command string to the AirInv service. (Only AirInv has json export commands for now).
const | stdair::JSONString& Input string which contained the JSon command string. |
Definition at line 615 of file SIMCRS_Service.cpp.
std::string SIMCRS::SIMCRS_Service::csvDisplay | ( | ) | const |
Recursively display (dump in the returned string) the objects of the BOM tree.
Definition at line 654 of file SIMCRS_Service.cpp.
Referenced by main().
std::string SIMCRS::SIMCRS_Service::csvDisplay | ( | const stdair::TravelSolutionList_T & | ioTravelSolutionList | ) | const |
Display (dump in the returned string) the full list of travel solution structures.
Definition at line 675 of file SIMCRS_Service.cpp.
std::string SIMCRS::SIMCRS_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 695 of file SIMCRS_Service.cpp.
std::string SIMCRS::SIMCRS_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 716 of file SIMCRS_Service.cpp.