RMOL Logo Get Revenue Management Optimisation Library at SourceForge.net. Fast, secure and Free Open Source software downloads

Forecaster.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 #include <math.h>
00005 // RMOL
00006 #include <rmol/bom/Bucket.hpp>
00007 #include <rmol/bom/BucketHolder.hpp>
00008 #include <rmol/bom/HistoricalBooking.hpp>
00009 #include <rmol/bom/HistoricalBookingHolder.hpp>
00010 #include <rmol/bom/HistoricalBookingHolderHolder.hpp>
00011 #include <rmol/bom/SellupProbabilityCalculator.hpp>
00012 #include <rmol/bom/QEquivalentBookingCalculator.hpp>
00013 #include <rmol/command/Forecaster.hpp>
00014 
00015 namespace RMOL {
00016 
00017   // //////////////////////////////////////////////////////////////////////
00018   void Forecaster::qEquivalentBookingCalculation 
00019        (BucketHolder& ioBucketHolder,
00020         SellupFactorHolder_T& iSellupFactorHolder,
00021         HistoricalBookingHolderHolder& iHistoricalBookingHolderHolder,
00022         HolderOfQEquivalentBookingsPerSimilarFlight_T& 
00023                                       oQEquivalentBookingsPerSimilarFlight){
00024 
00025     // Get the lowest yield of the given buckets
00026     const double qYield = ioBucketHolder.getLowestAverageYield ();
00027 
00028     // Initialize a vector for sell-up probabilities
00029     std::vector<double> lSellupProbabilityVector;
00030 
00031     // Compute sell-up probability for each bucket and store it in a vector
00032     SellupProbabilityCalculator::calculateSellupProbability
00033       (ioBucketHolder, qYield, iSellupFactorHolder, lSellupProbabilityVector);
00034     
00035     // Compute total Q-equivalent bookings
00036     QEquivalentBookingCalculator::calculateQEquivalentBooking 
00037       (iHistoricalBookingHolderHolder, 
00038        lSellupProbabilityVector, 
00039        oQEquivalentBookingsPerSimilarFlight);
00040   }
00041 
00042   // //////////////////////////////////////////////////////////////////////  
00043   void Forecaster::demandForecastByQForecasting 
00044        (ForecastedDemandParameterList_T oForecastedDemandParameterList,
00045         HistoricalDataHolderHolder_T& iHistoricalDataHolderHolder,
00046         PriceHolder_T& iPriceHolder) {
00047     // Run Q-Forecasting algorithm
00048     // 1. Obtain forecasted Q-eqivalent demand mean and s.d.(mu_Q, sigma_Q)
00049     // 2. Partition to each class
00050     //    E(alpha x Q)=alpha x mu_Q, S.D.(alpha x Q) = |alpha| X sigma_Q
00051 
00052     //qEquivalentDemandCalculation();
00053 
00054   }
00055 }
SourceForge Logo

Generated on Fri Jul 30 21:53:12 2010 for RMOL by Doxygen 1.6.1