$treeview $search $mathjax
SimCRS Logo  1.01.1
$projectbrief
$projectbrief
$searchbox

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 &  ,
const stdair::BasDBParams &  ,
const CRSCode_T  
)

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:
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 &  ,
const CRSCode_T  
)

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:
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  ,
SEVMGR::SEVMGR_ServicePtr_T  ,
const CRSCode_T  
)

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_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.


Member Function Documentation

void SIMCRS::SIMCRS_Service::parseAndLoad ( const stdair::ScheduleFilePath &  ,
const stdair::ODFilePath &  ,
const stdair::FRAT5FilePath &  ,
const stdair::FFDisutilityFilePath &  ,
const AIRRAC::YieldFilePath &  ,
const SIMFQT::FareFilePath &   
)

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:
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(), clonePersistentBom(), SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service(), SIMCRS::SIMCRS_ServiceContext::getAIRTSP_Service(), SIMCRS::SIMCRS_ServiceContext::getOwnStdairServiceFlag(), SIMCRS::SIMCRS_ServiceContext::getSIMFQT_Service(), and SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

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

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

stdair::TravelSolutionList_T SIMCRS::SIMCRS_Service::calculateSegmentPathList ( const stdair::BookingRequestStruct &   ) 

Construct the list of travel solutions corresponding to the booking request.

Definition at line 739 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::display(), and SIMCRS::SIMCRS_ServiceContext::getAIRTSP_Service().

Referenced by main().

void SIMCRS::SIMCRS_Service::fareQuote ( const stdair::BookingRequestStruct &  ,
stdair::TravelSolutionList_T &   
)

Calculate the fare of each travel solutions in the list.

Definition at line 775 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::display(), and SIMCRS::SIMCRS_ServiceContext::getSIMFQT_Service().

Referenced by main().

void SIMCRS::SIMCRS_Service::calculateAvailability ( stdair::TravelSolutionList_T &   ) 

Compute the availability for each travel solution in the list.

Definition at line 806 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::display(), and SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

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

Register a booking.

Definition at line 839 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::display(), and SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

Referenced by main().

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

Take inventory snapshots.

Definition at line 925 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

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

void SIMCRS::SIMCRS_Service::optimise ( const stdair::RMEventStruct &   ) 

Optimise (revenue management) an flight-date/network-date

Definition at line 944 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

bool SIMCRS::SIMCRS_Service::sell ( const std::string &  iSegmentDateKey,
const stdair::ClassCode_T &  ,
const stdair::PartySize_T &   
)

Register a booking.

Parameters:
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
Returns:
bool Whether or not the sale was successfull

Definition at line 593 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

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(), clonePersistentBom(), SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service(), SIMCRS::SIMCRS_ServiceContext::getAIRTSP_Service(), SIMCRS::SIMCRS_ServiceContext::getOwnStdairServiceFlag(), SIMCRS::SIMCRS_ServiceContext::getSIMFQT_Service(), and SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

Referenced by main().

void SIMCRS::SIMCRS_Service::clonePersistentBom (  ) 

void SIMCRS::SIMCRS_Service::buildComplementaryLinks ( stdair::BomRoot &   ) 

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 &   ) 

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.

References SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

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:
const bool isForCRS Whether the sample booking request is for CRS.
Returns:
BookingRequestStruct& Sample booking request structure.

Definition at line 574 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

Referenced by main().

std::string SIMCRS::SIMCRS_Service::jsonHandler ( const stdair::JSONString &   )  const

Dispatch the JSon command string to the AirInv service. (Only AirInv has json export commands for now).

Parameters:
const stdair::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.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

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.

References SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

Referenced by main().

std::string SIMCRS::SIMCRS_Service::csvDisplay ( const stdair::TravelSolutionList_T &   )  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.

References SIMCRS::SIMCRS_ServiceContext::getSTDAIR_Service().

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:
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.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 695 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().

std::string SIMCRS::SIMCRS_Service::csvDisplay ( const stdair::AirlineCode_T &  ,
const stdair::FlightNumber_T &  ,
const stdair::Date_T &  iDepartureDate 
) const

Recursively display (dump in the returned string) the flight-date corresponding to the parameters given as input.

Parameters:
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.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 716 of file SIMCRS_Service.cpp.

References SIMCRS::SIMCRS_ServiceContext::getAIRINV_Service().


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