This tutorial section will give you step by step instructions and exemples on how to use all the modules.
The first mandatory tutorial is the getting started procedure you should have already followed at this step. Once the needed Travel Simulator packages are correctly installed, the following tutorials are what you need!
For general information and a technical description of the different modules head to the user manual page once you are finished here.
Also for focused information on precise problems make sure you have a look at the F.A.Q.
cd ~/metasimgit/workspace/build/stdair/stdair/Then launch it with the default BOM tree option '-b':
./stdair -bIf you have a look at the log file (called after the launched batch), you can find the following BOM tree structure, in this exact order :
cd ~/metasimgit/workspace/build/simfqt/simfqt/./simfqt -bThis batch is an interactive one, try 'help' to obtain all the existing commands, and then 'list' to discover all the O&Ds and departure dates for which some fare rules are applicable. Then 'quit' the interactive batch and open the log file named 'simfqt.log'. At the beginning of the file, we find the BOM root display:
cd ~/metasimgit/workspace/src/stdair/stdair/command/Let us create our own BOM tree now. First, a BOM root object (i.e. a root for all the classes in the project) must be instantiated. This is done by the stdair::STDAIR_ServiceContext context object, when the stdair::STDAIR_Service is itself instantiated. The standard procedure is illustrated below:
const BomRootKey lBomRootKey ("My first Bom Root");BomRoot& lBomRoot = FacBom<BomRoot>::instance().create(lBomRootKey);An airline inventory object can then be instantiated. Let us create the "BA" airline code (corresponding to British Airways airline):
const AirlineCode_T lAirlineCodeBA ("BA");That is, an object (let us name it lInventoryKeyBA) of type (class) stdair::InventoryKey has first to be instantiated.
const InventoryKey lInventoryKeyBA (lAirlineCodeBA);Thanks to that key, an airline inventory object, i.e. of type (class) stdair::Inventory, can be instantiated. Let us name that airline inventory object lBAInv.
Inventory& lBAInv = FacBom<Inventory>::instance().create(lInventoryKeyBA);Then, we must create the link parent/child to attach those two objects as defined in the BOM tree structure. That operation is as simple as using the following methods:
FacBomManager::addToListAndMap (lBomRoot, lBAInv);FacBomManager::linkWithParent (lBomRoot, lBAInv);Another airline inventory object, corresponding to the AF (Air France) company, can be instantiated the same way:
const AirlineCode_T lAirlineCodeAF ("AF");const InventoryKey lAFKey (lAirlineCodeAF);Inventory& lAFInv = FacBom::instance().create (lAFKey);FacBomManager::addToListAndMap (lBomRoot, lAFInv);FacBomManager::linkWithParent (lBomRoot, lAFInv);
Log filename is: sevmgr.log sevmgr P / 2010-Jan-21 00:00:00>Try the 'display' command to learn more about the current event. The output should look like this:
2010-Jan-21 00:00:00, BreakPoint, 2010-Jan-21 00:00:00Let's now have a look at the whole simulation queue using the 'list' command. There are three events to come, including two booking requests and a second break point (the first one was the first event of the queue):
2010-Jan-22 10:00:00, BookingRequest, At 2010-Jan-22 10:00:00, for (SIN, IN) SIN-BKK (RI) 2010-Jan-30 (7 days) 10:00:00 Eco 3 M 1000 100 1 50 1 50 2011-May-14 00:00:00, BreakPoint, 2011-May-14 00:00:00 2011-May-15 10:00:00, BookingRequest, At 2011-May-15 10:00:00, for (LHR, DN) LHR-SYD (RI) 2011-Jun-10 (7 days) 08:00:00 Eco 3 M 1000 100 0 30 0 50The 'next' command plays the current event and pops the next one from the queue. This is exactly the simulation principle: the events in the queue will be popped and played one by one. The simulation will only stop when a break point is encountered which is the objective of the 'run' command.
cd ~/metasimgit/workspace/build/trademgen/trademgen/When launching the trademgen interactive batch with no parameter, a default demand input file is parsed. This file can be found in the StdAir sample directory.
./trademgenTo see all the demand streams for which booking requests can be generated, try the command 'list_demand_stream'. You can check that you end up with the same demand streams as those defined in the input file. The output should look like:
List of demand streams SIN-BKK 2012-Apr-30 Y SIN-BKK 2012-May-07 Y SIN-BKK 2012-May-14 Y SIN-BKK 2012-May-21 Y SIN-BKK 2012-May-28 Y SIN-BKK 2012-Jun-04 Y SIN-BKK 2012-Jun-11 Y SIN-BKK 2012-Jun-18 Y SIN-BKK 2012-Jun-25 Y SIN-BKK 2012-Jul-02 Y ...Then, the command 'list_event' will enable you to check that for now, the event list is empty:
List of events EQ01 (0) 0/{11520,11520}Let's now generate our first booking request for the first demand stream. The corresponding command is :
generate_next_br SIN-BKK 2012-Apr-30 YLet's now display again the event list ('list_event' command):
List of events EQ01 (1) 0/{11520,11520} 2011-Jun-06 22:50:04.001000, BookingRequest, At 2011-Jun-06 22:50:04.001000, for (BKK, DN) SIN-BKK (RO) 2012-Apr-30 (5 days) 07:01:27 Y 1 G 185.452 55.6372 0 50A booking request has been created: the corresponding traveller is making his request on the 6th of June 2011 and is wishing to travel on the 30th of April 2012 from Singapour to Bangkok in the Economy cabin (as expected from the demand stream key). The other parameters'values have been created using the distribution defined in the demand input file. Let's now generate all the booking requests for this same demand stream:
generate_all_br SIN-BKK 2012-Apr-30 YThe output display should look like:
339 more event(s) have been generated for the demand stream: 'SIN-BKK 2012-Apr-30 Y'.Display again the event list to see all the stored booking requests. Finally, to visualize the booking requests arrival pattern, 'quit' the interactive command line and launch a python dedicated script located in the tool directory:
./tools/trademgen_drawBookingArrivals -p trademgen.logDo not hesitate to repeat the steps above using your own demand input file. Please, refer to the How can I build my own demand input file? tutorial first. Then launch the demand generation script with your demand file specified as input parameter:
./trademgen --input <your_demand_file.csv>