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 
00047     void fillup (BookingLimitVector_T&) const;
00048     
00050     Bucket& getCurrentBucket () const;
00051 
00053     Bucket& getNextBucket () const;
00054 
00056     Bucket& getTaggedBucket () const;
00057 
00061     void begin ();
00062 
00065     void iterate ();
00066 
00069     bool hasNotReachedEnd () const;
00070 
00072     void tag ();
00073 
00078     void recalculate ();
00079 
00080   public:
00081     // ///////// Display methods ////////
00084     void toStream (std::ostream&) const;
00085 
00088     void fromStream (std::istream&);
00089 
00091     std::string toString() const;
00092 
00095     const std::string describeKey() const;
00096 
00099     const std::string describeShortKey() const;
00100     
00102     const std::string display() const;
00103 
00105     const std::string shortDisplay() const;
00106 
00107 
00108   private:
00111     BucketHolder ();
00112 
00116     BucketHolder (const double iCabinCapacity);
00117 
00119     virtual ~BucketHolder();
00120 
00121 
00122   private:
00124     const double _cabinCapacity;
00125 
00127     BucketList_T _bucketList;
00128 
00130     BucketList_T::iterator _itCurrentBucket;
00131     BucketList_T::iterator _itNextBucket;
00132     BucketList_T::iterator _itTaggedBucket;
00133 
00135     double _totalMeanDemand;
00136 
00138     double _demandFactor;
00139 
00142     double _optimalRevenue;
00143 
00144   protected:
00147     void calculateProtectionAndBookingLimits ();
00148     
00151     void calculateMeanDemandAndOptimalRevenue ();
00152 
00153   };
00154 }
00155 #endif // __RMOL_BOM_BUCKETHOLDER_HPP
SourceForge Logo

Generated on Tue Apr 14 17:57:51 2009 for RMOL by Doxygen 1.5.8