SimCRS Logo  0.1.1
C++ Simulated Travel-Oriented Distribution System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SIMCRS::SIMCRS_Service Class Reference

#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, const CRSCode_T &)
void parseAndLoad (const stdair::Filename_T &iScheduleInputFilename, const stdair::Filename_T &iODInputFilename, const AIRRAC::YieldFilePath &iYieldInputFilepath, const SIMFQT::FareFilePath &iFareInputFilepath)
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 &, const stdair::PartnershipTechnique &)
bool sell (const stdair::TravelSolutionStruct &, const stdair::PartySize_T &)
void takeSnapshots (const stdair::SnapshotStruct &)
bool playCancellation (const stdair::CancellationStruct &)
void optimise (const stdair::RMEventStruct &, const stdair::ForecastingMethod &, const stdair::PartnershipTechnique &)
void buildSampleBom ()
void buildSampleTravelSolutions (stdair::TravelSolutionList_T &)
stdair::BookingRequestStruct buildSampleBookingRequest (const bool isForCRS=false)
std::string jsonExport (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const
std::string csvDisplay () const
std::string csvDisplay (const stdair::TravelSolutionList_T &) const

Detailed Description

Interface for the SIMCRS Services.

Definition at line 39 of file SIMCRS_Service.hpp.

Constructor & Destructor Documentation

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.

Parameters
conststdair::BasLogParams& Parameters for the output log stream.
conststdair::BasDBParams& Parameters for the database access.
constCRSCode_T& Code of the owner of the distribution system.

Definition at line 78 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.

Parameters
conststdair::BasLogParams& Parameters for the output log stream.
constCRSCode_T& Code of the owner of the distribution system.

Definition at line 48 of file SIMCRS_Service.cpp.

SIMCRS::SIMCRS_Service::SIMCRS_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIR_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 DSIM_Service).

Parameters
stdair::STDAIR_ServicePtr_TReference on the STDAIR service.
constCRSCode_T& Code of the owner of the distribution system.

Definition at line 110 of file SIMCRS_Service.cpp.

SIMCRS::SIMCRS_Service::~SIMCRS_Service ( )

Destructor.

Definition at line 136 of file SIMCRS_Service.cpp.

Member Function Documentation

void SIMCRS::SIMCRS_Service::parseAndLoad ( const stdair::Filename_T &  iScheduleInputFilename,
const stdair::Filename_T &  iODInputFilename,
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.

Parameters
conststdair::Filename_T& Filename of the input schedule file.
conststdair::Filename_T& Filename of the input O&D file.
constAIRRAC::YieldFilePath& Filename of the input yield file.
constSIMFQT::FareFilePath& Filename of the input fare file.

Definition at line 288 of file SIMCRS_Service.cpp.

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.

Parameters
conststdair::Date_T& Start date of the simulation.
conststdair::Date_T& End date of the simulation.

Definition at line 457 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 516 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 552 of file SIMCRS_Service.cpp.

Referenced by main().

void SIMCRS::SIMCRS_Service::calculateAvailability ( stdair::TravelSolutionList_T &  ioTravelSolutionList,
const stdair::PartnershipTechnique &  iPartnershipTechnique 
)

Compute the availability for each travel solution in the list.

Definition at line 583 of file SIMCRS_Service.cpp.

bool SIMCRS::SIMCRS_Service::sell ( const stdair::TravelSolutionStruct &  iTravelSolution,
const stdair::PartySize_T &  iPartySize 
)

Register a booking.

Definition at line 618 of file SIMCRS_Service.cpp.

Referenced by main().

void SIMCRS::SIMCRS_Service::takeSnapshots ( const stdair::SnapshotStruct &  iSnapshot)

Take inventory snapshots.

Definition at line 704 of file SIMCRS_Service.cpp.

bool SIMCRS::SIMCRS_Service::playCancellation ( const stdair::CancellationStruct &  iCancellation)

Play cancellation.

Definition at line 665 of file SIMCRS_Service.cpp.

void SIMCRS::SIMCRS_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 723 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.

See Also
AIRINV::AIRINV_Master_Service and stdair::CmdBomManager for more details.

Definition at line 326 of file SIMCRS_Service.cpp.

Referenced by main().

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:

  • BA9
  • LHR-SYD
  • 2011-06-10
  • Q
  • WTP: 900
  • Change fee: 20; Non refundable; Saturday night stay
See Also
stdair::CmdBomManager for more details.
Parameters
TravelSolutionList_T&Sample list of travel solution structures. It should be given empty. It is altered with the returned sample.

Definition at line 394 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:

  • Return trip (inbound): LHR-SYD (POS: LHR, Channel: DN),
  • Departing 10-JUN-2011 around 8:00, staying 7 days
  • Requested on 15-MAY-2011 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour

As of now (March 2011), the CRS-related booking request is made of the following parameters:

  • Return trip (inbound): SIN-BKK (POS: SIN, Channel: IN),
  • Departing 30-JAN-2010 around 10:00, staying 7 days
  • Requested on 22-JAN-2010 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour
See Also
stdair::CmdBomManager for more details.
Parameters
constbool isForCRS Whether the sample booking request is for CRS.
Returns
BookingRequestStruct& Sample booking request structure.

Definition at line 414 of file SIMCRS_Service.cpp.

Referenced by main().

std::string SIMCRS::SIMCRS_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.

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 the flight to dump.
Returns
std::string Output string in which the BOM tree is JSON-ified.

Definition at line 434 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.

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

Definition at line 476 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.

Returns
std::string Output string in which the list of travel solutions is logged/dumped.

Definition at line 496 of file SIMCRS_Service.cpp.


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