StdAir Logo  0.45.0
C++ Standard Airline IT Object Library
CmdBomManager.cpp
Go to the documentation of this file.
00001 
00005 // //////////////////////////////////////////////////////////////////////
00006 // Import section
00007 // //////////////////////////////////////////////////////////////////////
00008 // STL
00009 #include <cassert>
00010 #include <sstream>
00011 // StdAir
00012 #include <stdair/basic/BasConst_General.hpp>
00013 #include <stdair/basic/BasConst_DefaultObject.hpp>
00014 #include <stdair/basic/BasConst_Request.hpp>
00015 #include <stdair/basic/BasConst_Inventory.hpp>
00016 #include <stdair/bom/BomRetriever.hpp>
00017 #include <stdair/bom/BomRoot.hpp>
00018 #include <stdair/bom/Inventory.hpp>
00019 #include <stdair/bom/FlightDate.hpp>
00020 #include <stdair/bom/LegDate.hpp>
00021 #include <stdair/bom/LegCabin.hpp>
00022 #include <stdair/bom/SegmentDate.hpp>
00023 #include <stdair/bom/SegmentCabin.hpp>
00024 #include <stdair/bom/FareFamily.hpp>
00025 #include <stdair/bom/BookingClass.hpp>
00026 #include <stdair/bom/AirportPair.hpp>
00027 #include <stdair/bom/PosChannel.hpp>
00028 #include <stdair/bom/DatePeriod.hpp>
00029 #include <stdair/bom/TimePeriod.hpp>
00030 #include <stdair/bom/FareFeatures.hpp>
00031 #include <stdair/bom/YieldFeatures.hpp>
00032 #include <stdair/bom/AirlineClassList.hpp>
00033 #include <stdair/bom/BomManager.hpp>
00034 #include <stdair/bom/TravelSolutionStruct.hpp>
00035 #include <stdair/bom/BookingRequestStruct.hpp>
00036 #include <stdair/factory/FacBomManager.hpp>
00037 #include <stdair/factory/FacBom.hpp>
00038 #include <stdair/command/CmdBomManager.hpp>
00039 #include <stdair/service/Logger.hpp>
00040 #include <stdair/bom/OnDDate.hpp>
00041 #include <stdair/bom/SegmentPeriod.hpp>
00042 #include <stdair/bom/FlightPeriod.hpp>
00043 
00044 namespace stdair {
00045 
00046   // //////////////////////////////////////////////////////////////////////
00047   void CmdBomManager::buildSampleBom (BomRoot& ioBomRoot) {
00048 
00049     // DEBUG
00050     STDAIR_LOG_DEBUG ("StdAir is building the BOM tree from built-in "
00051                       << "specifications.");
00052 
00053     // ////// Basic Bom Tree ///////
00054     // Build the inventory (flight-dates) and the schedule (flight period) parts.
00055     buildSampleInventorySchedule (ioBomRoot);
00056 
00057     // Build the pricing (fare rules) and revenue accounting (yields) parts.
00058     buildSamplePricing (ioBomRoot);
00059 
00060     // ////// Partnership Bom Tree ///////    
00061     // Build the inventory (flight-dates) and the schedule (flight period) parts.
00062     buildPartnershipsSampleInventoryAndRM (ioBomRoot);
00063 
00064     // Build the pricing (fare rules) and revenue accounting (yields) parts.
00065     buildPartnershipsSamplePricing (ioBomRoot);
00066 
00067     // Build a dummy inventory, needed by RMOL.
00068     buildCompleteDummyInventory (ioBomRoot);
00069   }
00070 
00071   // //////////////////////////////////////////////////////////////////////
00072   void CmdBomManager::buildSampleInventorySchedule (BomRoot& ioBomRoot) {
00073 
00074     // Inventory
00075     // Step 0.1: Inventory level
00076     // Create an Inventory for BA
00077     const InventoryKey lBAKey ("BA");
00078     Inventory& lBAInv = FacBom<Inventory>::instance().create (lBAKey);
00079     FacBomManager::addToListAndMap (ioBomRoot, lBAInv);
00080     FacBomManager::linkWithParent (ioBomRoot, lBAInv);
00081 
00082     // Create an Inventory for AF
00083     const InventoryKey lAFKey ("AF");
00084     Inventory& lAFInv = FacBom<Inventory>::instance().create (lAFKey);
00085     FacBomManager::addToListAndMap (ioBomRoot, lAFInv);
00086     FacBomManager::linkWithParent (ioBomRoot, lAFInv);
00087 
00088     // BA
00089     // Step 0.2: Flight-date level
00090     // Create a FlightDate (BA9/10-JUN-2011) for BA's Inventory
00091     FlightNumber_T lFlightNumber = 9;
00092     Date_T lDate (2011, 6, 10);
00093     FlightDateKey lFlightDateKey (lFlightNumber, lDate);
00094 
00095     FlightDate& lBA9_20110610_FD =
00096       FacBom<FlightDate>::instance().create (lFlightDateKey);
00097     FacBomManager::addToListAndMap (lBAInv, lBA9_20110610_FD);
00098     FacBomManager::linkWithParent (lBAInv, lBA9_20110610_FD);
00099     
00100     // Display the flight-date
00101     // STDAIR_LOG_DEBUG ("FlightDate: " << lBA9_20110610_FD.toString());
00102     
00103     // Step 0.3: Segment-date level
00104     // Create a first SegmentDate (LHR-SYD) for BA's Inventory
00105     // See http://www.britishairways.com/travel/flightinformation/public/fr_fr?&Carrier=BA&FlightNumber=0009&from=LHR&to=SYD&depDate=100611&SellingClass=O
00106     const AirportCode_T lLHR ("LHR");
00107     const AirportCode_T lSYD ("SYD");
00108     const DateOffset_T l1Day (1);
00109     const DateOffset_T l2Days (2);
00110     const Duration_T l2135 (21, 45, 0);
00111     const Duration_T l0610 (6, 10, 0);
00112     const Duration_T l2205 (22, 05, 0);
00113     SegmentDateKey lSegmentDateKey (lLHR, lSYD);
00114 
00115     SegmentDate& lLHRSYDSegment =
00116       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
00117     FacBomManager::addToListAndMap (lBA9_20110610_FD, lLHRSYDSegment);
00118     FacBomManager::linkWithParent (lBA9_20110610_FD, lLHRSYDSegment);
00119 
00120     // Fill the SegmentDate content
00121     lLHRSYDSegment.setBoardingDate (lDate);
00122     lLHRSYDSegment.setOffDate (lDate + l2Days);
00123     lLHRSYDSegment.setBoardingTime (l2135);
00124     lLHRSYDSegment.setOffTime (l0610);
00125     lLHRSYDSegment.setElapsedTime (l2135);
00126   
00127     // Display the segment-date
00128     // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRSYDSegment);
00129 
00130     // Create a second SegmentDate (LHR-BKK) for BA's Inventory
00131     // See http://www.britishairways.com/travel/flightinformation/public/fr_fr?&Carrier=BA&FlightNumber=0009&from=LHR&to=BKK&depDate=100611&SellingClass=O
00132     const AirportCode_T lBKK ("BKK");
00133     const Duration_T l1540 (15, 40, 0);
00134     const Duration_T l1105 (11, 5, 0);
00135     lSegmentDateKey = SegmentDateKey (lLHR, lBKK);
00136 
00137     SegmentDate& lLHRBKKSegment =
00138       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
00139     FacBomManager::addToListAndMap (lBA9_20110610_FD, lLHRBKKSegment);
00140     FacBomManager::linkWithParent (lBA9_20110610_FD, lLHRBKKSegment);
00141 
00142     // Fill the SegmentDate content
00143     lLHRBKKSegment.setBoardingDate (lDate);
00144     lLHRBKKSegment.setOffDate (lDate + l1Day);
00145     lLHRBKKSegment.setBoardingTime (l2135);
00146     lLHRBKKSegment.setOffTime (l1540);
00147     lLHRBKKSegment.setElapsedTime (l1105);
00148   
00149     // Display the segment-date
00150     // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRBKKSegment);
00151 
00152     // Create a third SegmentDate (BKK-SYD) for BA's Inventory
00153     // See http://www.britishairways.com/travel/flightinformation/public/fr_fr?&Carrier=BA&FlightNumber=0009&from=BKK&to=SYD&depDate=110611&SellingClass=O
00154     const Duration_T l1705 (17, 5, 0);
00155     const Duration_T l0905 (9, 5, 0);
00156     lSegmentDateKey = SegmentDateKey (lBKK, lSYD);
00157 
00158     SegmentDate& lBKKSYDSegment =
00159       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
00160     FacBomManager::addToListAndMap (lBA9_20110610_FD, lBKKSYDSegment);
00161     FacBomManager::linkWithParent (lBA9_20110610_FD, lBKKSYDSegment);
00162 
00163     // Fill the SegmentDate content
00164     lBKKSYDSegment.setBoardingDate (lDate + l1Day);
00165     lBKKSYDSegment.setOffDate (lDate + l2Days);
00166     lBKKSYDSegment.setBoardingTime (l1705);
00167     lBKKSYDSegment.setOffTime (l1540);
00168     lBKKSYDSegment.setElapsedTime (l0905);
00169   
00170     // Display the segment-date
00171     // STDAIR_LOG_DEBUG ("SegmentDate: " << lBKKSYDSegment);
00172 
00173     // Step 0.4: Leg-date level
00174     // Create a first LegDate (LHR) for BA's Inventory
00175     LegDateKey lLegDateKey (lLHR);
00176 
00177     LegDate& lLHRLeg = FacBom<LegDate>::instance().create (lLegDateKey);
00178     FacBomManager::addToListAndMap (lBA9_20110610_FD, lLHRLeg);
00179     FacBomManager::linkWithParent (lBA9_20110610_FD, lLHRLeg);
00180 
00181     // Fill the LegDate content
00182     lLHRLeg.setOffPoint (lBKK);
00183     lLHRLeg.setBoardingDate (lDate);
00184     lLHRLeg.setOffDate (lDate + l1Day);
00185     lLHRLeg.setBoardingTime (l2135);
00186     lLHRLeg.setOffTime (l1540);
00187     lLHRLeg.setElapsedTime (l1105);
00188 
00189     // Display the leg-date
00190     // STDAIR_LOG_DEBUG ("LegDate: " << lLHRLeg.toString());
00191     
00192     // Create a second LegDate (BKK)
00193     lLegDateKey = LegDateKey (lBKK);
00194 
00195     LegDate& lBKKLeg = FacBom<LegDate>::instance().create (lLegDateKey);
00196     FacBomManager::addToListAndMap (lBA9_20110610_FD, lBKKLeg);
00197     FacBomManager::linkWithParent (lBA9_20110610_FD, lBKKLeg);
00198 
00199     // Display the leg-date
00200     // STDAIR_LOG_DEBUG ("LegDate: " << lBKKLeg.toString());
00201 
00202     // Fill the LegDate content
00203     lBKKLeg.setOffPoint (lSYD);
00204     lBKKLeg.setBoardingDate (lDate + l1Day);
00205     lBKKLeg.setOffDate (lDate + l2Days);
00206     lBKKLeg.setBoardingTime (l1705);
00207     lBKKLeg.setOffTime (l1540);
00208     lBKKLeg.setElapsedTime (l0905);
00209 
00210     // Link the segment-dates with the leg-dates
00211     FacBomManager::addToListAndMap (lLHRLeg, lLHRSYDSegment);
00212     FacBomManager::addToListAndMap (lLHRLeg, lLHRBKKSegment);
00213     FacBomManager::addToListAndMap (lBKKLeg, lLHRSYDSegment);
00214     FacBomManager::addToListAndMap (lBKKLeg, lBKKSYDSegment);
00215     FacBomManager::addToListAndMap (lLHRSYDSegment, lLHRLeg);
00216     FacBomManager::addToListAndMap (lLHRBKKSegment, lLHRLeg);
00217     FacBomManager::addToListAndMap (lLHRSYDSegment, lBKKLeg);
00218     FacBomManager::addToListAndMap (lBKKSYDSegment, lBKKLeg);
00219 
00220 
00221     // Step 0.5: segment-cabin level
00222     // Create a SegmentCabin (Y) for the Segment LHR-BKK of BA's Inventory
00223     const CabinCode_T lY ("Y");
00224     SegmentCabinKey lYSegmentCabinKey (lY);
00225 
00226     SegmentCabin& lLHRBKKSegmentYCabin =
00227       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
00228     FacBomManager::addToListAndMap (lLHRBKKSegment, lLHRBKKSegmentYCabin);
00229     FacBomManager::linkWithParent (lLHRBKKSegment, lLHRBKKSegmentYCabin);
00230 
00231     // Display the segment-cabin
00232     // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRBKKSegmentYCabin.toString());
00233 
00234     // Create a SegmentCabin (Y) of the Segment BKK-SYD;
00235     SegmentCabin& lBKKSYDSegmentYCabin =
00236       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
00237     FacBomManager::addToListAndMap (lBKKSYDSegment, lBKKSYDSegmentYCabin);
00238     FacBomManager::linkWithParent (lBKKSYDSegment, lBKKSYDSegmentYCabin);
00239 
00240      
00241     // Display the segment-cabin
00242     // STDAIR_LOG_DEBUG ("SegmentCabin: " << lBKKSYDSegmentYCabin.toString());
00243 
00244     // Create a SegmentCabin (Y) of the Segment LHR-SYD;
00245     SegmentCabin& lLHRSYDSegmentYCabin =
00246       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
00247     FacBomManager::addToListAndMap (lLHRSYDSegment, lLHRSYDSegmentYCabin);
00248     FacBomManager::linkWithParent (lLHRSYDSegment, lLHRSYDSegmentYCabin);
00249       
00250     // Display the segment-cabin
00251     // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRSYDSegmentYCabin.toString());
00252 
00253     // Step 0.6: leg-cabin level
00254     // Create a LegCabin (Y) for the Leg LHR-BKK on BA's Inventory
00255     LegCabinKey lYLegCabinKey (lY);
00256 
00257     LegCabin& lLHRLegYCabin =
00258       FacBom<LegCabin>::instance().create (lYLegCabinKey);
00259     FacBomManager::addToListAndMap (lLHRLeg, lLHRLegYCabin);
00260     FacBomManager::linkWithParent (lLHRLeg, lLHRLegYCabin);
00261 
00262     // Display the leg-cabin
00263     // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString());
00264 
00265     // Create a LegCabin (Y) for the Leg BKK-SYD
00266     LegCabin& lBKKLegYCabin =
00267       FacBom<LegCabin>::instance().create (lYLegCabinKey);
00268     FacBomManager::addToListAndMap (lBKKLeg, lBKKLegYCabin);
00269     FacBomManager::linkWithParent (lBKKLeg, lBKKLegYCabin);
00270     // Display the leg-cabin
00271     // STDAIR_LOG_DEBUG ("LegCabin: " << lBKKLegYCabin.toString());
00272 
00283     FacBomManager::addToListAndMap (lLHRLegYCabin, lLHRSYDSegmentYCabin,
00284                                     lLHRSYDSegmentYCabin.getFullerKey());
00285     FacBomManager::addToListAndMap (lLHRLegYCabin, lLHRBKKSegmentYCabin,
00286                                     lLHRBKKSegmentYCabin.getFullerKey());
00287     FacBomManager::addToListAndMap (lBKKLegYCabin, lLHRSYDSegmentYCabin,
00288                                     lLHRSYDSegmentYCabin.getFullerKey());
00289     FacBomManager::addToListAndMap (lBKKLegYCabin, lBKKSYDSegmentYCabin,
00290     lBKKSYDSegmentYCabin.getFullerKey());
00291 
00302     FacBomManager::addToListAndMap (lLHRSYDSegmentYCabin, lLHRLegYCabin,
00303                                     lLHRLegYCabin.getFullerKey());
00304     FacBomManager::addToListAndMap (lLHRBKKSegmentYCabin, lLHRLegYCabin,
00305                                     lLHRLegYCabin.getFullerKey());
00306     FacBomManager::addToListAndMap (lLHRSYDSegmentYCabin, lBKKLegYCabin,
00307                                     lBKKLegYCabin.getFullerKey());
00308     FacBomManager::addToListAndMap (lBKKSYDSegmentYCabin, lBKKLegYCabin,
00309                                     lBKKLegYCabin.getFullerKey());
00310 
00311 
00312     // Step 0.7: fare family level
00313     // Create a FareFamily (1) for the Segment LHR-BKK, cabin Y on BA's Inv
00314     const FamilyCode_T l1 ("EcoSaver");
00315     FareFamilyKey l1FareFamilyKey (l1);
00316 
00317     FareFamily& lLHRBKKSegmentYCabin1Family =
00318       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
00319     FacBomManager::addToListAndMap (lLHRBKKSegmentYCabin,
00320                                     lLHRBKKSegmentYCabin1Family);
00321     FacBomManager::linkWithParent (lLHRBKKSegmentYCabin,
00322                                    lLHRBKKSegmentYCabin1Family);
00323 
00324     // Display the booking class
00325     // STDAIR_LOG_DEBUG ("FareFamily: "
00326     //                   << lLHRBKKSegmentYCabin1Family.toString());
00327 
00328     // Create a FareFamily (1)  for the Segment BKK-SYD, cabin Y on BA's Inv
00329     FareFamily& lBKKSYDSegmentYCabin1Family =
00330       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
00331     FacBomManager::addToListAndMap (lBKKSYDSegmentYCabin,
00332                                     lBKKSYDSegmentYCabin1Family);
00333     FacBomManager::linkWithParent (lBKKSYDSegmentYCabin,
00334                                    lBKKSYDSegmentYCabin1Family);
00335     
00336     // Display the booking class
00337     // STDAIR_LOG_DEBUG ("FareFamily: "
00338     //                   << lLHRBKKSegmentYCabin1Family.toString());
00339 
00340     // Create a FareFamily (1)  for the Segment LHR-SYD, cabin Y on BA's Inv
00341     FareFamily& lLHRSYDSegmentYCabin1Family =
00342       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
00343     FacBomManager::addToListAndMap (lLHRSYDSegmentYCabin,
00344                                     lLHRSYDSegmentYCabin1Family);
00345     FacBomManager::linkWithParent (lLHRSYDSegmentYCabin,
00346                                    lLHRSYDSegmentYCabin1Family);
00347 
00348     // Display the booking class
00349     // STDAIR_LOG_DEBUG ("FareFamily: "
00350     //                   << lLHRBKKSegmentYCabin1Family.toString());
00351 
00352 
00353     // Step 0.8: booking class level
00354     // Create a BookingClass (Q) for the Segment LHR-BKK, cabin Y,
00355     // fare family 1 on BA's Inv
00356     const ClassCode_T lQ ("Q");
00357     BookingClassKey lQBookingClassKey (lQ);
00358 
00359     BookingClass& lLHRBKKSegmentYCabin1FamilyQClass =
00360       FacBom<BookingClass>::instance().create (lQBookingClassKey);
00361     FacBomManager::addToListAndMap (lLHRBKKSegmentYCabin1Family,
00362                                     lLHRBKKSegmentYCabin1FamilyQClass);
00363     FacBomManager::linkWithParent (lLHRBKKSegmentYCabin1Family,
00364                                    lLHRBKKSegmentYCabin1FamilyQClass);
00365 
00366     FacBomManager::addToListAndMap (lLHRBKKSegmentYCabin,
00367                                     lLHRBKKSegmentYCabin1FamilyQClass);
00368     FacBomManager::addToListAndMap (lLHRBKKSegment,
00369                                     lLHRBKKSegmentYCabin1FamilyQClass);
00370 
00371     // Display the booking class
00372     // STDAIR_LOG_DEBUG ("BookingClass: "
00373     //                   << lLHRBKKSegmentYCabin1FamilyQClass.toString());
00374 
00375     // Create a BookingClass (Q) for the Segment BKK-SYD, cabin Y,
00376     // fare family 1 on BA's Inv
00377     BookingClass& lBKKSYDSegmentYCabin1FamilyQClass =
00378       FacBom<BookingClass>::instance().create (lQBookingClassKey);
00379     FacBomManager::addToListAndMap (lBKKSYDSegmentYCabin1Family,
00380                                     lBKKSYDSegmentYCabin1FamilyQClass);
00381     FacBomManager::linkWithParent (lBKKSYDSegmentYCabin1Family,
00382                                    lBKKSYDSegmentYCabin1FamilyQClass);
00383     
00384     FacBomManager::addToListAndMap (lBKKSYDSegmentYCabin,
00385                                     lBKKSYDSegmentYCabin1FamilyQClass);
00386     FacBomManager::addToListAndMap (lBKKSYDSegment,
00387                                     lBKKSYDSegmentYCabin1FamilyQClass);
00388 
00389     // Display the booking class
00390     // STDAIR_LOG_DEBUG ("BookingClass: "
00391     //                   << lLHRBKKSegmentYCabin1FamilyQClass.toString());
00392 
00393     // Create a BookingClass (Q) for the Segment LHR-SYD, cabin Y,
00394     // fare family 1 on BA's Inv
00395     BookingClass& lLHRSYDSegmentYCabin1FamilyQClass =
00396       FacBom<BookingClass>::instance().create (lQBookingClassKey);
00397     FacBomManager::addToListAndMap (lLHRSYDSegmentYCabin1Family,
00398                                     lLHRSYDSegmentYCabin1FamilyQClass);
00399     FacBomManager::linkWithParent (lLHRSYDSegmentYCabin1Family,
00400                                    lLHRSYDSegmentYCabin1FamilyQClass);
00401 
00402     FacBomManager::addToListAndMap (lLHRSYDSegmentYCabin,
00403                                     lLHRSYDSegmentYCabin1FamilyQClass);
00404     FacBomManager::addToListAndMap (lLHRSYDSegment,
00405                                     lLHRSYDSegmentYCabin1FamilyQClass);
00406 
00407     // Display the booking class
00408     // STDAIR_LOG_DEBUG ("BookingClass: "
00409     //                   << lLHRBKKSegmentYCabin1FamilyQClass.toString());
00410 
00411     
00412     // ////// AF ///////    
00413     // Step 0.2: Flight-date level
00414     // Create a FlightDate (AF084/20-MAR-2011) for AF's Inventory
00415     lFlightNumber = 84;
00416     lDate = Date_T (2011, 3, 20);
00417     lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
00418 
00419     FlightDate& lAF084_20110320_FD =
00420       FacBom<FlightDate>::instance().create (lFlightDateKey);
00421     FacBomManager::addToListAndMap (lAFInv, lAF084_20110320_FD);
00422     FacBomManager::linkWithParent (lAFInv, lAF084_20110320_FD);
00423     
00424     // Display the flight-date
00425     // STDAIR_LOG_DEBUG ("FlightDate: " << lAF084_20110320_FD.toString());
00426 
00427     // Step 0.3: Segment-date level
00428     // Create a SegmentDate (CDG-SFO) for AF's Inventory
00429     const AirportCode_T lCDG ("CDG");
00430     const AirportCode_T lSFO ("SFO");
00431     const Duration_T l1040 (10, 40, 0);
00432     const Duration_T l1250 (12, 50, 0);
00433     const Duration_T l1110 (11, 10, 0);
00434     lSegmentDateKey = SegmentDateKey (lCDG, lSFO);
00435 
00436     SegmentDate& lCDGSFOSegment =
00437       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
00438     FacBomManager::addToListAndMap (lAF084_20110320_FD, lCDGSFOSegment);
00439     FacBomManager::linkWithParent (lAF084_20110320_FD, lCDGSFOSegment);
00440 
00441     // Display the segment-date
00442     // STDAIR_LOG_DEBUG ("SegmentDate: " << lCDGSFOSegment.toString());
00443 
00444     // Fill the SegmentDate content
00445     lCDGSFOSegment.setBoardingDate (lDate);
00446     lCDGSFOSegment.setOffDate (lDate);
00447     lCDGSFOSegment.setBoardingTime (l1040);
00448     lCDGSFOSegment.setOffTime (l1250);
00449     lCDGSFOSegment.setElapsedTime (l1110);
00450 
00451     // Step 0.4: Leg-date level
00452     // Create a LegDate (CDG) for AF's Inventory
00453     lLegDateKey = LegDateKey (lCDG);
00454 
00455     LegDate& lCDGLeg = FacBom<LegDate>::instance().create (lLegDateKey);
00456     FacBomManager::addToListAndMap (lAF084_20110320_FD, lCDGLeg);
00457     FacBomManager::linkWithParent (lAF084_20110320_FD, lCDGLeg);
00458 
00459     // Fill the LegDate content
00460     lCDGLeg.setOffPoint (lSFO);
00461     lCDGLeg.setBoardingDate (lDate);
00462     lCDGLeg.setOffDate (lDate);
00463     lCDGLeg.setBoardingTime (l1040);
00464     lCDGLeg.setOffTime (l1250);
00465     lCDGLeg.setElapsedTime (l1110);
00466 
00467     // Display the leg-date
00468     // STDAIR_LOG_DEBUG ("LegDate: " << lCDGLeg.toString());
00469 
00470     // Link the segment-dates with the leg-dates
00471     FacBomManager::addToListAndMap (lCDGLeg, lCDGSFOSegment);
00472     FacBomManager::addToListAndMap (lCDGSFOSegment, lCDGLeg);
00473 
00474 
00475     // Step 0.5: segment-cabin level
00476     // Create a SegmentCabin (Y) for the Segment CDG-SFO of AF's Inventory
00477     SegmentCabin& lCDGSFOSegmentYCabin =
00478       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
00479     FacBomManager::addToListAndMap (lCDGSFOSegment, lCDGSFOSegmentYCabin);
00480     FacBomManager::linkWithParent (lCDGSFOSegment, lCDGSFOSegmentYCabin);
00481 
00482     // Display the segment-cabin
00483     // STDAIR_LOG_DEBUG ("SegmentCabin: " << lCDGSFOSegmentYCabin.toString());
00484 
00485     // Step 0.6: leg-cabin level
00486     // Create a LegCabin (Y) for the Leg CDG-SFO on AF's Inventory
00487     LegCabin& lCDGLegYCabin =
00488       FacBom<LegCabin>::instance().create (lYLegCabinKey);
00489     FacBomManager::addToListAndMap (lCDGLeg, lCDGLegYCabin);
00490     FacBomManager::linkWithParent (lCDGLeg, lCDGLegYCabin);
00491 
00492     // Display the leg-cabin
00493     // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString());
00494 
00495     // Link the segment-dates with the leg-dates
00496     FacBomManager::addToListAndMap (lCDGLegYCabin, lCDGSFOSegmentYCabin,
00497                                     lCDGSFOSegmentYCabin.getFullerKey());
00498     FacBomManager::addToListAndMap (lCDGSFOSegmentYCabin, lCDGLegYCabin,
00499                                     lCDGLegYCabin.getFullerKey());
00500 
00501 
00502     // Step 0.7: fare family level
00503     // Create a fareFamily (1) for the Segment CDG-SFO, cabin Y on AF's Inv
00504     FareFamily& lCDGSFOSegmentYCabin1Family =
00505       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
00506     FacBomManager::addToListAndMap (lCDGSFOSegmentYCabin,
00507                                     lCDGSFOSegmentYCabin1Family);
00508     FacBomManager::linkWithParent (lCDGSFOSegmentYCabin,
00509                                    lCDGSFOSegmentYCabin1Family);
00510 
00511     // Display the fare family
00512     // STDAIR_LOG_DEBUG ("fareFamily: "
00513     //
00514     //                   << lCDGSFOSegmentYCabin1Family.toString());
00515 
00516     // Step 0.8: booking class level Create a BookingClass (Q) for the
00517     // Segment CDG-SFO, cabin Y, fare family 1 on AF's Inv
00518     BookingClass& lCDGSFOSegmentYCabin1FamilyQClass =
00519       FacBom<BookingClass>::instance().create (lQBookingClassKey);
00520     FacBomManager::addToListAndMap (lCDGSFOSegmentYCabin1Family,
00521                                     lCDGSFOSegmentYCabin1FamilyQClass);
00522     FacBomManager::linkWithParent (lCDGSFOSegmentYCabin1Family,
00523                                    lCDGSFOSegmentYCabin1FamilyQClass);
00524 
00525     FacBomManager::addToListAndMap (lCDGSFOSegmentYCabin,
00526                                     lCDGSFOSegmentYCabin1FamilyQClass);
00527     FacBomManager::addToListAndMap (lCDGSFOSegment,
00528                                     lCDGSFOSegmentYCabin1FamilyQClass);
00529 
00530     // Display the booking class
00531     // STDAIR_LOG_DEBUG ("BookingClass: "
00532     //                   << lCDGSFOSegmentYCabin1FamilyQClass.toString());
00533 
00534     /*================================================================================
00535       ================================================================================
00536       ================================================================================*/
00537     // Schedule:
00538     // BA:
00539     // Step 1: flight period level
00540     // Create a flight period for BA9:
00541     const DoWStruct lDoWSrtuct ("1111111");
00542     const Date_T lBA9DateRangeStart (2010, boost::gregorian::Jun, 6);
00543     const Date_T lBA9DateRangeEnd (2010, boost::gregorian::Jun, 7);
00544     const DatePeriod_T lBA9DatePeriod (lBA9DateRangeStart, lBA9DateRangeEnd);
00545     const PeriodStruct lBA9PeriodStruct (lBA9DatePeriod, lDoWSrtuct);
00546 
00547     lFlightNumber = FlightNumber_T (9);
00548 
00549     FlightPeriodKey lBA9FlightPeriodKey (lFlightNumber, lBA9PeriodStruct);
00550 
00551     FlightPeriod& lBA9FlightPeriod =
00552       FacBom<FlightPeriod>::instance().create (lBA9FlightPeriodKey);
00553     FacBomManager::addToListAndMap (lBAInv, lBA9FlightPeriod);
00554     FacBomManager::linkWithParent (lBAInv, lBA9FlightPeriod);
00555 
00556     // Step 2: segment period level
00557     // Create a segment period for SIN-BKK:
00558 
00559     SegmentPeriodKey lLHRSYDSegmentPeriodKey (lLHR, lSYD);
00560 
00561     SegmentPeriod& lLHRSYDSegmentPeriod =
00562       FacBom<SegmentPeriod>::instance().create (lLHRSYDSegmentPeriodKey);
00563     FacBomManager::addToListAndMap (lBA9FlightPeriod, lLHRSYDSegmentPeriod);
00564     FacBomManager::linkWithParent (lBA9FlightPeriod, lLHRSYDSegmentPeriod);
00565 
00566     lLHRSYDSegmentPeriod.setBoardingTime (l2135);
00567     lLHRSYDSegmentPeriod.setOffTime (l1540);
00568     lLHRSYDSegmentPeriod.setElapsedTime (l1105);
00569     ClassList_String_T lYM ("YM");
00570     lLHRSYDSegmentPeriod.addCabinBookingClassList (lY,lYM);
00571 
00572     // AF:
00573     // Step 1: flight period level
00574     // Create a flight period for AF84:
00575     const Date_T lAF84DateRangeStart (2011, boost::gregorian::Mar, 20);
00576     const Date_T lAF84DateRangeEnd (2011, boost::gregorian::Mar, 21);
00577     const DatePeriod_T lAF84DatePeriod (lAF84DateRangeStart, lAF84DateRangeEnd);
00578     const PeriodStruct lAF84PeriodStruct (lAF84DatePeriod, lDoWSrtuct);
00579 
00580     lFlightNumber = FlightNumber_T (84);
00581 
00582     FlightPeriodKey lAF84FlightPeriodKey (lFlightNumber, lAF84PeriodStruct);
00583 
00584     FlightPeriod& lAF84FlightPeriod =
00585       FacBom<FlightPeriod>::instance().create (lAF84FlightPeriodKey);
00586     FacBomManager::addToListAndMap (lAFInv, lAF84FlightPeriod);
00587     FacBomManager::linkWithParent (lAFInv, lAF84FlightPeriod);
00588 
00589     // Step 2: segment period level
00590     // Create a segment period for SIN-BKK:
00591 
00592     SegmentPeriodKey lCDGSFOSegmentPeriodKey (lCDG, lSFO);
00593 
00594     SegmentPeriod& lCDGSFOSegmentPeriod =
00595       FacBom<SegmentPeriod>::instance().create (lCDGSFOSegmentPeriodKey);
00596     FacBomManager::addToListAndMap (lAF84FlightPeriod, lCDGSFOSegmentPeriod);
00597     FacBomManager::linkWithParent (lAF84FlightPeriod, lCDGSFOSegmentPeriod);
00598 
00599     lCDGSFOSegmentPeriod.setBoardingTime (l1040);
00600     lCDGSFOSegmentPeriod.setOffTime (l1250);
00601     lCDGSFOSegmentPeriod.setElapsedTime (l1110);
00602     lCDGSFOSegmentPeriod.addCabinBookingClassList (lY,lYM);
00603 
00604     /*================================================================================
00605       ================================================================================
00606       ================================================================================*/
00607     // O&D 
00608     // Create an O&D Date (BA;9,2010-Jun-06;LHR,SYD) for BA's Inventory
00609     OnDString_T  lBALHRSYDOnDStr = "BA;9,2010-Jun-06;LHR,SYD";
00610     OnDStringList_T lBAOnDStrList;
00611     lBAOnDStrList.push_back (lBALHRSYDOnDStr);
00612 
00613     OnDDateKey lBAOnDDateKey (lBAOnDStrList);
00614     OnDDate& lBA_LHRSYD_OnDDate =
00615       FacBom<OnDDate>::instance().create (lBAOnDDateKey);
00616     // Link to the inventory
00617     FacBomManager::addToListAndMap (lBAInv, lBA_LHRSYD_OnDDate);
00618     FacBomManager::linkWithParent (lBAInv, lBA_LHRSYD_OnDDate);
00619 
00620     // Add the segment
00621     FacBomManager::addToListAndMap (lBA_LHRSYD_OnDDate, lLHRSYDSegment);
00622 
00623     // Add total forecast info for cabin Y.
00624     const MeanStdDevPair_T lMean60StdDev6 (60.0, 6.0);
00625     const WTP_T lWTP750 = 750.0;
00626     const WTPDemandPair_T lWTP750Mean60StdDev6 (lWTP750, lMean60StdDev6);
00627     lBA_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
00628 
00629     // Create an O&D Date (AF;84,2011-Mar-21;CDG,SFO) for AF's Inventory
00630     OnDString_T lAFLHRSYDOnDStr = "AF;9,2011-Mar-20;CDG,SFO";
00631     OnDStringList_T lAFOnDStrList;
00632     lAFOnDStrList.push_back (lAFLHRSYDOnDStr);
00633 
00634     OnDDateKey lAFOnDDateKey (lAFOnDStrList);
00635     OnDDate& lAF_LHRSYD_OnDDate =
00636       FacBom<OnDDate>::instance().create (lAFOnDDateKey);
00637     // Link to the inventory
00638     FacBomManager::addToListAndMap (lAFInv, lAF_LHRSYD_OnDDate);
00639     FacBomManager::linkWithParent (lAFInv, lAF_LHRSYD_OnDDate);
00640 
00641     // Add the segment
00642     FacBomManager::addToListAndMap (lAF_LHRSYD_OnDDate, lLHRSYDSegment);
00643 
00644     // Add total forecast info for cabin Y. 
00645     lAF_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
00646     
00647   }
00648   // //////////////////////////////////////////////////////////////////////
00649   void CmdBomManager::buildCompleteDummyInventory  (BomRoot& ioBomRoot) {
00650 
00651     // Build a dummy inventory, containing a dummy flight-date with a
00652     // single segment-cabin and a single leg-cabin.
00653     const CabinCapacity_T lCapacity = DEFAULT_CABIN_CAPACITY;
00654     buildDummyInventory (ioBomRoot, lCapacity);
00655 
00656     // Retrieve the (sample) segment-cabin.
00657     SegmentCabin& lDummySegmentCabin =
00658       BomRetriever::retrieveDummySegmentCabin (ioBomRoot);
00659     
00660     // Retrieve the (sample) leg-cabin.
00661     LegCabin& lDummyLegCabin =
00662       BomRetriever::retrieveDummyLegCabin (ioBomRoot);
00663 
00664     // Add some booking classes to the dummy segment-cabin and some
00665     // virtual ones to the dummy leg-cabin.
00666     // First booking class yield and demand information.
00667     Yield_T lYield = 100;
00668     MeanValue_T lMean = 20;
00669     StdDevValue_T lStdDev= 9;
00670     BookingClassKey lBCKey (DEFAULT_CLASS_CODE);
00671 
00672     BookingClass& lDummyBookingClass =
00673       FacBom<BookingClass>::instance().create (lBCKey);
00674     lDummyBookingClass.setYield (lYield);
00675     lDummyBookingClass.setMean (lMean);
00676     lDummyBookingClass.setStdDev (lStdDev);
00677     // Add a booking class to the segment-cabin.
00678     FacBomManager::addToList (lDummySegmentCabin, lDummyBookingClass);
00679 
00680     VirtualClassStruct lDummyVirtualClass (lDummyBookingClass);
00681     lDummyVirtualClass.setYield (lYield);
00682     lDummyVirtualClass.setMean (lMean);
00683     lDummyVirtualClass.setStdDev (lStdDev);
00684     // Add the corresponding virtual class to the leg-cabin.
00685     lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
00686 
00687     // Second booking class yield and demand information.
00688     lYield = 70;
00689     lMean = 45;
00690     lStdDev= 12;
00691     lDummyBookingClass.setYield (lYield);
00692     lDummyBookingClass.setMean (lMean);
00693     lDummyBookingClass.setStdDev (lStdDev);
00694     // Add a booking class to the segment-cabin.
00695     FacBomManager::addToList (lDummySegmentCabin, lDummyBookingClass);
00696 
00697     lDummyVirtualClass.setYield (lYield);
00698     lDummyVirtualClass.setMean (lMean);
00699     lDummyVirtualClass.setStdDev (lStdDev);
00700     // Add the corresponding virtual class to the leg-cabin.
00701     lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
00702     
00703     // Third booking class yield and demand information.
00704     lYield = 42;
00705     lMean = 80;
00706     lStdDev= 16;
00707     lDummyBookingClass.setYield (lYield);
00708     lDummyBookingClass.setMean (lMean);
00709     lDummyBookingClass.setStdDev (lStdDev);
00710     // Add a booking class to the segment-cabin.
00711     FacBomManager::addToList (lDummySegmentCabin, lDummyBookingClass);
00712 
00713     lDummyVirtualClass.setYield (lYield);
00714     lDummyVirtualClass.setMean (lMean);
00715     lDummyVirtualClass.setStdDev (lStdDev);
00716     // Add the corresponding virtual class to the leg-cabin.
00717     lDummyLegCabin.addVirtualClass (lDummyVirtualClass);
00718     
00719   }
00720   
00721   // //////////////////////////////////////////////////////////////////////
00722   void CmdBomManager::buildDummyInventory (BomRoot& ioBomRoot,
00723                                            const CabinCapacity_T& iCapacity) {
00724     // Inventory
00725     const InventoryKey lInventoryKey (DEFAULT_AIRLINE_CODE);
00726     Inventory& lInv = FacBom<Inventory>::instance().create (lInventoryKey);
00727     FacBomManager::addToListAndMap (ioBomRoot, lInv);
00728     FacBomManager::linkWithParent (ioBomRoot, lInv);
00729 
00730     // Flight-date
00731     FlightDateKey lFlightDateKey(DEFAULT_FLIGHT_NUMBER, DEFAULT_DEPARTURE_DATE);
00732     FlightDate& lFlightDate =
00733       FacBom<FlightDate>::instance().create (lFlightDateKey);
00734     FacBomManager::addToListAndMap (lInv, lFlightDate);
00735     FacBomManager::linkWithParent (lInv, lFlightDate);
00736 
00737     // Leg-date
00738     LegDateKey lLegDateKey (DEFAULT_ORIGIN);
00739     LegDate& lLeg = FacBom<LegDate>::instance().create (lLegDateKey);
00740     FacBomManager::addToListAndMap (lFlightDate, lLeg);
00741     FacBomManager::linkWithParent (lFlightDate, lLeg);
00742 
00743     // Fill the LegDate content
00744     lLeg.setOffPoint (DEFAULT_DESTINATION);
00745     lLeg.setBoardingDate (DEFAULT_DEPARTURE_DATE);
00746     lLeg.setOffDate (DEFAULT_DEPARTURE_DATE);
00747     lLeg.setBoardingTime (Duration_T (14, 0, 0));
00748     lLeg.setOffTime (Duration_T (16, 0, 0));
00749     lLeg.setElapsedTime (Duration_T (8, 0, 0));
00750 
00751     // Leg-cabin
00752     LegCabinKey lLegCabinKey (DEFAULT_CABIN_CODE);
00753     LegCabin& lLegCabin = FacBom<LegCabin>::instance().create (lLegCabinKey);
00754     FacBomManager::addToListAndMap (lLeg, lLegCabin);
00755     FacBomManager::linkWithParent (lLeg, lLegCabin);
00756 
00757     lLegCabin.setCapacities (iCapacity);
00758     lLegCabin.setAvailabilityPool (iCapacity);
00759 
00760     // Segment-date
00761     SegmentDateKey lSegmentDateKey (DEFAULT_ORIGIN, DEFAULT_DESTINATION);
00762     SegmentDate& lSegment =
00763       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
00764     FacBomManager::addToListAndMap (lFlightDate, lSegment);
00765     FacBomManager::linkWithParent (lFlightDate, lSegment);
00766 
00767     // Links between the segment-date and the leg-date
00768     FacBomManager::addToListAndMap (lLeg, lSegment);
00769     FacBomManager::addToListAndMap (lSegment, lLeg);
00770 
00771     // Fill the SegmentDate content
00772     lSegment.setBoardingDate (DEFAULT_DEPARTURE_DATE);
00773     lSegment.setOffDate (DEFAULT_DEPARTURE_DATE);
00774     lSegment.setBoardingTime (Duration_T (14, 0, 0));
00775     lSegment.setOffTime (Duration_T (16, 0, 0));
00776     lSegment.setElapsedTime (Duration_T (8, 0, 0));
00777 
00778     // Segment-cabin
00779     SegmentCabinKey lSegmentCabinKey (DEFAULT_CABIN_CODE);
00780     SegmentCabin& lSegmentCabin =
00781       FacBom<SegmentCabin>::instance().create (lSegmentCabinKey);
00782     FacBomManager::addToListAndMap (lSegment, lSegmentCabin);
00783     FacBomManager::linkWithParent (lSegment, lSegmentCabin);
00784 
00785     // Links between the segment-cabin and the leg-cabin
00786     FacBomManager::addToListAndMap (lLegCabin, lSegmentCabin,
00787                                     lSegmentCabin.getFullerKey());
00788     FacBomManager::addToListAndMap (lSegmentCabin, lLegCabin,
00789                                     lLegCabin.getFullerKey());
00790 
00791     // Create a FareFamily (1) for the Segment LHR-BKK, cabin Y on BA's Inv
00792     const FamilyCode_T l1 ("EcoSaver");
00793     FareFamilyKey l1FareFamilyKey (l1);
00794 
00795     FareFamily& lSegmentYCabin1Family =
00796       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
00797     FacBomManager::addToListAndMap (lSegmentCabin, lSegmentYCabin1Family);
00798     FacBomManager::linkWithParent (lSegmentCabin, lSegmentYCabin1Family);
00799 
00800     // Create a booking-class
00801     const ClassCode_T lQ ("Q");
00802     BookingClassKey lQBookingClassKey (lQ);
00803 
00804     BookingClass& lSegmentYCabin1FamilyQClass =
00805       FacBom<BookingClass>::instance().create (lQBookingClassKey);
00806     FacBomManager::addToListAndMap (lSegmentYCabin1Family,
00807                                     lSegmentYCabin1FamilyQClass);
00808     FacBomManager::linkWithParent (lSegmentYCabin1Family,
00809                                    lSegmentYCabin1FamilyQClass);
00810     
00811     FacBomManager::addToListAndMap (lSegmentCabin, lSegmentYCabin1FamilyQClass);
00812     FacBomManager::addToListAndMap (lSegment, lSegmentYCabin1FamilyQClass);
00813 
00814     /*================================================================================
00815       ================================================================================
00816       ================================================================================*/
00817     // Schedule:
00818     // XX:
00819     // Step 1: flight period level
00820     // Create a flight period for XX:
00821     const DoWStruct lDoWSrtuct ("1111111");
00822     const Date_T lXXDateRangeStart (DEFAULT_DEPARTURE_DATE);
00823     const Date_T lXXDateRangeEnd (DEFAULT_DEPARTURE_DATE);
00824     const DatePeriod_T lXXDatePeriod (lXXDateRangeStart, lXXDateRangeEnd);
00825     const PeriodStruct lXXPeriodStruct (lXXDatePeriod, lDoWSrtuct);
00826 
00827     FlightPeriodKey lXXFlightPeriodKey (DEFAULT_FLIGHT_NUMBER, lXXPeriodStruct);
00828 
00829     FlightPeriod& lXXFlightPeriod =
00830       FacBom<FlightPeriod>::instance().create (lXXFlightPeriodKey);
00831     FacBomManager::addToListAndMap (lInv, lXXFlightPeriod);
00832     FacBomManager::linkWithParent (lInv, lXXFlightPeriod);
00833 
00834     // Step 2: segment period level
00835     // Create a segment period 
00836 
00837     SegmentPeriodKey lXXSegmentPeriodKey (DEFAULT_ORIGIN, DEFAULT_DESTINATION);
00838 
00839     SegmentPeriod& lXXSegmentPeriod =
00840       FacBom<SegmentPeriod>::instance().create (lXXSegmentPeriodKey);
00841     FacBomManager::addToListAndMap (lXXFlightPeriod, lXXSegmentPeriod);
00842     FacBomManager::linkWithParent (lXXFlightPeriod, lXXSegmentPeriod);
00843 
00844     lXXSegmentPeriod.setBoardingTime (Duration_T (14, 0, 0));
00845     lXXSegmentPeriod.setOffTime (Duration_T (16, 0, 0));
00846     lXXSegmentPeriod.setElapsedTime (Duration_T (8, 0, 0));
00847     const CabinCode_T lY ("Y");
00848     const ClassList_String_T lYQ ("YQ");
00849     lXXSegmentPeriod.addCabinBookingClassList (lY,lYQ);
00850 
00851 
00852   }
00853 
00854   // //////////////////////////////////////////////////////////////////////
00855   void CmdBomManager::buildSamplePricing (BomRoot& ioBomRoot) {
00856 
00857     // Set the airport-pair primary key.
00858     const AirportPairKey lAirportPairKey (AIRPORT_LHR, AIRPORT_SYD);
00859     
00860     // Create the AirportPairKey object and link it to the BOM tree root.
00861     AirportPair& lAirportPair =
00862       FacBom<AirportPair>::instance().create (lAirportPairKey);
00863     FacBomManager::addToListAndMap (ioBomRoot, lAirportPair);
00864     FacBomManager::linkWithParent (ioBomRoot, lAirportPair);
00865 
00866     // Set the fare date-period primary key.
00867     const Date_T lDateRangeStart (2011, boost::gregorian::Jan, 15);
00868     const Date_T lDateRangeEnd (2011, boost::gregorian::Dec, 31);
00869     const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
00870     const DatePeriodKey lDatePeriodKey (lDateRange);
00871 
00872     // Create the DatePeriodKey object and link it to the PosChannel object.
00873     DatePeriod& lDatePeriod =
00874       FacBom<DatePeriod>::instance().create (lDatePeriodKey);
00875     FacBomManager::addToListAndMap (lAirportPair, lDatePeriod);
00876     FacBomManager::linkWithParent (lAirportPair, lDatePeriod);    
00877 
00878     // Set the point-of-sale-channel primary key.
00879     const PosChannelKey lPosChannelKey (POS_LHR, CHANNEL_DN);  
00880     
00881     // Create the PositionKey object and link it to the AirportPair object.
00882     PosChannel& lPosChannel =
00883       FacBom<PosChannel>::instance().create (lPosChannelKey);
00884     FacBomManager::addToListAndMap (lDatePeriod, lPosChannel);
00885     FacBomManager::linkWithParent (lDatePeriod, lPosChannel);
00886    
00887     // Set the fare time-period primary key.
00888     const Time_T lTimeRangeStart (0, 0, 0);
00889     const Time_T lTimeRangeEnd (23, 0, 0);
00890     const TimePeriodKey lTimePeriodKey (lTimeRangeStart, lTimeRangeEnd);
00891 
00892     // Create the TimePeriodKey and link it to the DatePeriod object.
00893     TimePeriod& lTimePeriod =
00894       FacBom<TimePeriod>::instance().create (lTimePeriodKey);
00895     FacBomManager::addToListAndMap (lPosChannel, lTimePeriod);
00896     FacBomManager::linkWithParent (lPosChannel, lTimePeriod);        
00897 
00898     // Pricing -- Generate the FareRule
00899     const FareFeaturesKey lFareFeaturesKey (TRIP_TYPE_ROUND_TRIP,
00900                                             NO_ADVANCE_PURCHASE,
00901                                             SATURDAY_STAY,
00902                                             CHANGE_FEES,
00903                                             NON_REFUNDABLE,
00904                                             NO_STAY_DURATION);
00905 
00906     // Create the FareFeaturesKey and link it to the TimePeriod object.
00907     FareFeatures& lFareFeatures =
00908       FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
00909     FacBomManager::addToListAndMap (lTimePeriod, lFareFeatures);
00910     FacBomManager::linkWithParent (lTimePeriod, lFareFeatures);        
00911 
00912     // Revenue Accounting -- Generate the YieldRule
00913     const YieldFeaturesKey lYieldFeaturesKey (TRIP_TYPE_ROUND_TRIP,
00914                                               CABIN_Y);
00915     
00916     // Create the YieldFeaturesKey and link it to the TimePeriod object.
00917     YieldFeatures& lYieldFeatures =
00918       FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
00919     FacBomManager::addToListAndMap (lTimePeriod, lYieldFeatures);
00920     FacBomManager::linkWithParent (lTimePeriod, lYieldFeatures);     
00921                                               
00922     // Generate Segment Features and link them to their respective
00923     // fare and yield rules.
00924     AirlineCodeList_T lAirlineCodeList;
00925     lAirlineCodeList.push_back (AIRLINE_CODE_BA);
00926     ClassList_StringList_T lClassCodeList;
00927     lClassCodeList.push_back (CLASS_CODE_Y);
00928     const AirlineClassListKey lAirlineClassListKey (lAirlineCodeList,
00929                                                     lClassCodeList);
00930 
00931     // Create the AirlineClassList
00932     AirlineClassList& lAirlineClassList =
00933       FacBom<AirlineClassList>::instance().create (lAirlineClassListKey);
00934     // Link the AirlineClassList to the FareFeatures object
00935     lAirlineClassList.setFare (900);
00936     FacBomManager::addToListAndMap (lFareFeatures, lAirlineClassList);
00937     FacBomManager::linkWithParent (lFareFeatures, lAirlineClassList);
00938 
00939     // Link the AirlineClassList to the YieldFeatures object
00940     lAirlineClassList.setYield (900);
00941     FacBomManager::addToListAndMap (lYieldFeatures, lAirlineClassList);
00942     // \todo (gsabatier): the following calls overrides the parent for
00943     //       lAirlineClassList. Check that it is what is actually wanted.
00944     FacBomManager::linkWithParent (lYieldFeatures, lAirlineClassList);
00945   }
00946 
00947   // //////////////////////////////////////////////////////////////////////
00948   void CmdBomManager::
00949   buildSampleTravelSolutionForPricing (TravelSolutionList_T& ioTravelSolutionList) {
00950 
00951     // Clean the list
00952     ioTravelSolutionList.clear();
00953 
00954     //
00955     const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
00956 
00957     // Add the segment date key to the travel solution
00958     TravelSolutionStruct lTS;
00959     lTS.addSegment (lBA9_SegmentDateKey);
00960 
00961     // Add the travel solution to the list
00962     ioTravelSolutionList.push_back (lTS);
00963   }
00964   
00965   // //////////////////////////////////////////////////////////////////////
00966   void CmdBomManager::
00967   buildSampleTravelSolutions (TravelSolutionList_T& ioTravelSolutionList) {
00968 
00969     // Clean the list
00970     ioTravelSolutionList.clear();
00971 
00972     //
00973     const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
00974 
00975     // Add the segment date key to the travel solution
00976     TravelSolutionStruct lTS;
00977     lTS.addSegment (lBA9_SegmentDateKey);
00978 
00979     // Fare option
00980     const ClassCode_T lClassPath (CLASS_CODE_Q);
00981     const Fare_T lFare (900);
00982     const ChangeFees_T lChangeFee (CHANGE_FEES);
00983     const NonRefundable_T isNonRefundable (NON_REFUNDABLE);
00984     const SaturdayStay_T lSaturdayStay (SATURDAY_STAY);
00985     const FareOptionStruct lFareOption (lClassPath, lFare, lChangeFee,
00986                                         isNonRefundable, lSaturdayStay);
00987 
00988     // Add (a copy of) the fare option
00989     lTS.addFareOption (lFareOption);
00990 
00991     // Map of class availabilities: set the availability for the Q
00992     // booking class (the one corresponding to the fare option) to 8.
00993     ClassAvailabilityMap_T lClassAvailabilityMap;
00994     const Availability_T lAvl (8);
00995     const bool hasInsertBeenSuccessful = lClassAvailabilityMap.
00996       insert (ClassAvailabilityMap_T::value_type (lClassPath, lAvl)).second;
00997     assert (hasInsertBeenSuccessful == true);
00998     // Add the map to the dedicated list held by the travel solution
00999     lTS.addClassAvailabilityMap (lClassAvailabilityMap);
01000 
01001     // Add the travel solution to the list
01002     ioTravelSolutionList.push_back (lTS);
01003   }
01004 
01005   // //////////////////////////////////////////////////////////////////////
01006   BookingRequestStruct CmdBomManager::buildSampleBookingRequest() {
01007     // Origin
01008     const AirportCode_T lOrigin (AIRPORT_LHR);
01009 
01010     // Destination
01011     const AirportCode_T lDestination (AIRPORT_SYD);
01012 
01013     // Point of Sale (POS)
01014     const CityCode_T lPOS (POS_LHR);
01015 
01016     // Preferred departure date (10-JUN-2011)
01017     const Date_T lPreferredDepartureDate (2011, boost::gregorian::Jun, 10);
01018 
01019     // Preferred departure time (08:00)
01020     const Duration_T lPreferredDepartureTime (8, 0, 0);
01021 
01022     // Date of the request (15-MAY-2011)
01023     const Date_T lRequestDate (2011, boost::gregorian::May, 15);
01024 
01025     // Time of the request (10:00)
01026     const Duration_T lRequestTime (10, 0, 0);
01027 
01028     // Date-time of the request (made of the date and time above)
01029     const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
01030 
01031     // Preferred cabin (also named class of service sometimes)
01032     const CabinCode_T lPreferredCabin (CABIN_ECO);
01033 
01034     // Number of persons in the party
01035     const PartySize_T lPartySize (3);
01036 
01037     // Channel (direct/indirect, on-line/off-line)
01038     const ChannelLabel_T lChannel (CHANNEL_DN);
01039 
01040     // Type of the trip (one-way, inbound/outbound of a return trip)
01041     const TripType_T lTripType (TRIP_TYPE_INBOUND);
01042 
01043     // Duration of the stay (expressed as a number of days)
01044     const DayDuration_T lStayDuration (DEFAULT_STAY_DURATION);
01045 
01046     // Frequent flyer tier (member, silver, gold, platinum, senator, etc)
01047     const FrequentFlyer_T lFrequentFlyerType (FREQUENT_FLYER_MEMBER);
01048 
01049     // Maximum willing-to-pay (WTP, expressed in monetary unit, e.g., EUR)
01050     const WTP_T lWTP (DEFAULT_WTP);
01051 
01052     // Value of time, for the customer (expressed in monetary unit per
01053     // unit of time, e.g., EUR/hour)
01054     const PriceValue_T lValueOfTime (DEFAULT_VALUE_OF_TIME);
01055 
01056     // Creation of the booking request structure
01057     BookingRequestStruct oBookingRequest (lOrigin, lDestination, lPOS,
01058                                           lPreferredDepartureDate,
01059                                           lRequestDateTime,
01060                                           lPreferredCabin,
01061                                           lPartySize, lChannel,
01062                                           lTripType, lStayDuration,
01063                                           lFrequentFlyerType,
01064                                           lPreferredDepartureTime,
01065                                           lWTP, lValueOfTime);
01066 
01067     return oBookingRequest;
01068   }
01069 
01070   // //////////////////////////////////////////////////////////////////////
01071   BookingRequestStruct CmdBomManager::buildSampleBookingRequestForCRS() {
01072     // Origin
01073     const AirportCode_T lOrigin (AIRPORT_SIN);
01074 
01075     // Destination
01076     const AirportCode_T lDestination (AIRPORT_BKK);
01077 
01078     // Point of Sale (POS)
01079     const CityCode_T lPOS (POS_SIN);
01080 
01081     // Preferred departure date (30-JAN-2010)
01082     const Date_T lPreferredDepartureDate (2010, boost::gregorian::Jan, 30);
01083 
01084     // Preferred departure time (10:00)
01085     const Duration_T lPreferredDepartureTime (10, 0, 0);
01086 
01087     // Date of the request (22-JAN-2010)
01088     const Date_T lRequestDate (2010, boost::gregorian::Jan, 22);
01089 
01090     // Time of the request (10:00)
01091     const Duration_T lRequestTime (10, 0, 0);
01092 
01093     // Date-time of the request (made of the date and time above)
01094     const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
01095 
01096     // Preferred cabin (also named class of service sometimes)
01097     const CabinCode_T lPreferredCabin (CABIN_ECO);
01098 
01099     // Number of persons in the party
01100     const PartySize_T lPartySize (3);
01101 
01102     // Channel (direct/indirect, on-line/off-line)
01103     const ChannelLabel_T lChannel (CHANNEL_IN);
01104 
01105     // Type of the trip (one-way, inbound/outbound of a return trip)
01106     const TripType_T lTripType (TRIP_TYPE_INBOUND);
01107 
01108     // Duration of the stay (expressed as a number of days)
01109     const DayDuration_T lStayDuration (DEFAULT_STAY_DURATION);
01110 
01111     // Frequent flyer tier (member, silver, gold, platinum, senator, etc)
01112     const FrequentFlyer_T lFrequentFlyerType (FREQUENT_FLYER_MEMBER);
01113 
01114     // Maximum willing-to-pay (WTP, expressed in monetary unit, e.g., EUR)
01115     const WTP_T lWTP (DEFAULT_WTP);
01116 
01117     // Value of time, for the customer (expressed in monetary unit per
01118     // unit of time, e.g., EUR/hour)
01119     const PriceValue_T lValueOfTime (DEFAULT_VALUE_OF_TIME);
01120 
01121     // Creation of the booking request structure
01122     BookingRequestStruct oBookingRequest (lOrigin,
01123                                           lDestination,
01124                                           lPOS,
01125                                           lPreferredDepartureDate,
01126                                           lRequestDateTime,
01127                                           lPreferredCabin,
01128                                           lPartySize, lChannel,
01129                                           lTripType, lStayDuration,
01130                                           lFrequentFlyerType,
01131                                           lPreferredDepartureTime,
01132                                           lWTP, lValueOfTime);
01133 
01134     return oBookingRequest;
01135   }
01136 
01137   // //////////////////////////////////////////////////////////////////////
01138   void CmdBomManager::buildPartnershipsSampleInventoryAndRM (BomRoot& ioBomRoot) {
01139 
01140     // Step 0.1: Inventory level
01141     // Create an Inventory for SQ
01142     const InventoryKey lSQKey ("SQ");
01143     Inventory& lSQInv = FacBom<Inventory>::instance().create (lSQKey);
01144     FacBomManager::addToListAndMap (ioBomRoot, lSQInv);
01145     FacBomManager::linkWithParent (ioBomRoot, lSQInv); 
01146     
01147     // Create an Inventory for CX
01148     const InventoryKey lCXKey ("CX");
01149     Inventory& lCXInv = FacBom<Inventory>::instance().create (lCXKey);
01150     FacBomManager::addToListAndMap (ioBomRoot, lCXInv);
01151     FacBomManager::linkWithParent (ioBomRoot, lCXInv);
01152 
01153     
01154     // ////// SQ ///////    
01155     // Step 0.2: Flight-date level
01156     // Create a FlightDate (SQ11/08-FEB-2010) for SQ's Inventory
01157     FlightNumber_T lFlightNumber = 11;
01158     Date_T lDate (2010, 2, 8);
01159     FlightDateKey lFlightDateKey (lFlightNumber, lDate);
01160 
01161     FlightDate& lSQ11_20100208_FD =
01162       FacBom<FlightDate>::instance().create (lFlightDateKey);
01163     FacBomManager::addToListAndMap (lSQInv, lSQ11_20100208_FD);
01164     FacBomManager::linkWithParent (lSQInv, lSQ11_20100208_FD);
01165 
01166     // Create a (mkt) FlightDate (SQ1200/08-FEB-2010) for SQ's Inventory
01167     FlightNumber_T lMktFlightNumber = 1200;
01168     //lDate = Date_T (2010, 2, 8);
01169     FlightDateKey lMktFlightDateKey (lMktFlightNumber, lDate);
01170 
01171     FlightDate& lSQ1200_20100208_FD =
01172       FacBom<FlightDate>::instance().create (lMktFlightDateKey);
01173     FacBomManager::addToListAndMap (lSQInv, lSQ1200_20100208_FD);
01174     FacBomManager::linkWithParent (lSQInv, lSQ1200_20100208_FD);
01175     
01176     // Display the flight-date
01177     // STDAIR_LOG_DEBUG ("FlightDate: " << lBA9_20110610_FD.toString());
01178     
01179     // Step 0.3: Segment-date level
01180     // Create a first SegmentDate (SIN-BKK) for SQ's Inventory
01181     const AirportCode_T lSIN ("SIN");
01182     const AirportCode_T lBKK ("BKK");
01183     const DateOffset_T l1Day (1);
01184     const DateOffset_T l2Days (2);
01185     const Duration_T l0820 (8, 20, 0);
01186     const Duration_T l1100 (11, 0, 0);
01187     const Duration_T l0340 (3, 40, 0);
01188     SegmentDateKey lSegmentDateKey (lSIN, lBKK);
01189 
01190     SegmentDate& lSINBKKSegment =
01191       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
01192     FacBomManager::addToListAndMap (lSQ11_20100208_FD, lSINBKKSegment);
01193     FacBomManager::linkWithParent (lSQ11_20100208_FD, lSINBKKSegment);
01194 
01195     // Fill the SegmentDate content
01196     lSINBKKSegment.setBoardingDate (lDate);
01197     lSINBKKSegment.setOffDate (lDate);
01198     lSINBKKSegment.setBoardingTime (l0820);
01199     lSINBKKSegment.setOffTime (l1100);
01200     lSINBKKSegment.setElapsedTime (l0340);
01201 
01202     // Create a second (mkt) SegmentDate (BKK-HKG) for SQ's Inventory
01203     const AirportCode_T lHKG ("HKG");
01204     const Duration_T l1200 (12, 0, 0);
01205     const Duration_T l1540 (15, 40, 0);
01206     const Duration_T l0240 (2, 40, 0);
01207     SegmentDateKey lMktSegmentDateKey (lBKK, lHKG);
01208 
01209     SegmentDate& lMktBKKHKGSegment =
01210       FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
01211     FacBomManager::addToListAndMap (lSQ1200_20100208_FD, lMktBKKHKGSegment);
01212     FacBomManager::linkWithParent (lSQ1200_20100208_FD, lMktBKKHKGSegment);
01213 
01214     // Fill the (mkt) SegmentDate content
01215     lMktBKKHKGSegment.setBoardingDate (lDate);
01216     lMktBKKHKGSegment.setOffDate (lDate);
01217     lMktBKKHKGSegment.setBoardingTime (l1200);
01218     lMktBKKHKGSegment.setOffTime (l1540);
01219     lMktBKKHKGSegment.setElapsedTime (l0240);
01220 
01221     // Step 0.4: Leg-date level
01222     // Create a first LegDate (SIN) for SQ's Inventory
01223     LegDateKey lLegDateKey (lSIN);
01224 
01225     LegDate& lSINLeg = FacBom<LegDate>::instance().create (lLegDateKey);
01226     FacBomManager::addToListAndMap (lSQ11_20100208_FD, lSINLeg);
01227     FacBomManager::linkWithParent (lSQ11_20100208_FD, lSINLeg);
01228 
01229     // Fill the LegDate content
01230     lSINLeg.setOffPoint (lBKK);
01231     lSINLeg.setBoardingDate (lDate);
01232     lSINLeg.setOffDate (lDate);
01233     lSINLeg.setBoardingTime (l0820);
01234     lSINLeg.setOffTime (l1100);
01235     lSINLeg.setElapsedTime (l0340);
01236 
01237     
01238     // Link the segment-dates with the leg-dates
01239     FacBomManager::addToListAndMap (lSINLeg, lSINBKKSegment);  
01240     FacBomManager::addToListAndMap (lSINBKKSegment, lSINLeg);
01241 
01242     // Step 0.5: segment-cabin level
01243     // Create a SegmentCabin (Y) for the Segment SIN-BKK of SQ's Inventory
01244     const CabinCode_T lY ("Y");
01245     SegmentCabinKey lYSegmentCabinKey (lY);
01246 
01247     SegmentCabin& lSINBKKSegmentYCabin =
01248       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01249     FacBomManager::addToListAndMap (lSINBKKSegment, lSINBKKSegmentYCabin);
01250     FacBomManager::linkWithParent (lSINBKKSegment, lSINBKKSegmentYCabin);
01251 
01252     // Create a SegmentCabin (Y) for the (mkt) Segment BKK-HKG of SQ's Inventory
01253     SegmentCabin& lMktBKKHKGSegmentYCabin =
01254       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01255     FacBomManager::addToListAndMap (lMktBKKHKGSegment, lMktBKKHKGSegmentYCabin);
01256     FacBomManager::linkWithParent (lMktBKKHKGSegment, lMktBKKHKGSegmentYCabin);
01257 
01258 
01259     // Step 0.6: leg-cabin level
01260     // Create a LegCabin (Y) for the Leg SIN-BKK on SQ's Inventory
01261     LegCabinKey lYLegCabinKey (lY);
01262 
01263     LegCabin& lSINLegYCabin =
01264       FacBom<LegCabin>::instance().create (lYLegCabinKey);
01265     FacBomManager::addToListAndMap (lSINLeg, lSINLegYCabin);
01266     FacBomManager::linkWithParent (lSINLeg, lSINLegYCabin);
01267 
01268     CabinCapacity_T lCapacity (100);
01269     lSINLegYCabin.setCapacities (lCapacity);
01270     lSINLegYCabin.setAvailabilityPool (lCapacity);
01271     
01283       FacBomManager::addToListAndMap (lSINLegYCabin, lSINBKKSegmentYCabin,
01284                                     lSINBKKSegmentYCabin.getFullerKey());
01285     
01296       FacBomManager::addToListAndMap (lSINBKKSegmentYCabin, lSINLegYCabin,
01297                                     lSINLegYCabin.getFullerKey());
01298 
01299 
01300     // Step 0.7: fare family level
01301     // Create a FareFamily (1) for the Segment SIN-BKK, cabin Y on SQ's Inv
01302     const FamilyCode_T l1 ("EcoSaver");
01303     FareFamilyKey l1FareFamilyKey (l1);
01304 
01305     FareFamily& lSINBKKSegmentYCabin1Family =
01306       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01307     FacBomManager::addToListAndMap (lSINBKKSegmentYCabin,
01308                                     lSINBKKSegmentYCabin1Family);
01309     FacBomManager::linkWithParent (lSINBKKSegmentYCabin,
01310                                    lSINBKKSegmentYCabin1Family);
01311 
01312     // Create a FareFamily (1) for the (mkt) Segment BKK-HKG, cabin Y on SQ's Inv
01313     FareFamily& lMktBKKHKGSegmentYCabin1Family =
01314       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01315     FacBomManager::addToListAndMap (lMktBKKHKGSegmentYCabin,
01316                                     lMktBKKHKGSegmentYCabin1Family);
01317     FacBomManager::linkWithParent (lMktBKKHKGSegmentYCabin,
01318                                     lMktBKKHKGSegmentYCabin1Family);
01319     
01320     // Step 0.8: booking class level
01321     // Create a BookingClass (Y) for the Segment SIN-BKK, cabin Y,
01322     // fare family 1 on SQ's Inv
01323     BookingClassKey lYBookingClassKey (lY);
01324 
01325     BookingClass& lSINBKKSegmentYCabin1FamilyYClass =
01326       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01327     FacBomManager::addToListAndMap (lSINBKKSegmentYCabin1Family,
01328                                     lSINBKKSegmentYCabin1FamilyYClass);
01329     FacBomManager::linkWithParent (lSINBKKSegmentYCabin1Family,
01330                                    lSINBKKSegmentYCabin1FamilyYClass);
01331 
01332     FacBomManager::addToListAndMap (lSINBKKSegmentYCabin,
01333                                     lSINBKKSegmentYCabin1FamilyYClass);
01334     FacBomManager::addToListAndMap (lSINBKKSegment,
01335                                     lSINBKKSegmentYCabin1FamilyYClass);
01336 
01337     lSINBKKSegmentYCabin1FamilyYClass.setYield(700);
01338 
01339     // Create a BookingClass (Y) for the (mkt) Segment BKK-HKG, cabin Y,
01340     // fare family 1 on SQ's Inv
01341     BookingClass& lMktBKKHKGSegmentYCabin1FamilyYClass =
01342       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01343     FacBomManager::addToListAndMap (lMktBKKHKGSegmentYCabin1Family,
01344                                     lMktBKKHKGSegmentYCabin1FamilyYClass);
01345     FacBomManager::linkWithParent (lMktBKKHKGSegmentYCabin1Family,
01346                                    lMktBKKHKGSegmentYCabin1FamilyYClass);
01347 
01348     FacBomManager::addToListAndMap (lMktBKKHKGSegmentYCabin,
01349                                     lMktBKKHKGSegmentYCabin1FamilyYClass);
01350     FacBomManager::addToListAndMap (lMktBKKHKGSegment,
01351                                     lMktBKKHKGSegmentYCabin1FamilyYClass);
01352 
01353     lMktBKKHKGSegmentYCabin1FamilyYClass.setYield(700);
01354 
01355    
01356     // Create a BookingClass (M) for the Segment SIN-BKK, cabin Y,
01357     // fare family 1 on SQ's Inv
01358     const ClassCode_T lM ("M");
01359     BookingClassKey lMBookingClassKey (lM);
01360 
01361     BookingClass& lSINBKKSegmentYCabin1FamilyMClass =
01362       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01363     FacBomManager::addToListAndMap (lSINBKKSegmentYCabin1Family,
01364                                     lSINBKKSegmentYCabin1FamilyMClass);
01365     FacBomManager::linkWithParent (lSINBKKSegmentYCabin1Family,
01366                                    lSINBKKSegmentYCabin1FamilyMClass);
01367 
01368     FacBomManager::addToListAndMap (lSINBKKSegmentYCabin,
01369                                     lSINBKKSegmentYCabin1FamilyMClass);
01370     FacBomManager::addToListAndMap (lSINBKKSegment,
01371                                     lSINBKKSegmentYCabin1FamilyMClass);
01372 
01373     lSINBKKSegmentYCabin1FamilyMClass.setYield(500);
01374 
01375     // Create a BookingClass (M) for the (mkt) Segment BKK-HKG, cabin Y,
01376     // fare family 1 on SQ's Inv
01377     BookingClass& lMktBKKHKGSegmentYCabin1FamilyMClass =
01378       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01379     FacBomManager::addToListAndMap (lMktBKKHKGSegmentYCabin1Family,
01380                                     lMktBKKHKGSegmentYCabin1FamilyMClass);
01381     FacBomManager::linkWithParent (lMktBKKHKGSegmentYCabin1Family,
01382                                    lMktBKKHKGSegmentYCabin1FamilyMClass);
01383 
01384     FacBomManager::addToListAndMap (lMktBKKHKGSegmentYCabin,
01385                                     lMktBKKHKGSegmentYCabin1FamilyMClass);
01386     FacBomManager::addToListAndMap (lMktBKKHKGSegment,
01387                                     lMktBKKHKGSegmentYCabin1FamilyMClass);
01388 
01389     lMktBKKHKGSegmentYCabin1FamilyMClass.setYield(500);
01390 
01391     /* =================================================================================== */
01392     // Step 0.9: Partner Inventory
01393     // Create a partner Inventory CX for SQ    
01394     const InventoryKey lPartnerCXKey ("CX");
01395     Inventory& lPartnerCXInv = FacBom<Inventory>::instance().create (lPartnerCXKey);
01396     FacBomManager::addToListAndMap (lSQInv, lPartnerCXInv);
01397     FacBomManager::linkWithParent (lSQInv, lPartnerCXInv);
01398 
01399     // Step 0.9.2 : Flight-date level
01400     lFlightNumber = 12;
01401     lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01402 
01403     FlightDate& lPartnerCX12_20100208_FD =
01404       FacBom<FlightDate>::instance().create (lFlightDateKey);
01405     FacBomManager::addToListAndMap (lPartnerCXInv, lPartnerCX12_20100208_FD);
01406     FacBomManager::linkWithParent (lPartnerCXInv, lPartnerCX12_20100208_FD);
01407 
01408     lFlightNumber = 1100;
01409     lMktFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01410 
01411     FlightDate& lPartnerCX1100_20100208_FD =
01412       FacBom<FlightDate>::instance().create (lMktFlightDateKey);
01413     FacBomManager::addToListAndMap (lPartnerCXInv, lPartnerCX1100_20100208_FD);
01414     FacBomManager::linkWithParent (lPartnerCXInv, lPartnerCX1100_20100208_FD);
01415 
01416     // Step 0.9.3: Segment-date level
01417     lSegmentDateKey = SegmentDateKey (lBKK, lHKG);
01418 
01419     SegmentDate& lPartnerBKKHKGSegment =
01420       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
01421     FacBomManager::addToListAndMap (lPartnerCX12_20100208_FD, lPartnerBKKHKGSegment);
01422     FacBomManager::linkWithParent (lPartnerCX12_20100208_FD, lPartnerBKKHKGSegment);
01423 
01424     lPartnerBKKHKGSegment.setBoardingDate (lDate);
01425     lPartnerBKKHKGSegment.setOffDate (lDate);
01426     lPartnerBKKHKGSegment.setBoardingTime (l1200);
01427     lPartnerBKKHKGSegment.setOffTime (l1540);
01428     lPartnerBKKHKGSegment.setElapsedTime (l0240);
01429 
01430     lMktSegmentDateKey = SegmentDateKey (lSIN, lBKK);
01431 
01432     SegmentDate& lPartnerMktSINBKKSegment =
01433       FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
01434     FacBomManager::addToListAndMap (lPartnerCX1100_20100208_FD, lPartnerMktSINBKKSegment);
01435     FacBomManager::linkWithParent (lPartnerCX1100_20100208_FD, lPartnerMktSINBKKSegment);
01436 
01437     lPartnerMktSINBKKSegment.setBoardingDate (lDate);
01438     lPartnerMktSINBKKSegment.setOffDate (lDate);
01439     lPartnerMktSINBKKSegment.setBoardingTime (l0820);
01440     lPartnerMktSINBKKSegment.setOffTime (l1100);
01441     lPartnerMktSINBKKSegment.setElapsedTime (l0340);
01442 
01443     // Step 0.9.4: Leg-date level
01444     lLegDateKey = LegDateKey (lBKK);
01445 
01446     LegDate& lPartnerBKKLeg = FacBom<LegDate>::instance().create (lLegDateKey);
01447     FacBomManager::addToListAndMap (lPartnerCX12_20100208_FD, lPartnerBKKLeg);
01448     FacBomManager::linkWithParent (lPartnerCX12_20100208_FD, lPartnerBKKLeg);
01449 
01450     lPartnerBKKLeg.setOffPoint (lHKG);
01451     lPartnerBKKLeg.setBoardingDate (lDate);
01452     lPartnerBKKLeg.setOffDate (lDate);
01453     lPartnerBKKLeg.setBoardingTime (l1200);
01454     lPartnerBKKLeg.setOffTime (l1540);
01455     lPartnerBKKLeg.setElapsedTime (l0240);
01456 
01457     FacBomManager::addToListAndMap (lPartnerBKKLeg, lPartnerBKKHKGSegment);
01458     FacBomManager::addToListAndMap (lPartnerBKKHKGSegment, lPartnerBKKLeg);
01459 
01460     // Step 9.0.5: segment-cabin level
01461     
01462     SegmentCabin& lPartnerBKKHKGSegmentYCabin =
01463       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01464     FacBomManager::addToListAndMap (lPartnerBKKHKGSegment, lPartnerBKKHKGSegmentYCabin);
01465     FacBomManager::linkWithParent (lPartnerBKKHKGSegment, lPartnerBKKHKGSegmentYCabin);
01466 
01467     SegmentCabin& lPartnerMktSINBKKSegmentYCabin =
01468       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01469     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegment, lPartnerMktSINBKKSegmentYCabin);
01470     FacBomManager::linkWithParent (lPartnerMktSINBKKSegment, lPartnerMktSINBKKSegmentYCabin);
01471 
01472     // Step 9.0.6: leg-cabin level
01473     
01474     LegCabin& lPartnerBKKLegYCabin =
01475       FacBom<LegCabin>::instance().create (lYLegCabinKey);
01476     FacBomManager::addToListAndMap (lPartnerBKKLeg, lPartnerBKKLegYCabin);
01477     FacBomManager::linkWithParent (lPartnerBKKLeg, lPartnerBKKLegYCabin);
01478 
01479     lCapacity = CabinCapacity_T(999);
01480     lPartnerBKKLegYCabin.setCapacities (lCapacity);
01481     lPartnerBKKLegYCabin.setAvailabilityPool (lCapacity);
01482 
01483     FacBomManager::addToListAndMap (lPartnerBKKLegYCabin, lPartnerBKKHKGSegmentYCabin,
01484                                     lPartnerBKKHKGSegmentYCabin.getFullerKey());
01485     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin, lPartnerBKKLegYCabin,
01486                                     lPartnerBKKLegYCabin.getFullerKey());
01487 
01488     // Step 9.0.7: fare family level
01489     
01490     FareFamily& lPartnerBKKHKGSegmentYCabin1Family =
01491       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01492     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin,
01493                                     lPartnerBKKHKGSegmentYCabin1Family);
01494     FacBomManager::linkWithParent (lPartnerBKKHKGSegmentYCabin,
01495                                    lPartnerBKKHKGSegmentYCabin1Family);
01496 
01497     FareFamily& lPartnerMktSINBKKSegmentYCabin1Family =
01498       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01499     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegmentYCabin,
01500                                     lPartnerMktSINBKKSegmentYCabin1Family);
01501     FacBomManager::linkWithParent (lPartnerMktSINBKKSegmentYCabin,
01502                                    lPartnerMktSINBKKSegmentYCabin1Family);
01503 
01504     // Step 9.0.8: booking class level
01505 
01506     BookingClass& lPartnerBKKHKGSegmentYCabin1FamilyYClass =
01507       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01508     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin1Family,
01509                                     lPartnerBKKHKGSegmentYCabin1FamilyYClass);
01510     FacBomManager::linkWithParent (lPartnerBKKHKGSegmentYCabin1Family,
01511                                    lPartnerBKKHKGSegmentYCabin1FamilyYClass);
01512 
01513     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin,
01514                                     lPartnerBKKHKGSegmentYCabin1FamilyYClass);
01515     FacBomManager::addToListAndMap (lPartnerBKKHKGSegment,
01516                                     lPartnerBKKHKGSegmentYCabin1FamilyYClass);
01517 
01518     BookingClass& lPartnerMktSINBKKSegmentYCabin1FamilyYClass =
01519       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01520     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegmentYCabin1Family,
01521                                     lPartnerMktSINBKKSegmentYCabin1FamilyYClass);
01522     FacBomManager::linkWithParent (lPartnerMktSINBKKSegmentYCabin1Family,
01523                                    lPartnerMktSINBKKSegmentYCabin1FamilyYClass);
01524 
01525     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegmentYCabin,
01526                                     lPartnerMktSINBKKSegmentYCabin1FamilyYClass);
01527     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegment,
01528                                     lPartnerMktSINBKKSegmentYCabin1FamilyYClass);
01529     
01530     BookingClass& lPartnerBKKHKGSegmentYCabin1FamilyMClass =
01531       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01532     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin1Family,
01533                                     lPartnerBKKHKGSegmentYCabin1FamilyMClass);
01534     FacBomManager::linkWithParent (lPartnerBKKHKGSegmentYCabin1Family,
01535                                    lPartnerBKKHKGSegmentYCabin1FamilyMClass);
01536 
01537     FacBomManager::addToListAndMap (lPartnerBKKHKGSegmentYCabin,
01538                                     lPartnerBKKHKGSegmentYCabin1FamilyMClass);
01539     FacBomManager::addToListAndMap (lPartnerBKKHKGSegment,
01540                                     lPartnerBKKHKGSegmentYCabin1FamilyMClass);
01541 
01542     BookingClass& lPartnerMktSINBKKSegmentYCabin1FamilyMClass =
01543       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01544     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegmentYCabin1Family,
01545                                     lPartnerMktSINBKKSegmentYCabin1FamilyMClass);
01546     FacBomManager::linkWithParent (lPartnerMktSINBKKSegmentYCabin1Family,
01547                                    lPartnerMktSINBKKSegmentYCabin1FamilyMClass);
01548 
01549     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegmentYCabin,
01550                                     lPartnerMktSINBKKSegmentYCabin1FamilyMClass);
01551     FacBomManager::addToListAndMap (lPartnerMktSINBKKSegment,
01552                                     lPartnerMktSINBKKSegmentYCabin1FamilyMClass);    
01553 
01554     // Step 9.0.9: link SQ inventory objects to Partner CX inventory objects
01555 
01556     FacBomManager::addToList (lSINBKKSegment, lPartnerMktSINBKKSegment);
01557 
01558     lMktBKKHKGSegment.linkWithOperating (lPartnerBKKHKGSegment);
01559     
01560     /* =================================================================================== */
01561 
01562     // Step 1.0: O&D level
01563     // Create an O&D Date (SQ11/08-FEB-2010/SIN-BKK-SQ1200/08-FEB-2010/BKK-HKG) for SQ's Inventory
01564     OnDString_T lSQSINBKKOnDStr = "SQ;11,2010-Feb-08;SIN,BKK";
01565     OnDString_T lMktSQBKKHKGOnDStr = "SQ;1200,2010-Feb-08;BKK,HKG";
01566     OnDStringList_T lOnDStringList;
01567     lOnDStringList.push_back (lSQSINBKKOnDStr);
01568     lOnDStringList.push_back (lMktSQBKKHKGOnDStr);
01569 
01570     OnDDateKey lOnDDateKey (lOnDStringList);
01571     OnDDate& lSQ_SINHKG_OnDDate =
01572       FacBom<OnDDate>::instance().create (lOnDDateKey);
01573     // Link to the inventory
01574     FacBomManager::addToListAndMap (lSQInv, lSQ_SINHKG_OnDDate);
01575     FacBomManager::linkWithParent (lSQInv, lSQ_SINHKG_OnDDate);
01576 
01577     // Add the segments
01578     FacBomManager::addToListAndMap (lSQ_SINHKG_OnDDate, lSINBKKSegment);
01579     FacBomManager::addToListAndMap (lSQ_SINHKG_OnDDate, lMktBKKHKGSegment);
01580 
01581     // Add total forecast info for cabin Y.
01582     const MeanStdDevPair_T lMean60StdDev6 (60.0, 6.0);
01583     const WTP_T lWTP750 = 750.0;
01584     const WTPDemandPair_T lWTP750Mean60StdDev6 (lWTP750, lMean60StdDev6);
01585     lSQ_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
01586 
01587     // Add demand info (optional).
01588     // 2 legs here, so 2 CabinClassPair to add in the list.
01589     // Fist leg: cabin Y, class M.
01590     CabinClassPair_T lCC_YM1 (lY,lM);
01591     // Second leg: cabin Y, class M too.
01592     CabinClassPair_T lCC_YM2 (lY,lM);
01593     CabinClassPairList_T lCabinClassPairList;
01594     lCabinClassPairList.push_back(lCC_YM1);
01595     lCabinClassPairList.push_back(lCC_YM2);
01596     const MeanStdDevPair_T lMean20StdDev2 (20.0, 2.0);
01597     const Yield_T lYield850 = 850.0;
01598     const YieldDemandPair_T lYield850Mean20StdDev2 (lYield850, lMean20StdDev2);
01599     lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield850Mean20StdDev2);
01600     
01601     CabinClassPair_T lCC_YY1 (lY,lY);
01602     CabinClassPair_T lCC_YY2 (lY,lY);
01603     lCabinClassPairList.clear();
01604     lCabinClassPairList.push_back(lCC_YY1);
01605     lCabinClassPairList.push_back(lCC_YY2);
01606     const MeanStdDevPair_T lMean10StdDev1 (10.0, 1.0);
01607     const Yield_T lYield1200 = 1200.0;
01608     const YieldDemandPair_T lYield1200Mean10StdDev1 (lYield1200, lMean10StdDev1);
01609     lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield1200Mean10StdDev1);
01610 
01611     // Create an O&D Date (SQ11/08-FEB-2010/SIN-BKK) for SQ's Inventory
01612     lOnDStringList.clear();
01613     lOnDStringList.push_back (lSQSINBKKOnDStr);
01614 
01615     lOnDDateKey = OnDDateKey(lOnDStringList);
01616     OnDDate& lSQ_SINBKK_OnDDate =
01617       FacBom<OnDDate>::instance().create (lOnDDateKey);
01618     // Link to the inventory
01619     FacBomManager::addToListAndMap (lSQInv, lSQ_SINBKK_OnDDate);
01620     FacBomManager::linkWithParent (lSQInv, lSQ_SINBKK_OnDDate);
01621 
01622     // Add the segments
01623     FacBomManager::addToListAndMap (lSQ_SINBKK_OnDDate, lSINBKKSegment);
01624 
01625     // Add total forecast info for cabin Y.
01626     const WTP_T lWTP400 = 400.0;
01627     const WTPDemandPair_T lWTP400Mean60StdDev6 (lWTP400, lMean60StdDev6);
01628     lSQ_SINBKK_OnDDate.setTotalForecast (lY, lWTP400Mean60StdDev6);
01629 
01630     // Add demand info (optional).
01631     lCabinClassPairList.clear();
01632     lCabinClassPairList.push_back(lCC_YM1);
01633     const MeanStdDevPair_T lMean20StdDev1 (20.0, 1.0);
01634     const Yield_T lYield500 = 500.0;
01635     const YieldDemandPair_T lYield500Mean20StdDev1 (lYield500, lMean20StdDev1);
01636     lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList, lYield500Mean20StdDev1);
01637 
01638     lCabinClassPairList.clear();
01639     lCabinClassPairList.push_back(lCC_YY1);
01640     const Yield_T lYield700 = 700.0;
01641     const YieldDemandPair_T lYield700Mean20StdDev1 (lYield700, lMean10StdDev1 );
01642     lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList, lYield700Mean20StdDev1);
01643 
01644     /*******************************************************************************
01645     // Create an O&D Date (SQ1200/08-FEB-2010/BKK-HKG) for SQ's Inventory
01646     lFullKeyList.clear();
01647     lFullKeyList.push_back (lMktSQBKKHKGFullKeyStr);
01648 
01649     lOnDDateKey = OnDDateKey(lFullKeyList);
01650     OnDDate& lMktSQ_BKKHKG_OnDDate =
01651       FacBom<OnDDate>::instance().create (lOnDDateKey);
01652     // Link to the inventory
01653     FacBomManager::addToListAndMap (lSQInv, lMktSQ_BKKHKG_OnDDate);
01654     FacBomManager::linkWithParent (lSQInv, lMktSQ_BKKHKG_OnDDate);
01655 
01656     // Add the segments
01657     FacBomManager::addToListAndMap (lMktSQ_BKKHKG_OnDDate, lMktBKKHKGSegment);
01658 
01659     // Demand info is not added for purely marketed O&Ds
01660     // Add demand info
01661     // lCabinClassPairList.clear();
01662     // lCabinClassPairList.push_back(lCC_YM2);
01663     // lMktSQ_BKKHKG_OnDDate.setDemandInformation (lCabinClassPairList, 500.0, 20.0, 1.0);
01664     ***********************************************************************************/
01665     
01666             
01667     // ////// CX ///////    
01668     // Step 0.2: Flight-date level
01669     // Create a FlightDate (CX12/08-FEB-2010) for CX's Inventory
01670     lFlightNumber = 12;
01671     //lDate = Date_T (2010, 2, 8);
01672     lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01673 
01674     FlightDate& lCX12_20100208_FD =
01675       FacBom<FlightDate>::instance().create (lFlightDateKey);
01676     FacBomManager::addToListAndMap (lCXInv, lCX12_20100208_FD);
01677     FacBomManager::linkWithParent (lCXInv, lCX12_20100208_FD);
01678 
01679     // Create a (mkt) FlightDate (CX1100/08-FEB-2010) for CX's Inventory
01680     lFlightNumber = 1100;
01681     //lDate = Date_T (2010, 2, 8);
01682     lMktFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01683 
01684     FlightDate& lCX1100_20100208_FD =
01685       FacBom<FlightDate>::instance().create (lMktFlightDateKey);
01686     FacBomManager::addToListAndMap (lCXInv, lCX1100_20100208_FD);
01687     FacBomManager::linkWithParent (lCXInv, lCX1100_20100208_FD);
01688     
01689     // Display the flight-date
01690     // STDAIR_LOG_DEBUG ("FlightDate: " << lAF084_20110320_FD.toString());
01691 
01692     // Step 0.3: Segment-date level
01693     // Create a SegmentDate BKK-HKG for CX's Inventory
01694     
01695     lSegmentDateKey = SegmentDateKey (lBKK, lHKG);
01696 
01697     SegmentDate& lBKKHKGSegment =
01698       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
01699     FacBomManager::addToListAndMap (lCX12_20100208_FD, lBKKHKGSegment);
01700     FacBomManager::linkWithParent (lCX12_20100208_FD, lBKKHKGSegment);  
01701 
01702     // Fill the SegmentDate content
01703     lBKKHKGSegment.setBoardingDate (lDate);
01704     lBKKHKGSegment.setOffDate (lDate);
01705     lBKKHKGSegment.setBoardingTime (l1200);
01706     lBKKHKGSegment.setOffTime (l1540);
01707     lBKKHKGSegment.setElapsedTime (l0240);
01708 
01709     // Create a second (mkt) SegmentDate (SIN-BKK) for CX's Inventory
01710     lMktSegmentDateKey = SegmentDateKey (lSIN, lBKK);
01711 
01712     SegmentDate& lMktSINBKKSegment =
01713       FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
01714     FacBomManager::addToListAndMap (lCX1100_20100208_FD, lMktSINBKKSegment);
01715     FacBomManager::linkWithParent (lCX1100_20100208_FD, lMktSINBKKSegment);
01716 
01717     // Fill the (mkt) SegmentDate content
01718     lMktSINBKKSegment.setBoardingDate (lDate);
01719     lMktSINBKKSegment.setOffDate (lDate);
01720     lMktSINBKKSegment.setBoardingTime (l0820);
01721     lMktSINBKKSegment.setOffTime (l1100);
01722     lMktSINBKKSegment.setElapsedTime (l0340);
01723 
01724     // Step 0.4: Leg-date level
01725     // Create a LegDate (BKK) for CX's Inventory
01726     lLegDateKey = LegDateKey (lBKK);
01727 
01728     LegDate& lBKKLeg = FacBom<LegDate>::instance().create (lLegDateKey);
01729     FacBomManager::addToListAndMap (lCX12_20100208_FD, lBKKLeg);
01730     FacBomManager::linkWithParent (lCX12_20100208_FD, lBKKLeg);
01731 
01732     // Fill the LegDate content
01733     lBKKLeg.setOffPoint (lHKG);
01734     lBKKLeg.setBoardingDate (lDate);
01735     lBKKLeg.setOffDate (lDate);
01736     lBKKLeg.setBoardingTime (l1200);
01737     lBKKLeg.setOffTime (l1540);
01738     lBKKLeg.setElapsedTime (l0240);
01739 
01740     // Display the leg-date
01741     // STDAIR_LOG_DEBUG ("LegDate: " << lCDGLeg.toString());
01742 
01743     // Link the segment-dates with the leg-dates
01744     FacBomManager::addToListAndMap (lBKKLeg, lBKKHKGSegment);
01745     FacBomManager::addToListAndMap (lBKKHKGSegment, lBKKLeg);
01746 
01747     // Step 0.5: segment-cabin level
01748     // Create a SegmentCabin (Y) for the Segment BKK-HKG of CX's Inventory
01749     SegmentCabin& lBKKHKGSegmentYCabin =
01750       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01751     FacBomManager::addToListAndMap (lBKKHKGSegment, lBKKHKGSegmentYCabin);
01752     FacBomManager::linkWithParent (lBKKHKGSegment, lBKKHKGSegmentYCabin);
01753 
01754     // Create a SegmentCabin (Y) for the (mkt) Segment SIN-BKK of CX's Inventory
01755     SegmentCabin& lMktSINBKKSegmentYCabin =
01756       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01757     FacBomManager::addToListAndMap (lMktSINBKKSegment, lMktSINBKKSegmentYCabin);
01758     FacBomManager::linkWithParent (lMktSINBKKSegment, lMktSINBKKSegmentYCabin);
01759 
01760     // Step 0.6: leg-cabin level
01761     // Create a LegCabin (Y) for the Leg BKK-HKG on CX's Inventory
01762     LegCabin& lBKKLegYCabin =
01763       FacBom<LegCabin>::instance().create (lYLegCabinKey);
01764     FacBomManager::addToListAndMap (lBKKLeg, lBKKLegYCabin);
01765     FacBomManager::linkWithParent (lBKKLeg, lBKKLegYCabin);
01766 
01767     lCapacity = CabinCapacity_T(100);
01768     lBKKLegYCabin.setCapacities (lCapacity);
01769     lBKKLegYCabin.setAvailabilityPool (lCapacity);
01770 
01771     // Link the segment-dates with the leg-dates
01772     FacBomManager::addToListAndMap (lBKKLegYCabin, lBKKHKGSegmentYCabin,
01773                                     lBKKHKGSegmentYCabin.getFullerKey());
01774     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin, lBKKLegYCabin,
01775                                     lBKKLegYCabin.getFullerKey());
01776    
01777     // Step 0.7: fare family level
01778     // Create a fareFamily (1) for the Segment BKK-HKG, cabin Y on CX's Inv
01779     FareFamily& lBKKHKGSegmentYCabin1Family =
01780       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01781     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin,
01782                                     lBKKHKGSegmentYCabin1Family);
01783     FacBomManager::linkWithParent (lBKKHKGSegmentYCabin,
01784                                    lBKKHKGSegmentYCabin1Family);
01785 
01786     // Create a FareFamily (1) for the (mkt) Segment SIN-BKK, cabin Y on CX's Inv
01787     FareFamily& lMktSINBKKSegmentYCabin1Family =
01788       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01789     FacBomManager::addToListAndMap (lMktSINBKKSegmentYCabin,
01790                                     lMktSINBKKSegmentYCabin1Family);
01791     FacBomManager::linkWithParent (lMktSINBKKSegmentYCabin,
01792                                    lMktSINBKKSegmentYCabin1Family);
01793 
01794     
01795     // Step 0.8: booking class level
01796     // Create a BookingClass (Y) for the
01797     // Segment BKK-HKG, cabin Y, fare family 1 on CX's Inv
01798     BookingClass& lBKKHKGSegmentYCabin1FamilyYClass =
01799       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01800     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin1Family,
01801                                     lBKKHKGSegmentYCabin1FamilyYClass);
01802     FacBomManager::linkWithParent (lBKKHKGSegmentYCabin1Family,
01803                                    lBKKHKGSegmentYCabin1FamilyYClass);
01804 
01805     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin,
01806                                     lBKKHKGSegmentYCabin1FamilyYClass);
01807     FacBomManager::addToListAndMap (lBKKHKGSegment,
01808                                     lBKKHKGSegmentYCabin1FamilyYClass);
01809 
01810     lBKKHKGSegmentYCabin1FamilyYClass.setYield(700);
01811 
01812     // Create a BookingClass (Y) for the (mkt) Segment SIN-BKK, cabin Y,
01813     // fare family 1 on CX's Inv
01814     BookingClass& lMktSINBKKSegmentYCabin1FamilyYClass =
01815       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01816     FacBomManager::addToListAndMap (lMktSINBKKSegmentYCabin1Family,
01817                                     lMktSINBKKSegmentYCabin1FamilyYClass);
01818     FacBomManager::linkWithParent (lMktSINBKKSegmentYCabin1Family,
01819                                    lMktSINBKKSegmentYCabin1FamilyYClass);
01820 
01821     FacBomManager::addToListAndMap (lMktSINBKKSegmentYCabin,
01822                                     lMktSINBKKSegmentYCabin1FamilyYClass);
01823     FacBomManager::addToListAndMap (lMktSINBKKSegment,
01824                                     lMktSINBKKSegmentYCabin1FamilyYClass);
01825 
01826     lMktSINBKKSegmentYCabin1FamilyYClass.setYield(700);
01827     
01828     //Create a BookingClass (M) for the
01829     // Segment BKK-HKG, cabin Y, fare family 1 on CX's Inv
01830     BookingClass& lBKKHKGSegmentYCabin1FamilyMClass =
01831       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01832     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin1Family,
01833                                     lBKKHKGSegmentYCabin1FamilyMClass);
01834     FacBomManager::linkWithParent (lBKKHKGSegmentYCabin1Family,
01835                                    lBKKHKGSegmentYCabin1FamilyMClass);
01836 
01837     FacBomManager::addToListAndMap (lBKKHKGSegmentYCabin,
01838                                     lBKKHKGSegmentYCabin1FamilyMClass);
01839     FacBomManager::addToListAndMap (lBKKHKGSegment,
01840                                     lBKKHKGSegmentYCabin1FamilyMClass);
01841 
01842     lBKKHKGSegmentYCabin1FamilyMClass.setYield(500);
01843 
01844     // Create a BookingClass (M) for the (mkt) Segment SIN-BKK, cabin Y,
01845     // fare family 1 on CX's Inv
01846     BookingClass& lMktSINBKKSegmentYCabin1FamilyMClass =
01847       FacBom<BookingClass>::instance().create (lMBookingClassKey);
01848     FacBomManager::addToListAndMap (lMktSINBKKSegmentYCabin1Family,
01849                                     lMktSINBKKSegmentYCabin1FamilyMClass);
01850     FacBomManager::linkWithParent (lMktSINBKKSegmentYCabin1Family,
01851                                    lMktSINBKKSegmentYCabin1FamilyMClass);
01852 
01853     FacBomManager::addToListAndMap (lMktSINBKKSegmentYCabin,
01854                                     lMktSINBKKSegmentYCabin1FamilyMClass);
01855     FacBomManager::addToListAndMap (lMktSINBKKSegment,
01856                                     lMktSINBKKSegmentYCabin1FamilyMClass);
01857 
01858     lMktSINBKKSegmentYCabin1FamilyMClass.setYield(500);
01859 
01860     /* =================================================================================== */
01861     // Step 0.9: Partner Inventory
01862     // Create a partner Inventory SQ for CX   
01863     const InventoryKey lPartnerSQKey ("SQ");
01864     Inventory& lPartnerSQInv = FacBom<Inventory>::instance().create (lPartnerSQKey);
01865     FacBomManager::addToListAndMap (lCXInv, lPartnerSQInv);
01866     FacBomManager::linkWithParent (lCXInv, lPartnerSQInv);
01867 
01868     // Step 0.9.2 : Flight-date level
01869     lFlightNumber = 11;
01870     lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01871 
01872     FlightDate& lPartnerSQ11_20100208_FD =
01873       FacBom<FlightDate>::instance().create (lFlightDateKey);
01874     FacBomManager::addToListAndMap (lPartnerSQInv, lPartnerSQ11_20100208_FD);
01875     FacBomManager::linkWithParent (lPartnerSQInv, lPartnerSQ11_20100208_FD);
01876 
01877     lFlightNumber = 1200;
01878     lMktFlightDateKey = FlightDateKey (lFlightNumber, lDate);
01879 
01880     FlightDate& lPartnerSQ1200_20100208_FD =
01881       FacBom<FlightDate>::instance().create (lMktFlightDateKey);
01882     FacBomManager::addToListAndMap (lPartnerSQInv, lPartnerSQ1200_20100208_FD);
01883     FacBomManager::linkWithParent (lPartnerSQInv, lPartnerSQ1200_20100208_FD);
01884 
01885     // Step 0.9.3: Segment-date level
01886     lSegmentDateKey = SegmentDateKey (lSIN, lBKK);
01887 
01888     SegmentDate& lPartnerSINBKKSegment =
01889       FacBom<SegmentDate>::instance().create (lSegmentDateKey);
01890     FacBomManager::addToListAndMap (lPartnerSQ11_20100208_FD, lPartnerSINBKKSegment);
01891     FacBomManager::linkWithParent (lPartnerSQ11_20100208_FD, lPartnerSINBKKSegment);
01892     
01893     lPartnerSINBKKSegment.setBoardingDate (lDate);
01894     lPartnerSINBKKSegment.setOffDate (lDate);
01895     lPartnerSINBKKSegment.setBoardingTime (l0820);
01896     lPartnerSINBKKSegment.setOffTime (l1100);
01897     lPartnerSINBKKSegment.setElapsedTime (l0340);
01898     
01899     lMktSegmentDateKey = SegmentDateKey (lBKK, lHKG);
01900 
01901     SegmentDate& lPartnerMktBKKHKGSegment =
01902       FacBom<SegmentDate>::instance().create (lMktSegmentDateKey);
01903     FacBomManager::addToListAndMap (lPartnerSQ1200_20100208_FD, lPartnerMktBKKHKGSegment);
01904     FacBomManager::linkWithParent (lPartnerSQ1200_20100208_FD, lPartnerMktBKKHKGSegment);
01905 
01906     lPartnerMktBKKHKGSegment.setBoardingDate (lDate);
01907     lPartnerMktBKKHKGSegment.setOffDate (lDate);
01908     lPartnerMktBKKHKGSegment.setBoardingTime (l1200);
01909     lPartnerMktBKKHKGSegment.setOffTime (l1540);
01910     lPartnerMktBKKHKGSegment.setElapsedTime (l0240);
01911   
01912     // Step 0.9.4: Leg-date level
01913     lLegDateKey = LegDateKey (lSIN);
01914 
01915     LegDate& lPartnerSINLeg = FacBom<LegDate>::instance().create (lLegDateKey);
01916     FacBomManager::addToListAndMap (lPartnerSQ11_20100208_FD, lPartnerSINLeg);
01917     FacBomManager::linkWithParent (lPartnerSQ11_20100208_FD, lPartnerSINLeg);
01918 
01919     lPartnerSINLeg.setOffPoint (lBKK);
01920     lPartnerSINLeg.setBoardingDate (lDate);
01921     lPartnerSINLeg.setOffDate (lDate);
01922     lPartnerSINLeg.setBoardingTime (l0820);
01923     lPartnerSINLeg.setOffTime (l1100);
01924     lPartnerSINLeg.setElapsedTime (l0340);
01925 
01926     FacBomManager::addToListAndMap (lPartnerSINLeg, lPartnerSINBKKSegment);
01927     FacBomManager::addToListAndMap (lPartnerSINBKKSegment, lPartnerSINLeg);
01928 
01929     // Step 9.0.5: segment-cabin level
01930 
01931     SegmentCabin& lPartnerSINBKKSegmentYCabin =
01932       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01933     FacBomManager::addToListAndMap (lPartnerSINBKKSegment, lPartnerSINBKKSegmentYCabin);
01934     FacBomManager::linkWithParent (lPartnerSINBKKSegment, lPartnerSINBKKSegmentYCabin);
01935     
01936     SegmentCabin& lPartnerMktBKKHKGSegmentYCabin =
01937       FacBom<SegmentCabin>::instance().create (lYSegmentCabinKey);
01938     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegment, lPartnerMktBKKHKGSegmentYCabin);
01939     FacBomManager::linkWithParent (lPartnerMktBKKHKGSegment, lPartnerMktBKKHKGSegmentYCabin);
01940     
01941     // Step 9.0.6: leg-cabin level
01942     
01943     LegCabin& lPartnerSINLegYCabin =
01944       FacBom<LegCabin>::instance().create (lYLegCabinKey);
01945     FacBomManager::addToListAndMap (lPartnerSINLeg, lPartnerSINLegYCabin);
01946     FacBomManager::linkWithParent (lPartnerSINLeg, lPartnerSINLegYCabin);
01947 
01948     lCapacity = CabinCapacity_T(999);
01949     lPartnerSINLegYCabin.setCapacities (lCapacity);
01950     lPartnerSINLegYCabin.setAvailabilityPool (lCapacity);
01951 
01952     FacBomManager::addToListAndMap (lPartnerSINLegYCabin, lPartnerSINBKKSegmentYCabin,
01953                                     lPartnerSINBKKSegmentYCabin.getFullerKey());
01954     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin, lPartnerSINLegYCabin,
01955                                     lPartnerSINLegYCabin.getFullerKey());
01956 
01957     // Step 9.0.7: fare family level
01958 
01959     FareFamily& lPartnerSINBKKSegmentYCabin1Family =
01960       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01961     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin,
01962                                     lPartnerSINBKKSegmentYCabin1Family);
01963     FacBomManager::linkWithParent (lPartnerSINBKKSegmentYCabin,
01964                                    lPartnerSINBKKSegmentYCabin1Family);
01965     
01966     FareFamily& lPartnerMktBKKHKGSegmentYCabin1Family =
01967       FacBom<FareFamily>::instance().create (l1FareFamilyKey);
01968     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegmentYCabin,
01969                                     lPartnerMktBKKHKGSegmentYCabin1Family);
01970     FacBomManager::linkWithParent (lPartnerMktBKKHKGSegmentYCabin,
01971                                    lPartnerMktBKKHKGSegmentYCabin1Family);
01972 
01973     
01974     // Step 9.0.8: booking class level
01975 
01976     BookingClass& lPartnerSINBKKSegmentYCabin1FamilyYClass =
01977       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01978     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin1Family,
01979                                     lPartnerSINBKKSegmentYCabin1FamilyYClass);
01980     FacBomManager::linkWithParent (lPartnerSINBKKSegmentYCabin1Family,
01981                                    lPartnerSINBKKSegmentYCabin1FamilyYClass);
01982 
01983     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin,
01984                                     lPartnerSINBKKSegmentYCabin1FamilyYClass);
01985     FacBomManager::addToListAndMap (lPartnerSINBKKSegment,
01986                                     lPartnerSINBKKSegmentYCabin1FamilyYClass);
01987 
01988     BookingClass& lPartnerMktBKKHKGSegmentYCabin1FamilyYClass =
01989       FacBom<BookingClass>::instance().create (lYBookingClassKey);
01990     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegmentYCabin1Family,
01991                                     lPartnerMktBKKHKGSegmentYCabin1FamilyYClass);
01992     FacBomManager::linkWithParent (lPartnerMktBKKHKGSegmentYCabin1Family,
01993                                    lPartnerMktBKKHKGSegmentYCabin1FamilyYClass);
01994 
01995     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegmentYCabin,
01996                                     lPartnerMktBKKHKGSegmentYCabin1FamilyYClass);
01997     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegment,
01998                                     lPartnerMktBKKHKGSegmentYCabin1FamilyYClass);    
01999     
02000     BookingClass& lPartnerSINBKKSegmentYCabin1FamilyMClass =
02001       FacBom<BookingClass>::instance().create (lMBookingClassKey);
02002     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin1Family,
02003                                     lPartnerSINBKKSegmentYCabin1FamilyMClass);
02004     FacBomManager::linkWithParent (lPartnerSINBKKSegmentYCabin1Family,
02005                                    lPartnerSINBKKSegmentYCabin1FamilyMClass);
02006 
02007     FacBomManager::addToListAndMap (lPartnerSINBKKSegmentYCabin,
02008                                     lPartnerSINBKKSegmentYCabin1FamilyMClass);
02009     FacBomManager::addToListAndMap (lPartnerSINBKKSegment,
02010                                     lPartnerSINBKKSegmentYCabin1FamilyMClass);
02011 
02012     BookingClass& lPartnerMktBKKHKGSegmentYCabin1FamilyMClass =
02013       FacBom<BookingClass>::instance().create (lMBookingClassKey);
02014     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegmentYCabin1Family,
02015                                     lPartnerMktBKKHKGSegmentYCabin1FamilyMClass);
02016     FacBomManager::linkWithParent (lPartnerMktBKKHKGSegmentYCabin1Family,
02017                                    lPartnerMktBKKHKGSegmentYCabin1FamilyMClass);
02018 
02019     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegmentYCabin,
02020                                     lPartnerMktBKKHKGSegmentYCabin1FamilyMClass);
02021     FacBomManager::addToListAndMap (lPartnerMktBKKHKGSegment,
02022                                     lPartnerMktBKKHKGSegmentYCabin1FamilyMClass);
02023 
02024     // Step 9.0.9: link CX inventory objects to Partner SQ inventory objects
02025     FacBomManager::addToList (lBKKHKGSegment, lPartnerMktBKKHKGSegment);
02026 
02027     lMktSINBKKSegment.linkWithOperating (lPartnerSINBKKSegment);
02028 
02029     /* =================================================================================== */
02030 
02031     // Step 1.0: O&D level
02032     // Create an O&D Date (CX1100/08-FEB-2010/SIN-BKK-CX12/08-FEB-2010/BKK-HKG) for CX's Inventory
02033     OnDString_T lMktCXSINBKKOnDStr = "CX;1100,2010-Feb-08;SIN,BKK";
02034     OnDString_T lCXBKKHKGOnDStr = "CX;12,2010-Feb-08;BKK,HKG";
02035     lOnDStringList.clear();
02036     lOnDStringList.push_back (lMktCXSINBKKOnDStr);
02037     lOnDStringList.push_back (lCXBKKHKGOnDStr);
02038 
02039     lOnDDateKey = OnDDateKey(lOnDStringList);
02040     OnDDate& lCX_SINHKG_OnDDate =
02041       FacBom<OnDDate>::instance().create (lOnDDateKey);
02042     // Link to the inventory
02043     FacBomManager::addToListAndMap (lCXInv, lCX_SINHKG_OnDDate);
02044     FacBomManager::linkWithParent (lCXInv, lCX_SINHKG_OnDDate);
02045 
02046     // Add the segments
02047     FacBomManager::addToListAndMap (lCX_SINHKG_OnDDate, lMktSINBKKSegment);
02048     FacBomManager::addToListAndMap (lCX_SINHKG_OnDDate, lBKKHKGSegment);
02049 
02050     // Add total forecast info for cabin Y.
02051     lCX_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
02052     
02053     // Add demand info
02054     lCabinClassPairList.clear();
02055     lCabinClassPairList.push_back(lCC_YM1);
02056     lCabinClassPairList.push_back(lCC_YM2);
02057     lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield850Mean20StdDev2);
02058 
02059     lCabinClassPairList.clear();
02060     lCabinClassPairList.push_back(lCC_YY1);
02061     lCabinClassPairList.push_back(lCC_YY2);
02062     lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield1200Mean10StdDev1);
02063 
02064     /***********************************************************************************
02065     // Create an O&D Date (CX1100/08-FEB-2010/SIN-BKK) for CX's Inventory
02066     lFullKeyList.clear();
02067     lFullKeyList.push_back (lMktCXSINBKKFullKeyStr);
02068 
02069     lOnDDateKey = OnDDateKey(lFullKeyList);
02070     OnDDate& lMktCX_SINBKK_OnDDate =
02071       FacBom<OnDDate>::instance().create (lOnDDateKey);
02072     // Link to the inventory
02073     FacBomManager::addToListAndMap (lCXInv, lMktCX_SINBKK_OnDDate);
02074     FacBomManager::linkWithParent (lCXInv, lMktCX_SINBKK_OnDDate);
02075 
02076     // Add the segments
02077     FacBomManager::addToListAndMap (lMktCX_SINBKK_OnDDate, lMktSINBKKSegment);
02078 
02079     // Demand info is not added for purely marketed O&Ds
02080     // Add demand info
02081     // lCabinClassPairList.clear();
02082     // lCabinClassPairList.push_back(lCC_YM1);
02083     // lMktCX_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList, 500.0, 20.0, 1.0);
02084     *************************************************************************************/
02085     
02086     // Create an O&D Date (CX12/08-FEB-2010/BKK-HKG) for CX's Inventory
02087     lOnDStringList.clear();
02088     lOnDStringList.push_back (lCXBKKHKGOnDStr);
02089 
02090     lOnDDateKey = OnDDateKey(lOnDStringList);
02091     OnDDate& lCX_BKKHKG_OnDDate =
02092       FacBom<OnDDate>::instance().create (lOnDDateKey);
02093     // Link to the inventory
02094     FacBomManager::addToListAndMap (lCXInv, lCX_BKKHKG_OnDDate);
02095     FacBomManager::linkWithParent (lCXInv, lCX_BKKHKG_OnDDate);
02096 
02097     // Add the segments
02098     FacBomManager::addToListAndMap (lCX_BKKHKG_OnDDate, lBKKHKGSegment);
02099 
02100     // Add total forecast info for cabin Y.
02101     lCX_BKKHKG_OnDDate.setTotalForecast (lY, lWTP400Mean60StdDev6);
02102 
02103     // Add demand info
02104     lCabinClassPairList.clear();
02105     lCabinClassPairList.push_back(lCC_YM2);
02106     lCX_BKKHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield500Mean20StdDev1);
02107 
02108     lCabinClassPairList.clear();
02109     lCabinClassPairList.push_back(lCC_YY2);
02110     const YieldDemandPair_T lYield700Mean10StdDev1 (lYield700, lMean10StdDev1 );
02111     lCX_BKKHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield700Mean10StdDev1);
02112 
02113     /*================================================================================
02114       ================================================================================
02115       ================================================================================*/
02116     // Schedule:
02117     // SQ:
02118     // Step 1: flight period level
02119     // Create a flight period for SQ11:
02120     const DoWStruct lDoWSrtuct ("1111111");
02121     const Date_T lDateRangeStart (2010, boost::gregorian::Feb, 8);
02122     const Date_T lDateRangeEnd (2010, boost::gregorian::Feb, 9);
02123     const DatePeriod_T lDatePeriod (lDateRangeStart, lDateRangeEnd);
02124     const PeriodStruct lPeriodStruct (lDatePeriod,lDoWSrtuct);
02125 
02126     lFlightNumber = FlightNumber_T (11);
02127 
02128     FlightPeriodKey lFlightPeriodKey (lFlightNumber, lPeriodStruct);
02129 
02130     FlightPeriod& lSQ11FlightPeriod =
02131       FacBom<FlightPeriod>::instance().create (lFlightPeriodKey);
02132     FacBomManager::addToListAndMap (lSQInv, lSQ11FlightPeriod);
02133     FacBomManager::linkWithParent (lSQInv, lSQ11FlightPeriod);
02134 
02135     // Step 2: segment period level
02136     // Create a segment period for SIN-BKK:
02137 
02138     SegmentPeriodKey lSegmentPeriodKey (lSIN, lBKK);
02139 
02140     SegmentPeriod& lSINBKKSegmentPeriod =
02141       FacBom<SegmentPeriod>::instance().create (lSegmentPeriodKey);
02142     FacBomManager::addToListAndMap (lSQ11FlightPeriod, lSINBKKSegmentPeriod);
02143     FacBomManager::linkWithParent (lSQ11FlightPeriod, lSINBKKSegmentPeriod);
02144 
02145     lSINBKKSegmentPeriod.setBoardingTime (l0820);
02146     lSINBKKSegmentPeriod.setOffTime (l1100);
02147     lSINBKKSegmentPeriod.setElapsedTime (l0340);
02148     ClassList_String_T lYM ("YM");
02149     lSINBKKSegmentPeriod.addCabinBookingClassList (lY,lYM);
02150 
02151     // CX:
02152     // Step 1: flight period level
02153     // Create a flight period for CX12:  
02154     lFlightNumber = FlightNumber_T (12);
02155 
02156     lFlightPeriodKey = FlightPeriodKey(lFlightNumber, lPeriodStruct);
02157 
02158     FlightPeriod& lCX12FlightPeriod =
02159       FacBom<FlightPeriod>::instance().create (lFlightPeriodKey);
02160     FacBomManager::addToListAndMap (lCXInv, lCX12FlightPeriod);
02161     FacBomManager::linkWithParent (lCXInv, lCX12FlightPeriod);
02162 
02163     // Step 2: segment period level
02164     // Create a segment period for BKK-HKG:
02165 
02166     lSegmentPeriodKey = SegmentPeriodKey (lBKK, lHKG);
02167 
02168     SegmentPeriod& lBKKHKGSegmentPeriod =
02169       FacBom<SegmentPeriod>::instance().create (lSegmentPeriodKey);
02170     FacBomManager::addToListAndMap (lCX12FlightPeriod, lBKKHKGSegmentPeriod);
02171     FacBomManager::linkWithParent (lCX12FlightPeriod, lBKKHKGSegmentPeriod);
02172 
02173     lBKKHKGSegmentPeriod.setBoardingTime (l1200);
02174     lBKKHKGSegmentPeriod.setOffTime (l1540);
02175     lBKKHKGSegmentPeriod.setElapsedTime (l0240);
02176     lBKKHKGSegmentPeriod.addCabinBookingClassList (lY,lYM);
02177     
02178   }
02179 
02180   // //////////////////////////////////////////////////////////////////////
02181   void CmdBomManager::buildPartnershipsSamplePricing (BomRoot& ioBomRoot) {
02182 
02184 
02185     /*===================================================================================*/
02186     // First airport pair SIN-BKK.
02187     // Set the airport-pair primary key.
02188     AirportPairKey lAirportPairKey ("SIN", "BKK");
02189     
02190     // Create the AirportPairKey object and link it to the ioBomRoot object.
02191     AirportPair& lSINBKKAirportPair =
02192       FacBom<AirportPair>::instance().create (lAirportPairKey);
02193     FacBomManager::addToListAndMap (ioBomRoot, lSINBKKAirportPair);
02194     FacBomManager::linkWithParent (ioBomRoot, lSINBKKAirportPair);
02195 
02196     // Set the fare date-period primary key.
02197     const Date_T lDateRangeStart (2010, boost::gregorian::Jan, 15);
02198     const Date_T lDateRangeEnd (2010, boost::gregorian::Dec, 31);
02199     const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
02200     const DatePeriodKey lDatePeriodKey (lDateRange);
02201 
02202     // Create the DatePeriodKey object and link it to the PosChannel object.
02203     DatePeriod& lSINBKKDatePeriod =
02204       FacBom<DatePeriod>::instance().create (lDatePeriodKey);
02205     FacBomManager::addToListAndMap (lSINBKKAirportPair, lSINBKKDatePeriod);
02206     FacBomManager::linkWithParent (lSINBKKAirportPair, lSINBKKDatePeriod);    
02207 
02208     // Set the point-of-sale-channel primary key.
02209     PosChannelKey lPosChannelKey ("SIN","IN");  
02210     
02211     // Create the PositionKey object and link it to the AirportPair object.
02212     PosChannel& lSINPosChannel =
02213       FacBom<PosChannel>::instance().create (lPosChannelKey);
02214     FacBomManager::addToListAndMap (lSINBKKDatePeriod, lSINPosChannel);
02215     FacBomManager::linkWithParent (lSINBKKDatePeriod, lSINPosChannel);
02216    
02217     // Set the fare time-period primary key.
02218     const Time_T lTimeRangeStart (0, 0, 0);
02219     const Time_T lTimeRangeEnd (23, 0, 0);
02220     const TimePeriodKey lFareTimePeriodKey (lTimeRangeStart,
02221                                             lTimeRangeEnd);
02222 
02223     // Create the TimePeriodKey and link it to the DatePeriod object.
02224     TimePeriod& lSINBKKFareTimePeriod =
02225       FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
02226     FacBomManager::addToListAndMap (lSINPosChannel, lSINBKKFareTimePeriod);
02227     FacBomManager::linkWithParent (lSINPosChannel, lSINBKKFareTimePeriod);        
02228 
02229     // Generate the FareRule
02230     const FareFeaturesKey lFareFeaturesKey (TRIP_TYPE_ONE_WAY,
02231                                             NO_ADVANCE_PURCHASE,
02232                                             SATURDAY_STAY,
02233                                             CHANGE_FEES,
02234                                             NON_REFUNDABLE,
02235                                             NO_STAY_DURATION);
02236 
02237     // Create the FareFeaturesKey and link it to the TimePeriod object.
02238     FareFeatures& lSINBKKFareFeatures =
02239       FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
02240     FacBomManager::addToListAndMap (lSINBKKFareTimePeriod, lSINBKKFareFeatures);
02241     FacBomManager::linkWithParent (lSINBKKFareTimePeriod, lSINBKKFareFeatures);        
02242 
02243     // Generate Segment Features and link them to their FareRule.
02244     AirlineCodeList_T lSQAirlineCodeList;
02245     lSQAirlineCodeList.push_back ("SQ");
02246     
02247     ClassList_StringList_T lYClassCodeList;
02248     lYClassCodeList.push_back ("Y");    
02249     const AirlineClassListKey lSQAirlineYClassListKey (lSQAirlineCodeList,
02250                                                        lYClassCodeList);
02251 
02252     ClassList_StringList_T lMClassCodeList;
02253     lMClassCodeList.push_back ("M");
02254     const AirlineClassListKey lSQAirlineMClassListKey (lSQAirlineCodeList,
02255                                                        lMClassCodeList);
02256 
02257     // Create the AirlineClassListKey and link it to the FareFeatures object.
02258     AirlineClassList& lSQAirlineYClassList =
02259       FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
02260     lSQAirlineYClassList.setFare(700);
02261     FacBomManager::addToListAndMap (lSINBKKFareFeatures, lSQAirlineYClassList);
02262     FacBomManager::linkWithParent (lSINBKKFareFeatures, lSQAirlineYClassList);
02263 
02264     AirlineClassList& lSQAirlineMClassList =
02265       FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
02266     lSQAirlineMClassList.setFare(500);
02267     FacBomManager::addToListAndMap (lSINBKKFareFeatures, lSQAirlineMClassList);
02268     FacBomManager::linkWithParent (lSINBKKFareFeatures, lSQAirlineMClassList);
02269 
02270     /*===================================================================================*/
02271     // Second airport pair BKK-HKG.
02272     // Set the airport-pair primary key.
02273     lAirportPairKey = AirportPairKey ("BKK", "HKG");
02274     
02275     // Create the AirportPairKey object and link it to the ioBomRoot object.
02276     AirportPair& lBKKHKGAirportPair =
02277       FacBom<AirportPair>::instance().create (lAirportPairKey);
02278     FacBomManager::addToListAndMap (ioBomRoot, lBKKHKGAirportPair);
02279     FacBomManager::linkWithParent (ioBomRoot, lBKKHKGAirportPair);
02280 
02281     // Set the fare date-period primary key.
02282     // Use the same as previously.
02283 
02284     // Create the DatePeriodKey object and link it to the PosChannel object.
02285     DatePeriod& lBKKHKGDatePeriod =
02286       FacBom<DatePeriod>::instance().create (lDatePeriodKey);
02287     FacBomManager::addToListAndMap (lBKKHKGAirportPair, lBKKHKGDatePeriod);
02288     FacBomManager::linkWithParent (lBKKHKGAirportPair, lBKKHKGDatePeriod);    
02289 
02290     // Set the point-of-sale-channel primary key.
02291     lPosChannelKey  = PosChannelKey("BKK","IN");  
02292     
02293     // Create the PositionKey object and link it to the AirportPair object.
02294     PosChannel& lBKKPosChannel =
02295       FacBom<PosChannel>::instance().create (lPosChannelKey);
02296     FacBomManager::addToListAndMap (lBKKHKGDatePeriod, lBKKPosChannel);
02297     FacBomManager::linkWithParent (lBKKHKGDatePeriod, lBKKPosChannel);
02298    
02299     // Set the fare time-period primary key.
02300     // Use the same as previously.
02301 
02302     // Create the TimePeriodKey and link it to the DatePeriod object.
02303     TimePeriod& lBKKHKGFareTimePeriod =
02304       FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
02305     FacBomManager::addToListAndMap (lBKKPosChannel, lBKKHKGFareTimePeriod);
02306     FacBomManager::linkWithParent (lBKKPosChannel, lBKKHKGFareTimePeriod);        
02307 
02308     // Generate the FareRule
02309     // Use the same key as previously.
02310 
02311     // Create the FareFeaturesKey and link it to the TimePeriod object.
02312     FareFeatures& lBKKHKGFareFeatures =
02313       FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
02314     FacBomManager::addToListAndMap (lBKKHKGFareTimePeriod, lBKKHKGFareFeatures);
02315     FacBomManager::linkWithParent (lBKKHKGFareTimePeriod, lBKKHKGFareFeatures);        
02316 
02317     // Generate Segment Features and link them to their FareRule.
02318     AirlineCodeList_T lCXAirlineCodeList;
02319     lCXAirlineCodeList.push_back ("CX");
02320     
02321     const AirlineClassListKey lCXAirlineYClassListKey (lCXAirlineCodeList,
02322                                                        lYClassCodeList);
02323 
02324     const AirlineClassListKey lCXAirlineMClassListKey (lCXAirlineCodeList,
02325                                                        lMClassCodeList);
02326 
02327     // Create the AirlineClassListKey and link it to the FareFeatures object.
02328     AirlineClassList& lCXAirlineYClassList =
02329       FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
02330     lCXAirlineYClassList.setFare(700);
02331     FacBomManager::addToListAndMap (lBKKHKGFareFeatures, lCXAirlineYClassList);
02332     FacBomManager::linkWithParent (lBKKHKGFareFeatures, lCXAirlineYClassList);
02333     
02334     AirlineClassList& lCXAirlineMClassList =
02335       FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
02336     lCXAirlineMClassList.setFare(500);
02337     FacBomManager::addToListAndMap (lBKKHKGFareFeatures, lCXAirlineMClassList);
02338     FacBomManager::linkWithParent (lBKKHKGFareFeatures, lCXAirlineMClassList);
02339 
02340     /*===================================================================================*/
02341     // Third airport pair SIN-HKG.
02342     // Set the airport-pair primary key.
02343     lAirportPairKey = AirportPairKey ("SIN", "HKG");
02344     
02345     // Create the AirportPairKey object and link it to the ioBomRoot object.
02346     AirportPair& lSINHKGAirportPair =
02347       FacBom<AirportPair>::instance().create (lAirportPairKey);
02348     FacBomManager::addToListAndMap (ioBomRoot, lSINHKGAirportPair);
02349     FacBomManager::linkWithParent (ioBomRoot, lSINHKGAirportPair);
02350 
02351     // Set the fare date-period primary key.
02352     // Use the same as previously.
02353 
02354     // Create the DatePeriodKey object and link it to the PosChannel object.
02355     DatePeriod& lSINHKGDatePeriod =
02356       FacBom<DatePeriod>::instance().create (lDatePeriodKey);
02357     FacBomManager::addToListAndMap (lSINHKGAirportPair, lSINHKGDatePeriod);
02358     FacBomManager::linkWithParent (lSINHKGAirportPair, lSINHKGDatePeriod);    
02359 
02360     // Set the point-of-sale-channel primary key.
02361     lPosChannelKey = PosChannelKey("SIN","IN");  
02362     
02363     // Create the PositionKey object and link it to the AirportPair object.
02364     PosChannel& lOnDSINPosChannel =
02365       FacBom<PosChannel>::instance().create (lPosChannelKey);
02366     FacBomManager::addToListAndMap (lSINHKGDatePeriod, lOnDSINPosChannel);
02367     FacBomManager::linkWithParent (lSINHKGDatePeriod, lOnDSINPosChannel);
02368    
02369     // Set the fare time-period primary key.
02370     // Use the same as previously.
02371 
02372     // Create the TimePeriodKey and link it to the DatePeriod object.
02373     TimePeriod& lSINHKGFareTimePeriod =
02374       FacBom<TimePeriod>::instance().create (lFareTimePeriodKey);
02375     FacBomManager::addToListAndMap (lOnDSINPosChannel, lSINHKGFareTimePeriod);
02376     FacBomManager::linkWithParent (lOnDSINPosChannel, lSINHKGFareTimePeriod);        
02377 
02378     // Generate the FareRule
02379     // Use the same key as previously.
02380 
02381     // Create the FareFeaturesKey and link it to the TimePeriod object.
02382     FareFeatures& lSINHKGFareFeatures =
02383       FacBom<FareFeatures>::instance().create (lFareFeaturesKey);
02384     FacBomManager::addToListAndMap (lSINHKGFareTimePeriod, lSINHKGFareFeatures);
02385     FacBomManager::linkWithParent (lSINHKGFareTimePeriod, lSINHKGFareFeatures);        
02386 
02387     // Generate Segment Features and link them to their FareRule.
02388     AirlineCodeList_T lSQ_CXAirlineCodeList;
02389     lSQ_CXAirlineCodeList.push_back ("SQ");
02390     lSQ_CXAirlineCodeList.push_back ("CX");
02391 
02392     ClassList_StringList_T lY_YClassCodeList;
02393     lY_YClassCodeList.push_back ("Y");
02394     lY_YClassCodeList.push_back ("Y");
02395     const AirlineClassListKey lSQ_CXAirlineYClassListKey (lSQ_CXAirlineCodeList,
02396                                                           lY_YClassCodeList);
02397 
02398     ClassList_StringList_T lM_MClassCodeList;
02399     lM_MClassCodeList.push_back ("M");
02400     lM_MClassCodeList.push_back ("M");
02401     const AirlineClassListKey lSQ_CXAirlineMClassListKey (lSQ_CXAirlineCodeList,
02402                                                           lM_MClassCodeList);
02403 
02404     // Create the AirlineClassListKey and link it to the FareFeatures object.
02405     AirlineClassList& lSQ_CXAirlineYClassList =
02406       FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
02407     lSQ_CXAirlineYClassList.setFare(1200);
02408     FacBomManager::addToListAndMap (lSINHKGFareFeatures, lSQ_CXAirlineYClassList);
02409     FacBomManager::linkWithParent (lSINHKGFareFeatures, lSQ_CXAirlineYClassList);
02410     
02411     AirlineClassList& lSQ_CXAirlineMClassList =
02412       FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
02413     lSQ_CXAirlineMClassList.setFare(850);
02414     FacBomManager::addToListAndMap (lSINHKGFareFeatures, lSQ_CXAirlineMClassList);
02415     FacBomManager::linkWithParent (lSINHKGFareFeatures, lSQ_CXAirlineMClassList);
02416 
02417 
02419 
02420     /*===================================================================================*/
02421 
02422     // Use the same airport pair, and date period for adding SQ SIN-BKK yields.
02423     
02424     // Set the point-of-sale-channel primary key.
02425     lPosChannelKey = PosChannelKey(DEFAULT_POS, DEFAULT_CHANNEL);  
02426     
02427     // Create the PositionKey object and link it to the AirportPair object.
02428     PosChannel& lRAC_SINBKKPosChannel =
02429       FacBom<PosChannel>::instance().create (lPosChannelKey);
02430     FacBomManager::addToListAndMap (lSINBKKDatePeriod, lRAC_SINBKKPosChannel);
02431     FacBomManager::linkWithParent (lSINBKKDatePeriod, lRAC_SINBKKPosChannel);
02432    
02433     // Set the yield time-period primary key.
02434     const TimePeriodKey lYieldTimePeriodKey (lTimeRangeStart,
02435                                             lTimeRangeEnd);
02436 
02437     // Create the TimePeriodKey and link it to the DatePeriod object.
02438     TimePeriod& lSINBKKYieldTimePeriod =
02439       FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
02440     FacBomManager::addToListAndMap (lRAC_SINBKKPosChannel, lSINBKKYieldTimePeriod);
02441     FacBomManager::linkWithParent (lRAC_SINBKKPosChannel, lSINBKKYieldTimePeriod);        
02442 
02443     // Generate the YieldRule
02444     const YieldFeaturesKey lYieldFeaturesKey (TRIP_TYPE_ONE_WAY,
02445                                               CABIN_Y);
02446 
02447     // Create the YieldFeaturesKey and link it to the TimePeriod object.
02448     YieldFeatures& lSINBKKYieldFeatures =
02449       FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
02450     FacBomManager::addToListAndMap (lSINBKKYieldTimePeriod, lSINBKKYieldFeatures);
02451     FacBomManager::linkWithParent (lSINBKKYieldTimePeriod, lSINBKKYieldFeatures);        
02452 
02453     // Generate Segment Features and link them to their YieldRule.
02454     // Use the same key as previously.
02455 
02456     // Create the AirlineClassListKey and link it to the YieldFeatures object.
02457     AirlineClassList& lRAC_SQAirlineYClassList =
02458       FacBom<AirlineClassList>::instance().create (lSQAirlineYClassListKey);
02459     lRAC_SQAirlineYClassList.setYield(700);
02460     FacBomManager::addToListAndMap (lSINBKKYieldFeatures, lRAC_SQAirlineYClassList);
02461     FacBomManager::linkWithParent (lSINBKKYieldFeatures, lRAC_SQAirlineYClassList);
02462 
02463     AirlineClassList& lRAC_SQAirlineMClassList =
02464       FacBom<AirlineClassList>::instance().create (lSQAirlineMClassListKey);
02465     lRAC_SQAirlineMClassList.setYield(500);
02466     FacBomManager::addToListAndMap (lSINBKKYieldFeatures, lRAC_SQAirlineMClassList);
02467     FacBomManager::linkWithParent (lSINBKKYieldFeatures, lRAC_SQAirlineMClassList);
02468 
02469     /*===================================================================================*/
02470 
02471     // Use the same airport pair, and date period for adding CX BKK-HKG yields. 
02472     
02473     // Set the point-of-sale-channel primary key.
02474     // Use the same as previously.
02475     
02476     // Create the PositionKey object and link it to the AirportPair object.
02477     PosChannel& lRAC_BKKHKGPosChannel =
02478       FacBom<PosChannel>::instance().create (lPosChannelKey);
02479     FacBomManager::addToListAndMap (lBKKHKGDatePeriod, lRAC_BKKHKGPosChannel);
02480     FacBomManager::linkWithParent (lBKKHKGDatePeriod, lRAC_BKKHKGPosChannel);
02481    
02482     // Set the yield time-period primary key.
02483     // Use the same as previously.
02484 
02485     // Create the TimePeriodKey and link it to the DatePeriod object.
02486     TimePeriod& lBKKHKGYieldTimePeriod =
02487       FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
02488     FacBomManager::addToListAndMap (lRAC_BKKHKGPosChannel, lBKKHKGYieldTimePeriod);
02489     FacBomManager::linkWithParent (lRAC_BKKHKGPosChannel, lBKKHKGYieldTimePeriod);        
02490 
02491     // Generate the YieldRule
02492     // Use the same key as previously.
02493 
02494     // Create the YieldFeaturesKey and link it to the TimePeriod object.
02495     YieldFeatures& lBKKHKGYieldFeatures =
02496       FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
02497     FacBomManager::addToListAndMap (lBKKHKGYieldTimePeriod, lBKKHKGYieldFeatures);
02498     FacBomManager::linkWithParent (lBKKHKGYieldTimePeriod, lBKKHKGYieldFeatures);        
02499 
02500     // Generate Segment Features and link them to their YieldRule.
02501     // Use the same key as previously.
02502 
02503     // Create the AirlineClassListKey and link it to the YieldFeatures object.
02504     AirlineClassList& lRAC_CXAirlineYClassList =
02505       FacBom<AirlineClassList>::instance().create (lCXAirlineYClassListKey);
02506     lRAC_CXAirlineYClassList.setYield(700);
02507     FacBomManager::addToListAndMap (lBKKHKGYieldFeatures, lRAC_CXAirlineYClassList);
02508     FacBomManager::linkWithParent (lBKKHKGYieldFeatures, lRAC_CXAirlineYClassList);
02509     
02510     AirlineClassList& lRAC_CXAirlineMClassList =
02511       FacBom<AirlineClassList>::instance().create (lCXAirlineMClassListKey);
02512     lRAC_CXAirlineMClassList.setYield(500);
02513     FacBomManager::addToListAndMap (lBKKHKGYieldFeatures, lRAC_CXAirlineMClassList);
02514     FacBomManager::linkWithParent (lBKKHKGYieldFeatures, lRAC_CXAirlineMClassList);
02515 
02516     /*===================================================================================*/
02517 
02518     // Use the same airport pair, and date period for SQ-CX SIN-HKG
02519 
02520     // Set the point-of-sale-channel primary key.
02521     // Use the same as previously.
02522     
02523     // Create the PositionKey object and link it to the AirportPair object.
02524     PosChannel& lRAC_SINHKGChannel =
02525       FacBom<PosChannel>::instance().create (lPosChannelKey);
02526     FacBomManager::addToListAndMap (lSINHKGDatePeriod, lRAC_SINHKGChannel);
02527     FacBomManager::linkWithParent (lSINHKGDatePeriod, lRAC_SINHKGChannel);
02528    
02529     // Set the yield time-period primary key.
02530     // Use the same as previously.
02531 
02532     // Create the TimePeriodKey and link it to the DatePeriod object.
02533     TimePeriod& lSINHKGYieldTimePeriod =
02534       FacBom<TimePeriod>::instance().create (lYieldTimePeriodKey);
02535     FacBomManager::addToListAndMap (lRAC_SINHKGChannel, lSINHKGYieldTimePeriod);
02536     FacBomManager::linkWithParent (lRAC_SINHKGChannel, lSINHKGYieldTimePeriod);        
02537 
02538     // Generate the YieldRule
02539     // Use the same key as previously.
02540 
02541     // Create the YieldFeaturesKey and link it to the TimePeriod object.
02542     YieldFeatures& lSINHKGYieldFeatures =
02543       FacBom<YieldFeatures>::instance().create (lYieldFeaturesKey);
02544     FacBomManager::addToListAndMap (lSINHKGYieldTimePeriod, lSINHKGYieldFeatures);
02545     FacBomManager::linkWithParent (lSINHKGYieldTimePeriod, lSINHKGYieldFeatures);        
02546 
02547     // Generate Segment Features and link them to their YieldRule.
02548     // Use the same key as previously
02549     
02550     // Create the AirlineClassListKey and link it to the YieldFeatures object.
02551     AirlineClassList& lRAC_SQ_CXAirlineYClassList =
02552       FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineYClassListKey);
02553     lRAC_SQ_CXAirlineYClassList.setYield(1200);
02554     FacBomManager::addToListAndMap (lSINHKGYieldFeatures, lRAC_SQ_CXAirlineYClassList);
02555     FacBomManager::linkWithParent (lSINHKGYieldFeatures, lRAC_SQ_CXAirlineYClassList);
02556     
02557     AirlineClassList& lRAC_SQ_CXAirlineMClassList =
02558       FacBom<AirlineClassList>::instance().create (lSQ_CXAirlineMClassListKey);
02559     lRAC_SQ_CXAirlineMClassList.setYield(850);
02560     FacBomManager::addToListAndMap (lSINHKGYieldFeatures, lRAC_SQ_CXAirlineMClassList);
02561     FacBomManager::linkWithParent (lSINHKGYieldFeatures, lRAC_SQ_CXAirlineMClassList);
02562     
02563   }
02564 
02565 }
02566