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   public:
00085     // ///////// Display methods ////////
00088     void toStream (std::ostream&) const;
00089 
00092     void fromStream (std::istream&);
00093 
00095     std::string toString() const;
00096 
00099     const std::string describeKey() const;
00100 
00103     const std::string describeShortKey() const;
00104     
00106     const std::string display() const;
00107 
00109     const std::string shortDisplay() const;
00110 
00111 
00112   private:
00115     BucketHolder ();
00116 
00120     BucketHolder (const double iCabinCapacity);
00121 
00123     virtual ~BucketHolder();
00124 
00125 
00126   private:
00128     const double _cabinCapacity;
00129 
00131     BucketList_T _bucketList;
00132 
00134     BucketList_T::iterator _itCurrentBucket;
00135     BucketList_T::iterator _itNextBucket;
00136     BucketList_T::iterator _itTaggedBucket;
00137 
00139     double _totalMeanDemand;
00140 
00142     double _demandFactor;
00143 
00146     double _optimalRevenue;
00147 
00148   protected:
00151     void calculateProtectionAndBookingLimits ();
00152     
00155     void calculateMeanDemandAndOptimalRevenue ();
00156 
00157   };
00158 }
00159 #endif // __RMOL_BOM_BUCKETHOLDER_HPP
SourceForge Logo

Generated on Sat Jun 6 13:48:25 2009 for RMOL by Doxygen 1.5.7.1