RMOL Logo  1.00.3
C++ library of Revenue Management and Optimisation classes and functions
RMOL::RMOL_Service Class Reference

Interface for the RMOL Services. More...

#include <rmol/RMOL_Service.hpp>

Public Member Functions

 RMOL_Service (const stdair::BasLogParams &, const stdair::BasDBParams &)
 
 RMOL_Service (const stdair::BasLogParams &)
 
 RMOL_Service (stdair::STDAIR_ServicePtr_T)
 
void parseAndLoad (const stdair::CabinCapacity_T &iCabinCapacity, const stdair::Filename_T &iDemandAndClassDataFile)
 
void setUpStudyStatManager ()
 
 ~RMOL_Service ()
 
void buildSampleBom ()
 
void clonePersistentBom ()
 
void buildComplementaryLinks (stdair::BomRoot &)
 
template<unsigned int I>
void optimize (const stdair::NbOfSamples_T iDraws=0)
 
const stdair::SegmentCabin & retrieveDummySegmentCabin (const bool isForFareFamilies=false)
 
bool optimise (stdair::FlightDate &, const stdair::DateTime_T &, const stdair::UnconstrainingMethod &, const stdair::ForecastingMethod &, const stdair::PreOptimisationMethod &, const stdair::OptimisationMethod &, const stdair::PartnershipTechnique &)
 
void forecastOnD (const stdair::DateTime_T &iRMEventTime)
 
stdair::YieldFeatures * getYieldFeatures (const stdair::OnDDate &, const stdair::CabinCode_T &, stdair::BomRoot &)
 
void forecastOnD (const stdair::YieldFeatures &, stdair::OnDDate &, const stdair::CabinCode_T &, const stdair::DTD_T &, stdair::BomRoot &)
 
void setOnDForecast (const stdair::AirlineClassList &, const stdair::MeanValue_T &, const stdair::StdDevValue_T &, stdair::OnDDate &, const stdair::CabinCode_T &, stdair::BomRoot &)
 
void setOnDForecast (const stdair::AirlineCode_T &, const stdair::Date_T &iDepartureDate, const stdair::AirportCode_T &iOrigin, const stdair::AirportCode_T &iDestination, const stdair::CabinCode_T &, const stdair::ClassCode_T &, const stdair::MeanValue_T &, const stdair::StdDevValue_T &, const stdair::Yield_T &, stdair::BomRoot &)
 
void setOnDForecast (const stdair::AirlineCodeList_T &, const stdair::AirlineCode_T &, const stdair::Date_T &, const stdair::AirportCode_T &, const stdair::AirportCode_T &, const stdair::CabinCode_T &, const stdair::ClassCodeList_T &, const stdair::MeanValue_T &, const stdair::StdDevValue_T &, const stdair::Yield_T &, stdair::BomRoot &)
 
void resetDemandInformation (const stdair::DateTime_T &)
 
void resetDemandInformation (const stdair::DateTime_T &, const stdair::Inventory &)
 
void projectAggregatedDemandOnLegCabins (const stdair::DateTime_T &)
 
void projectOnDDemandOnLegCabinsUsingYP (const stdair::DateTime_T &)
 
void projectOnDDemandOnLegCabinsUsingDA (const stdair::DateTime_T &)
 
void projectOnDDemandOnLegCabinsUsingDYP (const stdair::DateTime_T &)
 
void projectOnDDemandOnLegCabinsUsingDYP (const stdair::DateTime_T &, const stdair::Inventory &)
 
void optimiseOnD (const stdair::DateTime_T &)
 
void optimiseOnDUsingRMCooperation (const stdair::DateTime_T &)
 
void optimiseOnDUsingAdvancedRMCooperation (const stdair::DateTime_T &)
 
void updateBidPrice (const stdair::DateTime_T &)
 
void updateBidPrice (const stdair::FlightDate &, stdair::BomRoot &)
 
std::string jsonExport (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const
 
std::string csvDisplay () const
 

Detailed Description

Interface for the RMOL Services.

Definition at line 44 of file RMOL_Service.hpp.

Constructor & Destructor Documentation

◆ RMOL_Service() [1/3]

RMOL::RMOL_Service::RMOL_Service ( const stdair::BasLogParams &  iLogParams,
const stdair::BasDBParams &  iDBParams 
)

Constructor.

The initRmolService() 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.

Parameters
conststdair::BasLogParams& Parameters for the output log stream.
conststdair::BasDBParams& Parameters for the database access.

Definition at line 85 of file RMOL_Service.cpp.

◆ RMOL_Service() [2/3]

RMOL::RMOL_Service::RMOL_Service ( const stdair::BasLogParams &  iLogParams)

Constructor.

The initRmolService() 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.

Parameters
conststdair::BasLogParams& Parameters for the output log stream.

Definition at line 64 of file RMOL_Service.cpp.

◆ RMOL_Service() [3/3]

RMOL::RMOL_Service::RMOL_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIRServicePtr)

Constructor.

The initRmolService() 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 RMOL_Service is itself being initialised by another library service such as AIRINV_Service).

Parameters
STDAIR_ServicePtr_Tthe shared pointer of stdair service.

Definition at line 107 of file RMOL_Service.cpp.

◆ ~RMOL_Service()

RMOL::RMOL_Service::~RMOL_Service ( )

Destructor.

Definition at line 124 of file RMOL_Service.cpp.

Member Function Documentation

◆ parseAndLoad()

void RMOL::RMOL_Service::parseAndLoad ( const stdair::CabinCapacity_T &  iCabinCapacity,
const stdair::Filename_T &  iDemandAndClassDataFile 
)

Parse the optimisation-related data and load them into memory.

First, the STDAIR_Service::buildDummyInventory() method is called, for RMOL and with the given cabin capacity, in order to build the miminum required flight-date structure in order to perform an optimisation on a leg-cabin.

The CSV input file describes the problem to be optimised, i.e.:

  • the demand specifications for all the booking classes (mean and standard deviations for the demand distribution); the yields corresponding to those booking classes.

That CSV file is parsed and instantiated in memory accordingly. The leg-cabin capacity has been set at the initialisation of the (RMOL) service.

Parameters
conststdair::CabinCapacity& Capacity of the leg-cabin to be optimised.
conststdair::Filename_T& (CSV) input file.

Definition at line 201 of file RMOL_Service.cpp.

References buildComplementaryLinks(), clonePersistentBom(), and RMOL::InventoryParser::parseInputFileAndBuildBom().

Referenced by RMOL::RMOLer::init(), and main().

◆ setUpStudyStatManager()

void RMOL::RMOL_Service::setUpStudyStatManager ( )

Set up the StudyStatManager.

◆ buildSampleBom()

void RMOL::RMOL_Service::buildSampleBom ( )

Build a sample BOM tree, and attach it to the BomRoot instance.

See also
stdair::CmdBomManager::buildSampleBom() for more details.

Definition at line 260 of file RMOL_Service.cpp.

References buildComplementaryLinks(), and clonePersistentBom().

Referenced by RMOL::RMOLer::init(), and main().

◆ clonePersistentBom()

void RMOL::RMOL_Service::clonePersistentBom ( )

Clone the persistent BOM object.

Definition at line 319 of file RMOL_Service.cpp.

References buildComplementaryLinks().

Referenced by buildSampleBom(), and parseAndLoad().

◆ buildComplementaryLinks()

void RMOL::RMOL_Service::buildComplementaryLinks ( stdair::BomRoot &  ioBomRoot)

Build all the complementary links in the given bom root object. Build the links between dummy leg cabin and dummy segment cabin.

Definition at line 357 of file RMOL_Service.cpp.

Referenced by buildSampleBom(), clonePersistentBom(), and parseAndLoad().

◆ optimize()

template<unsigned int I>
void RMOL::RMOL_Service::optimize ( const stdair::NbOfSamples_T  iDraws = 0)

Optimization.

Referenced by optimise(), and RMOL::RMOLer::rmol().

◆ retrieveDummySegmentCabin()

const stdair::SegmentCabin & RMOL::RMOL_Service::retrieveDummySegmentCabin ( const bool  isForFareFamilies = false)

Retrieve one sample segment-cabin of the dummy inventory of "XX".

Parameters
constbool Boolean to choose the sample segment-cabin. True: the dummy segment-cabin with fare families. False: the dummy segment-cabin without fare families. By default the value is false.

Definition at line 608 of file RMOL_Service.cpp.

◆ optimise()

bool RMOL::RMOL_Service::optimise ( stdair::FlightDate &  ioFlightDate,
const stdair::DateTime_T &  iRMEventTime,
const stdair::UnconstrainingMethod &  iUnconstrainingMethod,
const stdair::ForecastingMethod &  iForecastingMethod,
const stdair::PreOptimisationMethod &  iPreOptimisationMethod,
const stdair::OptimisationMethod &  iOptimisationMethod,
const stdair::PartnershipTechnique &  iPartnershipTechnique 
)

◆ forecastOnD() [1/2]

void RMOL::RMOL_Service::forecastOnD ( const stdair::DateTime_T &  iRMEventTime)

Forecaster O&D based forecast

Definition at line 731 of file RMOL_Service.cpp.

References getYieldFeatures().

Referenced by optimise().

◆ getYieldFeatures()

stdair::YieldFeatures * RMOL::RMOL_Service::getYieldFeatures ( const stdair::OnDDate &  iOnDDate,
const stdair::CabinCode_T &  iCabinCode,
stdair::BomRoot &  iBomRoot 
)

Get yields

Definition at line 806 of file RMOL_Service.cpp.

Referenced by forecastOnD().

◆ forecastOnD() [2/2]

void RMOL::RMOL_Service::forecastOnD ( const stdair::YieldFeatures &  iYieldFeatures,
stdair::OnDDate &  iOnDDate,
const stdair::CabinCode_T &  iCabinCode,
const stdair::DTD_T &  iDTD,
stdair::BomRoot &  iBomRoot 
)

O&D forecast

Definition at line 879 of file RMOL_Service.cpp.

References setOnDForecast().

◆ setOnDForecast() [1/3]

void RMOL::RMOL_Service::setOnDForecast ( const stdair::AirlineClassList &  iAirlineClassList,
const stdair::MeanValue_T &  iMeanValue,
const stdair::StdDevValue_T &  iStdDevValue,
stdair::OnDDate &  iOnDDate,
const stdair::CabinCode_T &  iCabinCode,
stdair::BomRoot &  iBomRoot 
)

Prepare the BOM for the O&D forecast

Definition at line 994 of file RMOL_Service.cpp.

Referenced by forecastOnD().

◆ setOnDForecast() [2/3]

void RMOL::RMOL_Service::setOnDForecast ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::Date_T &  iDepartureDate,
const stdair::AirportCode_T &  iOrigin,
const stdair::AirportCode_T &  iDestination,
const stdair::CabinCode_T &  iCabinCode,
const stdair::ClassCode_T &  iClassCode,
const stdair::MeanValue_T &  iMeanValue,
const stdair::StdDevValue_T &  iStdDevValue,
const stdair::Yield_T &  iYield,
stdair::BomRoot &  iBomRoot 
)

Prepare the BOM for the simple segement O&D forecast

Definition at line 1053 of file RMOL_Service.cpp.

◆ setOnDForecast() [3/3]

void RMOL::RMOL_Service::setOnDForecast ( const stdair::AirlineCodeList_T &  iAirlineCodeList,
const stdair::AirlineCode_T &  iAirlineCode,
const stdair::Date_T &  iDepartureDate,
const stdair::AirportCode_T &  iOrigin,
const stdair::AirportCode_T &  iDestination,
const stdair::CabinCode_T &  iCabinCode,
const stdair::ClassCodeList_T &  iClassCodeList,
const stdair::MeanValue_T &  iMeanValue,
const stdair::StdDevValue_T &  iStdDevValue,
const stdair::Yield_T &  iYield,
stdair::BomRoot &  iBomRoot 
)

Prepare the BOM for the multiple segement O&D forecast

Definition at line 1117 of file RMOL_Service.cpp.

◆ resetDemandInformation() [1/2]

void RMOL::RMOL_Service::resetDemandInformation ( const stdair::DateTime_T &  iRMEventTime)

Initialise (or re-initialise) the demand projections in all leg-cabins

Definition at line 1234 of file RMOL_Service.cpp.

Referenced by optimise(), optimiseOnDUsingAdvancedRMCooperation(), and optimiseOnDUsingRMCooperation().

◆ resetDemandInformation() [2/2]

void RMOL::RMOL_Service::resetDemandInformation ( const stdair::DateTime_T &  iRMEventTime,
const stdair::Inventory &  iInventory 
)

Initialise (or re-initialise) the demand projections in all leg-cabins

Definition at line 1260 of file RMOL_Service.cpp.

◆ projectAggregatedDemandOnLegCabins()

void RMOL::RMOL_Service::projectAggregatedDemandOnLegCabins ( const stdair::DateTime_T &  iRMEventTime)

Projection of demand Aggregated demand at booking class level.

Definition at line 1310 of file RMOL_Service.cpp.

Referenced by optimise().

◆ projectOnDDemandOnLegCabinsUsingYP()

void RMOL::RMOL_Service::projectOnDDemandOnLegCabinsUsingYP ( const stdair::DateTime_T &  iRMEventTime)

Static rule prorated yield

Definition at line 1415 of file RMOL_Service.cpp.

Referenced by optimise().

◆ projectOnDDemandOnLegCabinsUsingDA()

void RMOL::RMOL_Service::projectOnDDemandOnLegCabinsUsingDA ( const stdair::DateTime_T &  iRMEventTime)

Displacement-adjusted yield

Definition at line 1692 of file RMOL_Service.cpp.

◆ projectOnDDemandOnLegCabinsUsingDYP() [1/2]

void RMOL::RMOL_Service::projectOnDDemandOnLegCabinsUsingDYP ( const stdair::DateTime_T &  iRMEventTime)

Dynamic yield proration: PF = BP_i/BP_{total}, where BP_{total} = sum(BP_i)

Definition at line 1848 of file RMOL_Service.cpp.

Referenced by optimise(), optimiseOnDUsingAdvancedRMCooperation(), and optimiseOnDUsingRMCooperation().

◆ projectOnDDemandOnLegCabinsUsingDYP() [2/2]

void RMOL::RMOL_Service::projectOnDDemandOnLegCabinsUsingDYP ( const stdair::DateTime_T &  iRMEventTime,
const stdair::Inventory &  iInventory 
)

Definition at line 1874 of file RMOL_Service.cpp.

◆ optimiseOnD()

void RMOL::RMOL_Service::optimiseOnD ( const stdair::DateTime_T &  iRMEventTime)

Optimiser

O&D-based optimisation (using demand aggregation or demand aggregation).

Definition at line 1514 of file RMOL_Service.cpp.

References RMOL::Optimiser::optimiseUsingOnDForecast().

Referenced by optimise().

◆ optimiseOnDUsingRMCooperation()

void RMOL::RMOL_Service::optimiseOnDUsingRMCooperation ( const stdair::DateTime_T &  iRMEventTime)

O&D-based optimisation using displacement-adjusted yield.

Definition at line 1990 of file RMOL_Service.cpp.

References RMOL::Optimiser::optimiseUsingOnDForecast(), projectOnDDemandOnLegCabinsUsingDYP(), and resetDemandInformation().

Referenced by optimise().

◆ optimiseOnDUsingAdvancedRMCooperation()

void RMOL::RMOL_Service::optimiseOnDUsingAdvancedRMCooperation ( const stdair::DateTime_T &  iRMEventTime)

Advanced version of O&D-based optimisation using displacement-adjusted yield. Network optimisation instead of separate inventory optimisation.

Definition at line 2050 of file RMOL_Service.cpp.

References RMOL::Optimiser::optimiseUsingOnDForecast(), projectOnDDemandOnLegCabinsUsingDYP(), resetDemandInformation(), and updateBidPrice().

Referenced by optimise().

◆ updateBidPrice() [1/2]

void RMOL::RMOL_Service::updateBidPrice ( const stdair::DateTime_T &  iRMEventTime)

Update Bid Price (BP) and send to partners

Definition at line 1563 of file RMOL_Service.cpp.

Referenced by optimise(), and optimiseOnDUsingAdvancedRMCooperation().

◆ updateBidPrice() [2/2]

void RMOL::RMOL_Service::updateBidPrice ( const stdair::FlightDate &  iFlightDate,
stdair::BomRoot &  iBomRoot 
)

Definition at line 1611 of file RMOL_Service.cpp.

◆ jsonExport()

std::string RMOL::RMOL_Service::jsonExport ( const stdair::AirlineCode_T &  ,
const stdair::FlightNumber_T &  ,
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.

Parameters
conststdair::AirlineCode_T& Airline code of the flight to dump.
conststdair::FlightNumber_T& Flight number of the flight to dump.
conststdair::Date_T& Departure date of a flight to dump.
Returns
std::string Output string in which the BOM tree is JSON-ified.

◆ csvDisplay()

std::string RMOL::RMOL_Service::csvDisplay ( ) const

Recursively display (dump in the returned string) the objects of the BOM tree.

Returns
std::string Output string in which the BOM tree is logged/dumped.

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