SimCRS Logo  1.00.0
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>

List of all members.

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

Detailed Description

Interface for the SIMCRS Services.

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

Parameters:
conststdair::BasLogParams& Parameters for the output log stream.
constCRSCode_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).

Parameters:
stdair::STDAIR_ServicePtr_TReference on the STDAIR service.
SEVMGR::SEVMGR_ServicePtr_TReference on the SEVMGR_Service.
conststdair::RandomSeed_T& Seed for the random generation.
constCRSCode_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.


Member Function Documentation

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.

Parameters:
conststdair::ScheduleFilePath Filename of the input schedule file.
conststdair::ODFilePath Filename of the input O&D file.
conststdair::FRAT5FilePath& Filename of the input FRAT5 file.
conststdair::FFDisutilityFilePath& Filename of the input FF disutility file.
constAIRRAC::YieldFilePath& Filename of the input yield file.
constSIMFQT::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.

Parameters:
conststdair::Date_T& Start date of the simulation.
conststdair::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 
)

Register a booking.

Definition at line 839 of file SIMCRS_Service.cpp.

Referenced by main().

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.

Parameters:
conststd::string& Key for the segment on which the sale is made
conststdair::ClassCode_T& Class code where the sale is made
conststdair::PartySize_T& Party size
Returns:
bool Whether or not the sale was successfull

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.

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

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.

Note:
Do nothing for now.

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:

  • 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 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:

  • 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 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).

Parameters:
conststdair::JSONString& Input string which contained the JSon command string.
Returns:
std::string Output string in which the asking objects are logged/dumped with a JSon format.

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.

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

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.

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

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.

Parameters:
constAirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (the default), all the inventories will be displayed.
constFlightNumber_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.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

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.

Parameters:
conststdair::AirlineCode_T& Airline code of the flight to display
conststdair::FlightNumber_T& Flight number of the flight to display.
conststdair::Date_T& Departure date of the flight to display.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 716 of file SIMCRS_Service.cpp.


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