$treeview $search $mathjax
SimFQT Logo  1.00.0
$projectbrief
$projectbrief
$searchbox

Users Guide

Table of Contents

Introduction

The SimFQT library contains classes for fare rule management. This document does not cover all the aspects of the SimFQT library. It does however explain the most important things you need to know in order to start using SimFQT.

Get Started

Get the SimFQT library

Clone locally the full Git project:
cd ~
mkdir -p dev/sim
cd ~/dev/sim
git clone git://simfqt.git.sourceforge.net/gitroot/simfqt/simfqt simfqtgit
cd simfqtgit
git checkout trunk

Build the SimFQT project

Link with StdAir, create the distribution package (say, 0.5.0) and compile using the following commands:
cd ~/dev/sim/simfqtgit
rm -rf build && mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/dev/deliveries/simfqt-0.5.0 \
 -DWITH_STDAIR_PREFIX=~/dev/deliveries/stdair-stable \
 -DCMAKE_BUILD_TYPE:STRING=Debug -DINSTALL_DOC:BOOL=ON ..
make

Run the Tests

After building the SimFQT project, the following commands run the tests:
cd ~/dev/sim/simfqtgit
cd build
make check

As a result, you should obtain a similar report:

[  0%] Built target hdr_cfg_simfqt
[ 90%] Built target simfqtlib
[100%] Built target FQTTestSuitetst
Test project /home/localoriuser/dev/sim/simfqt/simfqtgit/build/test/simfqt
    Start 1: FQTTestSuitetst
1/1 Test #1: FQTTestSuitetst ..................   Passed    0.15 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.16 sec
[100%] Built target check_simfqttst
[100%] Built target check

Install the SimFQT Project (Binaries, Documentation)

After the step Build the SimFQT project, to install the library and its header files, type:
cd ~/dev/sim/simfqtgit
cd build
make install

You can check that the executables and other required files have been copied into the given final directory:

cd ~dev/deliveries/simfqt-0.5.0

To generate the SimFQT project documentation, the commands are:

cd ~/dev/sim/simfqtgit
cd build
make doc
The SimFQT project documentation is available in the following formats: HTML, LaTeX. Those documents are available in a subdirectory:

cd ~/dev/sim/simfqtgit
cd build
cd doc

Input file of SimFQT Project

The fare input file structure should look like the following sample:

// Fares: fare ID; OriginCity; DestinationCity; TripType; DateRangeStart; DateRangeEnd; DepartureTimeRangeStart; DepartureTimeRangeEnd; POS; CabinCode; Channel; AdvancePurchase; SaturdayNight; ChangeFees; NonRefundable; MinimumStay; Price; nb Segments
// Segment: AirlineCode; Class; 
1; SIN; BKK; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; SIN; Y; IN; 7; T; T; T; 3; 150.0; SQ; Y;
2; SIN; BKK; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; BKK; Y; IN; 7; T; T; T; 3; 150.0; SQ; Y;
3; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; SIN; Y; IN; 7; T; T; T; 3; 150.0; SQ; Y;
4; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; HND; Y; IN; 7; T; T; T; 3; 150.0; SQ; Y;
5; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; ROW; Y; IN; 7; T; T; T; 3; 150.0; SQ; Y;
6; SIN; BKK; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; SIN; Y; IF; 7; T; T; T; 3; 150.0; SQ; Y;
7; SIN; BKK; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; BKK; Y; IF; 7; T; T; T; 3; 150.0; SQ; Y;
8; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; SIN; Y; IF; 7; T; T; T; 3; 150.0; SQ; Y;
9; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; HND; Y; IF; 7; T; T; T; 3; 150.0; SQ; Y;
10; SIN; HND; OW; 2010-01-15; 2010-12-31; 00:00; 23:59; ROW; Y; IF; 7; T; T; T; 3; 150.0; SQ; Y;

Each line represents a fare rule (see SIMFQT::FareRuleStruct), i.e., each line tells us the price a customer will be asked according to a lot of criteria such as:

Some fare input examples (including the example above named fare01.csv) are given in the stdair::samples directory.

The fare quoting BOM Tree

The Fare Quoting Business Object Model (BOM) tree is a structure permitting to store all the SIMFQT::FareRuleStruct objects of the simulation. That is why, the BOM tree is built parsing the fare file containing all the fare rules (as described in the previous section Input file of SimFQT Project). For convenience and first use of SimFQT (the input fare file building can be long and heavy), SimFQT API enables to build a small default BOM tree.

Build of the fare quoting BOM tree

First, a BOM root object (i.e., a root for all the classes in the project) is instantiated by the stdair::STDAIR_ServiceContext context object, when the stdair::STDAIR_Service is itself instantiated, that is to say during the instanciation of the simfqt::SIMFQT_Service object. The corresponding type (class) stdair::BomRoot is defined in the StdAir library.

Then, the BOM root can be either constructed thanks to the simfqt::SIMFQT_Service::buildSampleBom() method:

    void buildSampleBom();    

or can be constructed using the fare dump file described above thanks to the simfqt::SIMFQT_Service::parseAndLoad (const stdair::Filename_T&) method:

    void parseAndLoad (const FareFilePath& iFareFilename);

Display of the fare quoting BOM tree

The fare quoting BOM tree can be displayed as done in the batches::simfqt.cpp program:

When the default bom tree is used (-b option of the main program simfqt.cpp), the fare quoting BOM tree display should look like:

===============================================================
BomRoot:  -- ROOT -- 
===============================================================
+++++++++++++++++++++++++++++++++++++++++++++++++
AirportPair: LHR, SYD
+++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------------
DatePeriod: [2011-Jan-15/2011-Dec-30]
------------------------------------------
******************************************
PosChannel: LHR,DN
******************************************
----------------------------------------
TimePeriod: 00:00:00-23:00:00
----------------------------------------
--------------------------------------
Fare-Features: RT -- 0-1-1-1-0
--------------------------------------
------------------------------------
AirlineClassList: BA Y
------------------------------------

Here the fare quoting BOM tree is just composed of one fare rule.

Structure of the fare quoting BOM tree

As one can guess looking at the BOM tree display above, the tree is constructed as follow:

The fare quoting procedure

The project SimFQT aims at fare quoting a list of travel solutions corresponding to a booking request. The fare quoter looks for all the fare rules matching a travel solution: when a fare rule matches, it creates a fare option object and adds this object to the current travel solution.

A few steps:

Instanciate the default booking request

A default booking request can be built using the simfqt::SIMFQT_Service::buildBookingRequest method:
    stdair::BookingRequestStruct buildBookingRequest(const bool isForCRS = false);

Instanciate the default travel solution list

In the following sample, a list of travel solutions is given as input/output parameter of the simfqt::SIMFQT_Service::buildSampleTravelSolutions method:
    void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);

Fare Quoting a list of travel solution

Once a booking request, its correponding list of travel solutions and the fare Quote BOM tree are constructed, the main fonction of the module can be called:

    void quotePrices (const stdair::BookingRequestStruct&,
                      stdair::TravelSolutionList_T&);

For each travel solution of the list, the applicable fare rules are picked from the BOM tree (information such as the trip type or the booking request date are only contained into the booking request, that is why we need this object too).

Each chosen fare rule enables to create a fare option structure which is finally stored into the travel solution.

Error Messages

This section lists the fatal errors you may encounter when using SimFQT:

Fare input file not found

In this case, the output error message will be similar to:
terminate called after throwing an instance of 'SIMFQT::FareInputFileNotFoundException'
  what():  The fare input file '~/<YourFileName>.csv' does not exist or can not be read
Aborted

You can check:

Fare input file can not be parsed

This error message means that your input file has been opened but has not been fully read.
terminate called after throwing an instance of 'SIMFQT::FareFileParsingFailedException'
  what():  Parsing of fare input file: ~/<YourFileName>.csv failed
Aborted
Your input file structure is somehow incorrect. See the tutorial section How to build a fare input file?.

Error Messages for missing fare rules

If you obtain one of the error messages below and you are currently using your own input file, that means it has been fully read. However, at least one fare rule is missing to complete the fare quote.