$treeview $search $mathjax
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.cd ~ mkdir -p dev/sim cd ~/dev/sim git clone git://simfqt.git.sourceforge.net/gitroot/simfqt/simfqt simfqtgit cd simfqtgit git checkout trunk
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
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
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
cd ~/dev/sim/simfqtgit cd build cd doc
// 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.
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.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);
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.
stdair::BomRoot object (i.e., a root for all the classes in the project).stdair::AirportPair objects (i.e., all the possible combinations of origin-destination). In the instance above, the only combination possible is from London to Sydney.stdair::AirportPair, we find all the date periods of the fare rules applicable for this origin-destination.stdair::DatePeriod, we find all the possible combinations of point-of-sale and channel applicable.stdair::PosChannel object, we have the correponding stdair::TimePeriod objects.stdair::FareFeatures objects, that is to say the trip type, the advanced purchase and stay duration required, ...A few steps:
simfqt::SIMFQT_Service::buildBookingRequest method: stdair::BookingRequestStruct buildBookingRequest(const bool isForCRS = false);
simfqt::SIMFQT_Service::buildSampleTravelSolutions method: void buildSampleTravelSolutions (stdair::TravelSolutionList_T&);
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.
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:
terminate called after throwing an instance of 'SIMFQT::FareFileParsingFailedException' what(): Parsing of fare input file: ~/<YourFileName>.csv failed Aborted
terminate called after throwing an instance of 'SIMFQT::AirportPairNotFoundException' what(): No available fare rule for the Origin-Destination pair: xxx, xxx Aborted
terminate called after throwing an instance of 'SIMFQT::FlightDateNotFoundException' what(): No available fare rule for the flight date x, xxxx-xxx-xx and to the Origin-Destination pair: xxx, xxx Aborted
terminate called after throwing an instance of 'SIMFQT::PosOrChannelNotFoundException' what(): No available fare rule for the point of sale xxx, the channel xx, the flight date x, xxxx-xxx-xx and the Origin-Destination pair: xxx, xxx Aborted
terminate called after throwing an instance of 'SIMFQT::FlightTimeNotFoundException' what(): No available fare rule corresponding to 'xx; x, xxxx-xxx-xx; xxx, xxx; xx:xx' (parsed key) and to 'xxx, xx' (POS and channel) Aborted
terminate called after throwing an instance of 'SIMFQT::FeaturesNotFoundException' what(): No available fare rule corresponding to a trip type xx, to a stay duration of x, to a request date time of xxxx-xxx-xx xx:xx:xx, to 'xx; x, xxxx-xxx-xx; xxx, xxx; xx:xx' (parsed key) and to 'xxx, xx' (POS and channel), to 'xx; x, xxxx-xxx-xx; xxx, xxx; xx:xx' (parsed key) and to 'xxx, xx' (POS and channel) Aborted
terminate called after throwing an instance of 'SIMFQT::AirlineNotFoundException' what(): No available fare rule corresponding to 'xx; x, xxxx-xxx-xx; xxx, xxx; xx:xx' (parsed key), to 'xxxx-xxx-xx xx:xx:xx, for (xxx, xx) xxx-xxx (xx) xxxx-xxx-xx (x days) xx:xx:xx x x x x x' (booking request) and to 'xxx, xx' (POS and channel) Aborted
1.4.7
Generated on Sun Jun 21 22:14:23 2015 for SimFQT by
1.4.7