AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
AIRSCHED::AIRSCHED_Service Class Reference

Interface for the AirSched Services. More...

#include <airsched/AIRSCHED_Service.hpp>

List of all members.

Public Member Functions

 AIRSCHED_Service (const stdair::BasLogParams &, const stdair::BasDBParams &)
 AIRSCHED_Service (const stdair::BasLogParams &)
 AIRSCHED_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr)
void parseAndLoad (const stdair::Filename_T &iScheduleInputFilename)
void parseAndLoad (const stdair::Filename_T &iScheduleFilename, const stdair::Filename_T &iODInputFilename)
 ~AIRSCHED_Service ()
void buildSampleBom ()
void buildSegmentPathList (stdair::TravelSolutionList_T &, const stdair::BookingRequestStruct &)
void simulate ()
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::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const

Detailed Description

Interface for the AirSched Services.

Definition at line 32 of file AIRSCHED_Service.hpp.


Constructor & Destructor Documentation

AIRSCHED::AIRSCHED_Service::AIRSCHED_Service ( const stdair::BasLogParams &  iLogParams,
const stdair::BasDBParams &  iDBParams 
)

Constructor.

The initAirschedService() 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 62 of file AIRSCHED_Service.cpp.

AIRSCHED::AIRSCHED_Service::AIRSCHED_Service ( const stdair::BasLogParams &  iLogParams)

Constructor.

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

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

Definition at line 42 of file AIRSCHED_Service.cpp.

AIRSCHED::AIRSCHED_Service::AIRSCHED_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIR_ServicePtr)

Constructor.

The initAirschedService() 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 AIRSCHED_Service is itself being initialised by another library service such as SIMCRS_Service).

Parameters:
stdair::STDAIR_ServicePtr_TReference on the STDAIR service.

Definition at line 84 of file AIRSCHED_Service.cpp.

AIRSCHED::AIRSCHED_Service::~AIRSCHED_Service ( )

Destructor.

Definition at line 100 of file AIRSCHED_Service.cpp.


Member Function Documentation

void AIRSCHED::AIRSCHED_Service::parseAndLoad ( const stdair::Filename_T &  iScheduleInputFilename)

Parse the schedule input file and load it into memory.

The CSV file, describing the airline schedule for the simulator, is parsed and instantiated in memory accordingly.

Parameters:
conststdair::Filename_T& Filename of the input schedule file.

Definition at line 178 of file AIRSCHED_Service.cpp.

References AIRSCHED::ScheduleParser::generateInventories().

Referenced by main(), and parseAndLoad().

void AIRSCHED::AIRSCHED_Service::parseAndLoad ( const stdair::Filename_T &  iScheduleFilename,
const stdair::Filename_T &  iODInputFilename 
)

Parse the schedule and O&D input files, and load them into memory.

The CSV files, describing the airline schedule and the O&Ds 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.

Definition at line 199 of file AIRSCHED_Service.cpp.

References AIRSCHED::OnDParser::generateOnDPeriods(), and parseAndLoad().

void AIRSCHED::AIRSCHED_Service::buildSampleBom ( )

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

The BOM tree is based on two actual inventories (one for BA, another for AF). Each inventory contains one flight. One of those flights has two legs (and therefore three segments).

Definition at line 223 of file AIRSCHED_Service.cpp.

References AIRSCHED::SegmentPathGenerator::createSegmentPathNetwork().

Referenced by main().

void AIRSCHED::AIRSCHED_Service::buildSegmentPathList ( stdair::TravelSolutionList_T &  ioTravelSolutionList,
const stdair::BookingRequestStruct &  iBookingRequest 
)

Calculate and return a list of travel solutions corresponding to a given product demand.

Definition at line 369 of file AIRSCHED_Service.cpp.

Referenced by main().

void AIRSCHED::AIRSCHED_Service::simulate ( )

Perform a small simulation, which uses the Customer Choice Model (CCM).

Currently, that method does nothing.

Definition at line 341 of file AIRSCHED_Service.cpp.

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

Definition at line 274 of file AIRSCHED_Service.cpp.

std::string AIRSCHED::AIRSCHED_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 297 of file AIRSCHED_Service.cpp.

std::string AIRSCHED::AIRSCHED_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-period corresponding to the parameters given as input.

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

Definition at line 318 of file AIRSCHED_Service.cpp.


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