/
#include <cassert>
#include <sstream>
void CmdBomManager::buildSampleBom (BomRoot& ioBomRoot) {
<< "specifications.");
buildSampleInventorySchedule (ioBomRoot);
buildSamplePricing (ioBomRoot);
buildPartnershipsSampleInventoryAndRM (ioBomRoot);
buildPartnershipsSamplePricing (ioBomRoot);
buildCompleteDummyInventory (ioBomRoot);
buildSampleInventoryScheduleForFareFamilies (ioBomRoot);
buildSamplePricingForFareFamilies (ioBomRoot);
buildCompleteDummyInventoryForFareFamilies (ioBomRoot);
}
void CmdBomManager::buildSampleInventorySchedule (BomRoot& ioBomRoot) {
const InventoryKey lBAKey (lAirlineCodeBA);
const AirlineFeatureKey lAirlineFeatureBAKey (lAirlineCodeBA);
AirlineFeature& lAirlineFeatureBA =
const InventoryKey lAFKey (lAirlineCodeAF);
const AirlineFeatureKey lAirlineFeatureAFKey (lAirlineCodeAF);
AirlineFeature& lAirlineFeatureAF =
FlightDateKey lFlightDateKey (lFlightNumber, lDate);
FlightDate& lBA9_20110610_FD =
SegmentDateKey lSegmentDateKey (lLHR, lSYD);
SegmentDate& lLHRSYDSegment =
const std::string lBALHRRoutingLegStr = "BA;9;2011-Jun-10;LHR";
const std::string lBABKKRoutingLegStr = "BA;9;2011-Jun-10;BKK";
lLHRSYDSegment.addLegKey (lBALHRRoutingLegStr);
lLHRSYDSegment.addLegKey (lBABKKRoutingLegStr);
lLHRSYDSegment.setBoardingDate (lDate);
lLHRSYDSegment.setOffDate (lDate + l2Days);
lLHRSYDSegment.setBoardingTime (l2135);
lLHRSYDSegment.setOffTime (l0610);
lLHRSYDSegment.setElapsedTime (l2135);
lSegmentDateKey = SegmentDateKey (lLHR, lBKK);
SegmentDate& lLHRBKKSegment =
lLHRBKKSegment.addLegKey (lBALHRRoutingLegStr);
lLHRBKKSegment.setBoardingDate (lDate);
lLHRBKKSegment.setOffDate (lDate + l1Day);
lLHRBKKSegment.setBoardingTime (l2135);
lLHRBKKSegment.setOffTime (l1540);
lLHRBKKSegment.setElapsedTime (l1105);
lSegmentDateKey = SegmentDateKey (lBKK, lSYD);
SegmentDate& lBKKSYDSegment =
lBKKSYDSegment.addLegKey (lBABKKRoutingLegStr);
lBKKSYDSegment.setBoardingDate (lDate + l1Day);
lBKKSYDSegment.setOffDate (lDate + l2Days);
lBKKSYDSegment.setBoardingTime (l1705);
lBKKSYDSegment.setOffTime (l1540);
lBKKSYDSegment.setElapsedTime (l0905);
LegDateKey lLegDateKey (lLHR);
lLHRLeg.setOffPoint (lBKK);
lLHRLeg.setBoardingDate (lDate);
lLHRLeg.setOffDate (lDate + l1Day);
lLHRLeg.setBoardingTime (l2135);
lLHRLeg.setOffTime (l1540);
lLHRLeg.setElapsedTime (l1105);
lLegDateKey = LegDateKey (lBKK);
lBKKLeg.setOffPoint (lSYD);
lBKKLeg.setBoardingDate (lDate + l1Day);
lBKKLeg.setOffDate (lDate + l2Days);
lBKKLeg.setBoardingTime (l1705);
lBKKLeg.setOffTime (l1540);
lBKKLeg.setElapsedTime (l0905);
SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lLHRBKKSegmentYCabin =
SegmentCabin& lBKKSYDSegmentYCabin =
SegmentCabin& lLHRSYDSegmentYCabin =
LegCabinKey lYLegCabinKey (lY);
LegCabin& lLHRLegYCabin =
LegCabin& lBKKLegYCabin =
FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lLHRBKKSegmentYCabin1Family =
lLHRBKKSegmentYCabin1Family);
lLHRBKKSegmentYCabin1Family);
FareFamily& lBKKSYDSegmentYCabin1Family =
lBKKSYDSegmentYCabin1Family);
lBKKSYDSegmentYCabin1Family);
FareFamily& lLHRSYDSegmentYCabin1Family =
lLHRSYDSegmentYCabin1Family);
lLHRSYDSegmentYCabin1Family);
BookingClassKey lQBookingClassKey (lQ);
BookingClass& lLHRBKKSegmentYCabin1FamilyQClass =
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
lLHRBKKSegmentYCabin1FamilyQClass);
BookingClass& lBKKSYDSegmentYCabin1FamilyQClass =
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
lBKKSYDSegmentYCabin1FamilyQClass);
BookingClass& lLHRSYDSegmentYCabin1FamilyQClass =
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lLHRSYDSegmentYCabin1FamilyQClass);
lFlightNumber = 84;
lFlightDateKey = FlightDateKey (lFlightNumber, lDate);
FlightDate& lAF084_20110320_FD =
lSegmentDateKey = SegmentDateKey (lCDG, lSFO);
SegmentDate& lCDGSFOSegment =
const std::string lAFCDGRoutingLegStr = "AF;84;2011-Mar-20;CDG";
lCDGSFOSegment.addLegKey (lAFCDGRoutingLegStr);
lCDGSFOSegment.setBoardingDate (lDate);
lCDGSFOSegment.setOffDate (lDate);
lCDGSFOSegment.setBoardingTime (l1040);
lCDGSFOSegment.setOffTime (l1250);
lCDGSFOSegment.setElapsedTime (l1110);
lLegDateKey = LegDateKey (lCDG);
lCDGLeg.setOffPoint (lSFO);
lCDGLeg.setBoardingDate (lDate);
lCDGLeg.setOffDate (lDate);
lCDGLeg.setBoardingTime (l1040);
lCDGLeg.setOffTime (l1250);
lCDGLeg.setElapsedTime (l1110);
SegmentCabin& lCDGSFOSegmentYCabin =
LegCabin& lCDGLegYCabin =
FareFamily& lCDGSFOSegmentYCabin1Family =
lCDGSFOSegmentYCabin1Family);
lCDGSFOSegmentYCabin1Family);
BookingClass& lCDGSFOSegmentYCabin1FamilyQClass =
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
lCDGSFOSegmentYCabin1FamilyQClass);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lBA9DateRangeStart (2010, boost::gregorian::Jun, 6);
const Date_T lBA9DateRangeEnd (2010, boost::gregorian::Jun, 7);
const DatePeriod_T lBA9DatePeriod (lBA9DateRangeStart, lBA9DateRangeEnd);
const PeriodStruct lBA9PeriodStruct (lBA9DatePeriod, lDoWSrtuct);
FlightPeriodKey lBA9FlightPeriodKey (lFlightNumber, lBA9PeriodStruct);
FlightPeriod& lBA9FlightPeriod =
SegmentPeriodKey lLHRSYDSegmentPeriodKey (lLHR, lSYD);
SegmentPeriod& lLHRSYDSegmentPeriod =
lLHRSYDSegmentPeriod.setBoardingTime (l2135);
lLHRSYDSegmentPeriod.setOffTime (l1540);
lLHRSYDSegmentPeriod.setElapsedTime (l1105);
lLHRSYDSegmentPeriod.addCabinBookingClassList (lY,lYM);
const Date_T lAF84DateRangeStart (2011, boost::gregorian::Mar, 20);
const Date_T lAF84DateRangeEnd (2011, boost::gregorian::Mar, 21);
const DatePeriod_T lAF84DatePeriod (lAF84DateRangeStart, lAF84DateRangeEnd);
const PeriodStruct lAF84PeriodStruct (lAF84DatePeriod, lDoWSrtuct);
FlightPeriodKey lAF84FlightPeriodKey (lFlightNumber, lAF84PeriodStruct);
FlightPeriod& lAF84FlightPeriod =
SegmentPeriodKey lCDGSFOSegmentPeriodKey (lCDG, lSFO);
SegmentPeriod& lCDGSFOSegmentPeriod =
lCDGSFOSegmentPeriod.setBoardingTime (l1040);
lCDGSFOSegmentPeriod.setOffTime (l1250);
lCDGSFOSegmentPeriod.setElapsedTime (l1110);
lCDGSFOSegmentPeriod.addCabinBookingClassList (lY,lYM);
OnDString_T lBALHRSYDOnDStr =
"BA;9,2010-Jun-06;LHR,SYD";
lBAOnDStrList.push_back (lBALHRSYDOnDStr);
OnDDateKey lBAOnDDateKey (lBAOnDStrList);
OnDDate& lBA_LHRSYD_OnDDate =
const WTP_T lWTP750 = 750.0;
lBA_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
OnDString_T lAFLHRSYDOnDStr =
"AF;9,2011-Mar-20;CDG,SFO";
lAFOnDStrList.push_back (lAFLHRSYDOnDStr);
OnDDateKey lAFOnDDateKey (lAFOnDStrList);
OnDDate& lAF_LHRSYD_OnDDate =
lAF_LHRSYD_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
}
void CmdBomManager::
buildSampleInventoryScheduleForFareFamilies (BomRoot& ioBomRoot) {
const InventoryKey lSQKey ("SQ");
Inventory& lSQInv = BomManager::getObject<Inventory>(ioBomRoot,
lSQKey.toString());
const Date_T lDate (2010, 2, 8);
const FlightDateKey lFlightDateKey (lFlightNumber747, lDate);
FlightDate& lSQ747_20100208_FD =
const SegmentDateKey lSegmentDateKey (lSIN, lBKK);
SegmentDate& lSINBKKSegment =
const std::string lSQSINRoutingLegStr = "SQ;747;2010-Feb-8;SIN";
lSINBKKSegment.addLegKey (lSQSINRoutingLegStr);
lSINBKKSegment.setBoardingDate (lDate);
lSINBKKSegment.setOffDate (lDate);
lSINBKKSegment.setBoardingTime (l0635);
lSINBKKSegment.setOffTime (l0800);
lSINBKKSegment.setElapsedTime (l0225);
const LegDateKey lLegDateKey (lSIN);
lSINLeg.setOffPoint (lBKK);
lSINLeg.setBoardingDate (lDate);
lSINLeg.setOffDate (lDate);
lSINLeg.setBoardingTime (l0635);
lSINLeg.setOffTime (l0800);
lSINLeg.setElapsedTime (l0225);
const SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lSINBKKSegmentYCabin =
lSINBKKSegmentYCabin.activateFareFamily ();
const LegCabinKey lYLegCabinKey (lY);
LegCabin& lSINLegYCabin =
const FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSINBKKSegmentYCabin1Family =
lSINBKKSegmentYCabin1Family);
lSINBKKSegmentYCabin1Family);
const FareFamilyKey l2FareFamilyKey (l2);
FareFamily& lSINBKKSegmentYCabin2Family =
lSINBKKSegmentYCabin2Family);
lSINBKKSegmentYCabin2Family);
const BookingClassKey lYBookingClassKey (lClassY);
BookingClass& lSINBKKSegmentYCabin2FamilyYClass =
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass);
lSINBKKSegmentYCabin2FamilyYClass.setYield(1200);
const BookingClassKey lBBookingClassKey (lB);
BookingClass& lSINBKKSegmentYCabin2FamilyBClass =
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass);
lSINBKKSegmentYCabin2FamilyBClass.setYield(800);
const BookingClassKey lMBookingClassKey (lM);
BookingClass& lSINBKKSegmentYCabin1FamilyMClass =
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass.setYield(900);
const BookingClassKey lQBookingClassKey (lQ);
BookingClass& lSINBKKSegmentYCabin1FamilyQClass =
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass);
lSINBKKSegmentYCabin1FamilyQClass.setYield(600);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lSQ747DateRangeStart (2010, boost::gregorian::Feb, 8);
const Date_T lSQ747DateRangeEnd (2010, boost::gregorian::Feb, 9);
lSQ747DateRangeEnd);
const PeriodStruct lSQ747PeriodStruct (lSQ747DatePeriod, lDoWSrtuct);
const FlightPeriodKey lSQ747FlightPeriodKey (lFlightNumber747,
lSQ747PeriodStruct);
FlightPeriod& lSQ747FlightPeriod =
const SegmentPeriodKey lSINBKKSegmentPeriodKey (lSIN, lBKK);
SegmentPeriod& lSINBKKSegmentPeriod =
lSINBKKSegmentPeriod.addCabinBookingClassList (lY,lYBMQ);
lSINBKKSegmentPeriod.setBoardingTime (l0635);
lSINBKKSegmentPeriod.setOffTime (l0800);
lSINBKKSegmentPeriod.setElapsedTime (l0225);
const OnDString_T lSQSINBKKOnDStr =
"SQ;747,2011-Feb-14;SIN,BKK";
lSQOnDStrList.push_back (lSQSINBKKOnDStr);
const OnDDateKey lSQOnDDateKey (lSQOnDStrList);
OnDDate& lSQ_SINBKK_OnDDate =
const WTP_T lWTP1000 = 1000.0;
const WTPDemandPair_T lWTP1000Mean120StdDev12 (lWTP1000, lMean120StdDev12);
lSQ_SINBKK_OnDDate.setTotalForecast (lY, lWTP1000Mean120StdDev12);
}
void CmdBomManager::buildDummyLegSegmentAccesses (BomRoot& ioBomRoot) {
const DoWStruct lDoWSrtuct ("1111111");
const DatePeriod_T lXXDatePeriod (lXXDateRangeStart, lXXDateRangeEnd);
const PeriodStruct lXXPeriodStruct (lXXDatePeriod, lDoWSrtuct);
FlightPeriod& lXXFlightPeriod =
SegmentPeriod& lXXSegmentPeriod =
lXXSegmentPeriod.setBoardingTime (
Duration_T (14, 0, 0));
lXXSegmentPeriod.setOffTime (
Duration_T (16, 0, 0));
lXXSegmentPeriod.setElapsedTime (
Duration_T (8, 0, 0));
lXXSegmentPeriod.addCabinBookingClassList (lY,lYQ);
}
void CmdBomManager::
buildCompleteDummyInventoryForFareFamilies (BomRoot& ioBomRoot) {
Inventory& lInv = BomManager::getObject<Inventory>(ioBomRoot,
lInventoryKey.toString());
FlightDate& lFlightDate =
lLegCabin.setCapacities (lCapacity);
lLegCabin.setAvailabilityPool (lCapacity);
SegmentDate& lSegment =
std::ostringstream oStr;
lSegment.addLegKey (oStr.str());
SegmentCabin& lSegmentCabin =
const FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSegmentYCabin1Family =
const unsigned int size = 16;
for (unsigned int idx = 0; idx < size; ++idx) {
double i = static_cast<double> (idx);
lDemandVector1FareFamily.push_back(lMeanStdDevPair);
}
lSegmentYCabin1Family.setMeanStdDev(lDemandVector1FareFamily);
const BookingClassKey lYBookingClassKey (lY);
BookingClass& lSegmentYCabin1FamilyYClass =
lSegmentYCabin1FamilyYClass.setYield(lYield);
lSegmentYCabin1FamilyYClass);
lSegmentYCabin1FamilyYClass);
const BookingClassKey lUBookingClassKey (lU);
BookingClass& lSegmentYCabin1FamilyUClass =
lYield = 600;
lSegmentYCabin1FamilyUClass.setYield(lYield);
lSegmentYCabin1FamilyUClass);
lSegmentYCabin1FamilyUClass);
const FareFamilyKey l2FareFamilyKey (l2);
FareFamily& lSegmentYCabin2Family =
for (unsigned int idx = 0; idx < size; ++idx) {
double i = static_cast<double> (idx);
lDemandVector2FareFamily.push_back(lMeanStdDevPair);
}
lSegmentYCabin2Family.setMeanStdDev(lDemandVector2FareFamily);
const BookingClassKey lOBookingClassKey (lO);
BookingClass& lSegmentYCabin2FamilyOClass =
lYield = 750;
lSegmentYCabin2FamilyOClass.setYield(lYield);
lSegmentYCabin2FamilyOClass);
lSegmentYCabin2FamilyOClass);
const BookingClassKey lQBookingClassKey (lQ);
BookingClass& lSegmentYCabin2FamilyQClass =
lYield = 400;
lSegmentYCabin2FamilyQClass.setYield(lYield);
lSegmentYCabin2FamilyQClass);
lSegmentYCabin2FamilyQClass);
const DoWStruct lDoWSrtuct ("1111111");
const DatePeriod_T lXXDatePeriod (lXXDateRangeStart, lXXDateRangeEnd);
const PeriodStruct lXXPeriodStruct (lXXDatePeriod, lDoWSrtuct);
lXXPeriodStruct);
FlightPeriod& lXXFlightPeriod =
SegmentPeriod& lXXSegmentPeriod =
lXXSegmentPeriod.setBoardingTime (
Duration_T (14, 0, 0));
lXXSegmentPeriod.setOffTime (
Duration_T (16, 0, 0));
lXXSegmentPeriod.setElapsedTime (
Duration_T (8, 0, 0));
lXXSegmentPeriod.addCabinBookingClassList (lYCabin,lYUOQ);
}
void CmdBomManager::buildSamplePricing (BomRoot& ioBomRoot) {
AirportPair& lAirportPair =
const Date_T lDateRangeStart (2011, boost::gregorian::Jan, 15);
const Date_T lDateRangeEnd (2011, boost::gregorian::Dec, 31);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lDatePeriod =
PosChannel& lPosChannel =
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lTimePeriodKey (lTimeRangeStart, lTimeRangeEnd);
TimePeriod& lTimePeriod =
FareFeatures& lFareFeatures =
YieldFeatures& lYieldFeatures =
const AirlineClassListKey lAirlineClassListKey (lAirlineCodeList,
lClassCodeList);
AirlineClassList& lAirlineClassList =
lAirlineClassList.setFare (900);
lAirlineClassList.setYield (900);
}
void CmdBomManager::buildSamplePricingForFareFamilies (BomRoot& ioBomRoot) {
const AirportPairKey lAirportPairKey ("SIN", "BKK");
AirportPair& lAirportPair =
BomManager::getObject<AirportPair>(ioBomRoot, lAirportPairKey.toString());
const Date_T lDateRangeStart (2010, boost::gregorian::Feb, 1);
const Date_T lDateRangeEnd (2011, boost::gregorian::Feb, 15);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lDatePeriod =
const PosChannelKey lPosChannelKey (
"SIN",
CHANNEL_IN);
PosChannel& lPosChannel =
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lTimePeriodKey (lTimeRangeStart, lTimeRangeEnd);
TimePeriod& lTimePeriod =
ONE_MONTH_ADVANCE_PURCHASE,
FareFeatures& lFareFeaturesQ =
FareFeatures& lFareFeaturesM =
ONE_MONTH_ADVANCE_PURCHASE,
FareFeatures& lFareFeaturesB =
FareFeatures& lFareFeaturesY =
YieldFeatures& lYieldFeatures =
lAirlineCodeList.push_back ("SQ");
const AirlineClassListKey lAirlineClassYListKey (lAirlineCodeList,
lClassYList);
AirlineClassList& lAirlineClassYList =
lAirlineClassYList.setFare (1200);
lAirlineClassYList.setYield (1200);
lClassBList.push_back ("B");
const AirlineClassListKey lAirlineClassBListKey (lAirlineCodeList,
lClassBList);
AirlineClassList& lAirlineClassBList =
lAirlineClassBList.setFare (800);
lAirlineClassBList.setYield (800);
lClassMList.push_back ("M");
const AirlineClassListKey lAirlineClassMListKey (lAirlineCodeList,
lClassMList);
AirlineClassList& lAirlineClassMList =
lAirlineClassMList.setFare (900);
lAirlineClassMList.setYield (900);
lClassQList.push_back ("Q");
const AirlineClassListKey lAirlineClassQListKey (lAirlineCodeList,
lClassQList);
AirlineClassList& lAirlineClassQList =
lAirlineClassQList.setFare (600);
lAirlineClassQList.setYield (600);
}
void CmdBomManager::
ioTravelSolutionList.clear();
const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
TravelSolutionStruct lTS;
lTS.addSegment (lBA9_SegmentDateKey);
ioTravelSolutionList.push_back (lTS);
}
void CmdBomManager::
ioTravelSolutionList.clear();
const std::string lBA9_SegmentDateKey ("BA, 9, 2011-06-10, LHR, SYD, 21:45");
TravelSolutionStruct lTS1;
lTS1.addSegment (lBA9_SegmentDateKey);
const FareOptionStruct lFareOption1 (lClassPathQ, lFare900, lChangeFee,
isNonRefundable, lSaturdayStay);
lTS1.addFareOption (lFareOption1);
bool hasInsertOfQBeenSuccessful = lClassAvailabilityMap1.
insert (ClassAvailabilityMap_T::value_type (lClassPathQ, lAvl1)).second;
assert (hasInsertOfQBeenSuccessful == true);
lTS1.addClassAvailabilityMap (lClassAvailabilityMap1);
ioTravelSolutionList.push_back (lTS1);
const std::string lQF12_SegmentDateKey ("QF, 12, 2011-06-10, LHR, SYD, 20:45");
TravelSolutionStruct lTS2;
lTS2.addSegment (lQF12_SegmentDateKey);
const Fare_T lFare1000 (1000);
const FareOptionStruct lFareOption2 (lClassPathY, lFare1000, lNoChangeFee,
isRefundable, lSaturdayStay);
const bool hasInsertOfYBeenSuccessful = lClassAvailabilityMap2.
insert (ClassAvailabilityMap_T::value_type (lClassPathY, lAvl2)).second;
assert (hasInsertOfYBeenSuccessful == true);
lTS2.addClassAvailabilityMap (lClassAvailabilityMap2);
lTS2.addFareOption (lFareOption2);
const FareOptionStruct lFareOption3 (lClassPathQ, lFare920, lNoChangeFee,
isNonRefundable, lSaturdayStay);
hasInsertOfQBeenSuccessful = lClassAvailabilityMap2.
insert (ClassAvailabilityMap_T::value_type (lClassPathQ, lAvl2)).second;
assert (hasInsertOfYBeenSuccessful == true);
lTS2.addClassAvailabilityMap (lClassAvailabilityMap2);
lTS2.addFareOption (lFareOption3);
ioTravelSolutionList.push_back (lTS2);
}
BookingRequestStruct CmdBomManager::buildSampleBookingRequest() {
const Date_T lPreferredDepartureDate (2011, boost::gregorian::Jun, 10);
const Duration_T lPreferredDepartureTime (8, 0, 0);
const Date_T lRequestDate (2011, boost::gregorian::May, 15);
const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
BookingRequestStruct oBookingRequest (lOrigin, lDestination, lPOS,
lPreferredDepartureDate,
lRequestDateTime,
lPreferredCabin,
lPartySize, lChannel,
lTripType, lStayDuration,
lFrequentFlyerType,
lPreferredDepartureTime,
lWTP, lValueOfTime,
lChangeFees, lChangeFeeDisutility,
lNonRefundable,
lNonRefundableDisutility);
return oBookingRequest;
}
BookingRequestStruct CmdBomManager::buildSampleBookingRequestForCRS() {
const Date_T lPreferredDepartureDate (2010, boost::gregorian::Jan, 30);
const Duration_T lPreferredDepartureTime (10, 0, 0);
const Date_T lRequestDate (2010, boost::gregorian::Jan, 22);
const DateTime_T lRequestDateTime (lRequestDate, lRequestTime);
BookingRequestStruct oBookingRequest (lOrigin,
lDestination,
lPOS,
lPreferredDepartureDate,
lRequestDateTime,
lPreferredCabin,
lPartySize, lChannel,
lTripType, lStayDuration,
lFrequentFlyerType,
lPreferredDepartureTime,
lWTP, lValueOfTime,
lChangeFees, lChangeFeeDisutility,
lNonRefundable,
lNonRefundableDisutility);
return oBookingRequest;
}
void CmdBomManager::
buildPartnershipsSampleInventoryAndRM (BomRoot& ioBomRoot) {
const InventoryKey lSQKey (lAirlineCodeSQ);
const AirlineFeatureKey lAirlineFeatureSQKey (lAirlineCodeSQ);
AirlineFeature& lAirlineFeatureSQ =
const InventoryKey lCXKey (lAirlineCodeCX);
const AirlineFeatureKey lAirlineFeatureCXKey (lAirlineCodeCX);
AirlineFeature& lAirlineFeatureCX =
FlightDateKey lFlightDateKey (lFlightNumber, lDate);
FlightDate& lSQ11_20100308_FD =
FlightDateKey lMktFlightDateKey (lMktFlightNumber, lDate);
FlightDate& lSQ1200_20100308_FD =
SegmentDateKey lSegmentDateKey (lSIN, lBKK);
SegmentDate& lSINBKKSegment =
const std::string lSQSINRoutingLegStr = "SQ;11;2010-Mar-8;SIN";
lSINBKKSegment.addLegKey (lSQSINRoutingLegStr);
lSINBKKSegment.setBoardingDate (lDate);
lSINBKKSegment.setOffDate (lDate);
lSINBKKSegment.setBoardingTime (l0820);
lSINBKKSegment.setOffTime (l1100);
lSINBKKSegment.setElapsedTime (l0340);
SegmentDateKey lMktSegmentDateKey (lBKK, lHKG);
SegmentDate& lMktBKKHKGSegment =
const std::string lCXBKKRoutingLegStr = "CX;12;2010-Mar-8;BKK";
lMktBKKHKGSegment.addLegKey (lCXBKKRoutingLegStr);
lMktBKKHKGSegment.setBoardingDate (lDate);
lMktBKKHKGSegment.setOffDate (lDate);
lMktBKKHKGSegment.setBoardingTime (l1200);
lMktBKKHKGSegment.setOffTime (l1540);
lMktBKKHKGSegment.setElapsedTime (l0240);
LegDateKey lLegDateKey (lSIN);
lSINLeg.setOffPoint (lBKK);
lSINLeg.setBoardingDate (lDate);
lSINLeg.setOffDate (lDate);
lSINLeg.setBoardingTime (l0820);
lSINLeg.setOffTime (l1100);
lSINLeg.setElapsedTime (l0340);
SegmentCabinKey lYSegmentCabinKey (lY);
SegmentCabin& lSINBKKSegmentYCabin =
SegmentCabin& lMktBKKHKGSegmentYCabin =
LegCabinKey lYLegCabinKey (lY);
LegCabin& lSINLegYCabin =
lSINLegYCabin.setCapacities (lCapacity);
lSINLegYCabin.setAvailabilityPool (lCapacity);
FareFamilyKey l1FareFamilyKey (l1);
FareFamily& lSINBKKSegmentYCabin1Family =
lSINBKKSegmentYCabin1Family);
lSINBKKSegmentYCabin1Family);
FareFamily& lMktBKKHKGSegmentYCabin1Family =
lMktBKKHKGSegmentYCabin1Family);
lMktBKKHKGSegmentYCabin1Family);
BookingClassKey lYBookingClassKey (lY);
BookingClass& lSINBKKSegmentYCabin1FamilyYClass =
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass);
lSINBKKSegmentYCabin1FamilyYClass.setYield(700);
BookingClass& lMktBKKHKGSegmentYCabin1FamilyYClass =
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass);
lMktBKKHKGSegmentYCabin1FamilyYClass.setYield(700);
BookingClassKey lMBookingClassKey (lM);
BookingClass& lSINBKKSegmentYCabin1FamilyMClass =
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass);
lSINBKKSegmentYCabin1FamilyMClass.setYield(500);
BookingClass& lMktBKKHKGSegmentYCabin1FamilyMClass =
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass);
lMktBKKHKGSegmentYCabin1FamilyMClass.setYield(500);
OnDString_T lSQSINBKKOnDStr =
"SQ;11,2010-Mar-08;SIN,BKK";
OnDString_T lMktSQBKKHKGOnDStr =
"SQ;1200,2010-Mar-08;BKK,HKG";
lOnDStringList.push_back (lSQSINBKKOnDStr);
lOnDStringList.push_back (lMktSQBKKHKGOnDStr);
OnDDateKey lOnDDateKey (lOnDStringList);
OnDDate& lSQ_SINHKG_OnDDate =
const WTP_T lWTP750 = 750.0;
lSQ_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
lCabinClassPairList.push_back(lCC_YM1);
lCabinClassPairList.push_back(lCC_YM2);
lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList, lYield850Mean20StdDev2);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lCabinClassPairList.push_back(lCC_YY2);
lMean10StdDev1);
lSQ_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield1200Mean10StdDev1);
lOnDStringList.clear();
lOnDStringList.push_back (lSQSINBKKOnDStr);
lOnDDateKey = OnDDateKey(lOnDStringList);
OnDDate& lSQ_SINBKK_OnDDate =
const WTP_T lWTP400 = 400.0;
lSQ_SINBKK_OnDDate.setTotalForecast (lY, lWTP400Mean60StdDev6);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YM1);
lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList,
lYield500Mean20StdDev1);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lSQ_SINBKK_OnDDate.setDemandInformation (lCabinClassPairList,
lYield700Mean20StdDev1);
OnDString_T lMktCXSINBKKOnDStr =
"CX;1100,2010-Mar-08;SIN,BKK";
OnDString_T lCXBKKHKGOnDStr =
"CX;12,2010-Mar-08;BKK,HKG";
lOnDStringList.clear();
lOnDStringList.push_back (lMktCXSINBKKOnDStr);
lOnDStringList.push_back (lCXBKKHKGOnDStr);
lOnDDateKey = OnDDateKey(lOnDStringList);
OnDDate& lCX_SINHKG_OnDDate =
lCX_SINHKG_OnDDate.setTotalForecast (lY, lWTP750Mean60StdDev6);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YM1);
lCabinClassPairList.push_back(lCC_YM2);
lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield850Mean20StdDev2);
lCabinClassPairList.clear();
lCabinClassPairList.push_back(lCC_YY1);
lCabinClassPairList.push_back(lCC_YY2);
lCX_SINHKG_OnDDate.setDemandInformation (lCabinClassPairList,
lYield1200Mean10StdDev1);
const DoWStruct lDoWSrtuct ("1111111");
const Date_T lDateRangeStart (2010, boost::gregorian::Mar, 8);
const Date_T lDateRangeEnd (2010, boost::gregorian::Mar, 9);
const DatePeriod_T lDatePeriod (lDateRangeStart, lDateRangeEnd);
const PeriodStruct lPeriodStruct (lDatePeriod,lDoWSrtuct);
FlightPeriodKey lFlightPeriodKey (lFlightNumber, lPeriodStruct);
FlightPeriod& lSQ11FlightPeriod =
SegmentPeriodKey lSegmentPeriodKey (lSIN, lBKK);
SegmentPeriod& lSINBKKSegmentPeriod =
lSINBKKSegmentPeriod.setBoardingTime (l0820);
lSINBKKSegmentPeriod.setOffTime (l1100);
lSINBKKSegmentPeriod.setElapsedTime (l0340);
lSINBKKSegmentPeriod.addCabinBookingClassList (lY,lYM);
lFlightPeriodKey = FlightPeriodKey(lFlightNumber, lPeriodStruct);
FlightPeriod& lCX12FlightPeriod =
lSegmentPeriodKey = SegmentPeriodKey (lBKK, lHKG);
SegmentPeriod& lBKKHKGSegmentPeriod =
lBKKHKGSegmentPeriod.setBoardingTime (l1200);
lBKKHKGSegmentPeriod.setOffTime (l1540);
lBKKHKGSegmentPeriod.setElapsedTime (l0240);
lBKKHKGSegmentPeriod.addCabinBookingClassList (lY,lYM);
}
void CmdBomManager::buildPartnershipsSamplePricing (BomRoot& ioBomRoot) {
AirportPairKey lAirportPairKey ("SIN", "BKK");
AirportPair& lSINBKKAirportPair =
const Date_T lDateRangeStart (2010, boost::gregorian::Mar, 01);
const Date_T lDateRangeEnd (2010, boost::gregorian::Mar, 31);
const DatePeriod_T lDateRange (lDateRangeStart, lDateRangeEnd);
const DatePeriodKey lDatePeriodKey (lDateRange);
DatePeriod& lSINBKKDatePeriod =
PosChannelKey lPosChannelKey ("SIN","IN");
PosChannel& lSINPosChannel =
const Time_T lTimeRangeStart (0, 0, 0);
const Time_T lTimeRangeEnd (23, 0, 0);
const TimePeriodKey lFareTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
TimePeriod& lSINBKKFareTimePeriod =
FareFeatures& lSINBKKFareFeatures =
lSQAirlineCodeList.push_back ("SQ");
lYClassCodeList.push_back ("Y");
const AirlineClassListKey lSQAirlineYClassListKey (lSQAirlineCodeList,
lYClassCodeList);
lMClassCodeList.push_back ("M");
const AirlineClassListKey lSQAirlineMClassListKey (lSQAirlineCodeList,
lMClassCodeList);
AirlineClassList& lSQAirlineYClassList =
lSQAirlineYClassList.setFare(700);
AirlineClassList& lSQAirlineMClassList =
lSQAirlineMClassList.setFare(500);
lAirportPairKey = AirportPairKey ("BKK", "HKG");
AirportPair& lBKKHKGAirportPair =
DatePeriod& lBKKHKGDatePeriod =
lPosChannelKey = PosChannelKey("BKK","IN");
PosChannel& lBKKPosChannel =
TimePeriod& lBKKHKGFareTimePeriod =
FareFeatures& lBKKHKGFareFeatures =
lCXAirlineCodeList.push_back ("CX");
const AirlineClassListKey lCXAirlineYClassListKey (lCXAirlineCodeList,
lYClassCodeList);
const AirlineClassListKey lCXAirlineMClassListKey (lCXAirlineCodeList,
lMClassCodeList);
AirlineClassList& lCXAirlineYClassList =
lCXAirlineYClassList.setFare(700);
AirlineClassList& lCXAirlineMClassList =
lCXAirlineMClassList.setFare(500);
lAirportPairKey = AirportPairKey ("SIN", "HKG");
AirportPair& lSINHKGAirportPair =
DatePeriod& lSINHKGDatePeriod =
lPosChannelKey = PosChannelKey("SIN","IN");
PosChannel& lOnDSINPosChannel =
TimePeriod& lSINHKGFareTimePeriod =
FareFeatures& lSINHKGFareFeatures =
lSQ_CXAirlineCodeList.push_back ("SQ");
lSQ_CXAirlineCodeList.push_back ("CX");
lY_YClassCodeList.push_back ("Y");
lY_YClassCodeList.push_back ("Y");
const AirlineClassListKey lSQ_CXAirlineYClassListKey (lSQ_CXAirlineCodeList,
lY_YClassCodeList);
lM_MClassCodeList.push_back ("M");
lM_MClassCodeList.push_back ("M");
const AirlineClassListKey lSQ_CXAirlineMClassListKey (lSQ_CXAirlineCodeList,
lM_MClassCodeList);
AirlineClassList& lSQ_CXAirlineYClassList =
lSQ_CXAirlineYClassList.setFare(1200);
lSQ_CXAirlineYClassList);
lSQ_CXAirlineYClassList);
AirlineClassList& lSQ_CXAirlineMClassList =
lSQ_CXAirlineMClassList.setFare(850);
lSQ_CXAirlineMClassList);
lSQ_CXAirlineMClassList);
PosChannel& lRAC_SINBKKPosChannel =
const TimePeriodKey lYieldTimePeriodKey (lTimeRangeStart,
lTimeRangeEnd);
TimePeriod& lSINBKKYieldTimePeriod =
lSINBKKYieldTimePeriod);
lSINBKKYieldTimePeriod);
YieldFeatures& lSINBKKYieldFeatures =
lSINBKKYieldFeatures);
lSINBKKYieldFeatures);
AirlineClassList& lRAC_SQAirlineYClassList =
lRAC_SQAirlineYClassList.setYield(700);
lRAC_SQAirlineYClassList);
lRAC_SQAirlineYClassList);
AirlineClassList& lRAC_SQAirlineMClassList =
lRAC_SQAirlineMClassList.setYield(500);
lRAC_SQAirlineMClassList);
lRAC_SQAirlineMClassList);
PosChannel& lRAC_BKKHKGPosChannel =
TimePeriod& lBKKHKGYieldTimePeriod =
lBKKHKGYieldTimePeriod);
lBKKHKGYieldTimePeriod);
YieldFeatures& lBKKHKGYieldFeatures =
lBKKHKGYieldFeatures);
lBKKHKGYieldFeatures);
AirlineClassList& lRAC_CXAirlineYClassList =
lRAC_CXAirlineYClassList.setYield(700);
lRAC_CXAirlineYClassList);
lRAC_CXAirlineYClassList);
AirlineClassList& lRAC_CXAirlineMClassList =
lRAC_CXAirlineMClassList.setYield(500);
lRAC_CXAirlineMClassList);
lRAC_CXAirlineMClassList);
PosChannel& lRAC_SINHKGChannel =
TimePeriod& lSINHKGYieldTimePeriod =
YieldFeatures& lSINHKGYieldFeatures =
lSINHKGYieldFeatures);
lSINHKGYieldFeatures);
AirlineClassList& lRAC_SQ_CXAirlineYClassList =
lRAC_SQ_CXAirlineYClassList.setYield(1200);
lRAC_SQ_CXAirlineYClassList);
lRAC_SQ_CXAirlineYClassList);
AirlineClassList& lRAC_SQ_CXAirlineMClassList =
lRAC_SQ_CXAirlineMClassList.setYield(850);
lRAC_SQ_CXAirlineMClassList);
lRAC_SQ_CXAirlineMClassList);
}
}
#define STDAIR_LOG_DEBUG(iToBeLogged)
Handle on the StdAir library context.
boost::gregorian::date Date_T
const ChangeFees_T CHANGE_FEES
boost::posix_time::ptime DateTime_T
const SaturdayStay_T SATURDAY_STAY
boost::gregorian::date_duration DateOffset_T
const ClassCode_T CLASS_CODE_Y
const AirlineCode_T AIRLINE_CODE_BA
std::pair< MeanValue_T, StdDevValue_T > MeanStdDevPair_T
const ChannelLabel_T CHANNEL_DN
std::pair< CabinCode_T, ClassCode_T > CabinClassPair_T
std::pair< WTP_T, MeanStdDevPair_T > WTPDemandPair_T
std::string ChannelLabel_T
const TripType_T TRIP_TYPE_INBOUND
const TripType_T TRIP_TYPE_ROUND_TRIP
boost::posix_time::time_duration Time_T
const NonRefundable_T NON_REFUNDABLE
const CabinCode_T CABIN_ECO
const AirportCode_T AIRPORT_SYD
const CabinCode_T DEFAULT_CABIN_CODE
const DayDuration_T NO_STAY_DURATION
const AirportCode_T DEFAULT_DESTINATION
const AirlineCode_T DEFAULT_AIRLINE_CODE
std::vector< ClassList_String_T > ClassList_StringList_T
std::map< const ClassCode_T, Availability_T > ClassAvailabilityMap_T
std::list< TravelSolutionStruct > TravelSolutionList_T
const PriceValue_T DEFAULT_VALUE_OF_TIME
const ClassCode_T CLASS_CODE_Q
std::string FrequentFlyer_T
const AirportCode_T DEFAULT_ORIGIN
std::list< OnDString_T > OnDStringList_T
const CabinCode_T CABIN_Y
std::string ClassList_String_T
std::vector< MeanStdDevPair_T > MeanStdDevPairVector_T
const AirportCode_T AIRPORT_BKK
const DayDuration_T DEFAULT_STAY_DURATION
boost::gregorian::date_period DatePeriod_T
const NonRefundable_T NO_NON_REFUNDABLE
std::list< CabinClassPair_T > CabinClassPairList_T
const ChannelLabel_T DEFAULT_CHANNEL
const CabinCapacity_T DEFAULT_CABIN_CAPACITY
const TripType_T TRIP_TYPE_ONE_WAY
const ChangeFees_T NO_CHANGE_FEES
const FrequentFlyer_T FREQUENT_FLYER_MEMBER
const CityCode_T DEFAULT_POS
unsigned short FlightNumber_T
std::string AirlineCode_T
boost::posix_time::time_duration Duration_T
const AirportCode_T AIRPORT_SIN
const DayDuration_T NO_ADVANCE_PURCHASE
const AirportCode_T AIRPORT_LHR
std::vector< AirlineCode_T > AirlineCodeList_T
const FlightNumber_T DEFAULT_FLIGHT_NUMBER_FF
LocationCode_T CityCode_T
const Date_T DEFAULT_DEPARTURE_DATE
LocationCode_T AirportCode_T
const ChannelLabel_T CHANNEL_IN
std::pair< Yield_T, MeanStdDevPair_T > YieldDemandPair_T
const FlightNumber_T DEFAULT_FLIGHT_NUMBER
static FacBom & instance()
static void setAirlineFeature(Inventory &iInventory, AirlineFeature &iAirlineFeature)
static void linkWithParent(PARENT &, CHILD &)
static void addToListAndMap(OBJECT1 &, OBJECT2 &)