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

BucketHolder.hpp

Go to the documentation of this file.
00001 #ifndef __RMOL_BOM_BUCKETHOLDER_HPP
00002 #define __RMOL_BOM_BUCKETHOLDER_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iostream>
00009 // RMOL
00010 #include <rmol/RMOL_Types.hpp>
00011 #include <rmol/bom/BomAbstract.hpp>
00012 #include <rmol/bom/BucketList.hpp>
00013 
00014 namespace RMOL {
00015 
00018   class BucketHolder : public BomAbstract {
00022     friend class FacBucketHolder;
00023     
00024   public:
00025     // ////// Getters //////
00027     const double getCabinCapacity () const {
00028       return _cabinCapacity;
00029     }
00031     const double getTotalMeanDemand () const {
00032       return _totalMeanDemand;
00033     }
00035     const double getDemandFactor () const {
00036       return _demandFactor;
00037     }
00039     const double getOptimalRevenue () const {
00040       return _optimalRevenue;
00041     }
00042 
00044     const short getSize () const;
00045 
00048     const double getPreviousCumulatedProtection () const;
00049 
00051     void fillup (BookingLimitVector_T&) const;
00052     
00054     Bucket& getCurrentBucket () const;
00055 
00057     Bucket& getNextBucket () const;
00058 
00060     Bucket& getTaggedBucket () const;
00061 
00065     void begin ();
00066 
00069     void iterate ();
00070 
00073     bool hasNotReachedEnd () const;
00074 
00076     void tag ();
00077 
00082     void recalculate ();
00083 
00084     const double getLowestAverageYield ();
00085 
00086   public:
00087     // ///////// Display methods ////////
00090     void toStream (std::ostream&) const;
00091 
00094     void fromStream (std::istream&);
00095 
00097     std::string toString() const;
00098 
00101     const std::string describeKey() const;
00102 
00105     const std::string describeShortKey() const;
00106     
00108     const std::string display() const;
00109 
00111     const std::string shortDisplay() const;
00112 
00113 
00114   private:
00117     BucketHolder ();
00118 
00122     BucketHolder (const double iCabinCapacity);
00123 
00125     virtual ~BucketHolder();
00126 
00127 
00128   private:
00130     const double _cabinCapacity;
00131 
00133     BucketList_T _bucketList;
00134 
00136     BucketList_T::iterator _itCurrentBucket;
00137     BucketList_T::iterator _itNextBucket;
00138     BucketList_T::iterator _itTaggedBucket;
00139 
00141     double _totalMeanDemand;
00142 
00144     double _demandFactor;
00145 
00148     double _optimalRevenue;
00149 
00150   protected:
00153     void calculateProtectionAndBookingLimits ();
00154     
00157     void calculateMeanDemandAndOptimalRevenue ();
00158 
00159   };
00160 }
00161 #endif // __RMOL_BOM_BUCKETHOLDER_HPP
SourceForge Logo

Generated on Sun Mar 7 13:11:09 2010 for RMOL by Doxygen 1.6.1