$treeview $search $mathjax
00001 #ifndef __STDAIR_BOM_BOOKINGCLASS_HPP 00002 #define __STDAIR_BOM_BOOKINGCLASS_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STL 00008 #include <iosfwd> 00009 #include <string> 00010 // StdAir 00011 #include <stdair/stdair_inventory_types.hpp> 00012 #include <stdair/stdair_maths_types.hpp> 00013 #include <stdair/stdair_rm_types.hpp> 00014 #include <stdair/bom/BomAbstract.hpp> 00015 #include <stdair/bom/BookingClassKey.hpp> 00016 #include <stdair/bom/BookingClassTypes.hpp> 00017 00018 namespace stdair { 00019 00024 class BookingClass : public BomAbstract { 00025 template <typename BOM> friend class FacBom; 00026 template <typename BOM> friend class FacCloneBom; 00027 friend class FacBomManager; 00028 00029 public: 00030 // ////////// Type definitions //////////// 00032 typedef BookingClassKey Key_T; 00033 00034 public: 00035 // /////////// Getters //////////// 00037 const Key_T& getKey() const { 00038 return _key; 00039 } 00040 00042 const ClassCode_T& getClassCode() const { 00043 return _key.getClassCode(); 00044 } 00045 00047 BomAbstract* const getParent() const { 00048 return _parent; 00049 } 00050 00052 const HolderMap_T& getHolderMap() const { 00053 return _holderMap; 00054 } 00055 00057 const SubclassCode_T& getSubclassCode() const { 00058 return _subclassCode; 00059 } 00060 00062 const AuthorizationLevel_T& getAuthorizationLevel() const { 00063 return _au; 00064 } 00065 00067 const ProtectionLevel_T& getProtection() const { 00068 return _protection; 00069 } 00070 00072 const ProtectionLevel_T& getCumulatedProtection() const { 00073 return _cumulatedProtection; 00074 } 00075 00077 const BookingLimit_T& getCumulatedBookingLimit() const { 00078 return _cumulatedBookingLimit; 00079 } 00080 00082 const NbOfSeats_T& getNegotiatedSpace() const { 00083 return _nego; 00084 } 00085 00087 const OverbookingRate_T& getNoShowPercentage() const { 00088 return _noShowPercentage; 00089 } 00090 00092 const OverbookingRate_T& getCancellationPercentage() const { 00093 return _cancellationPercentage; 00094 } 00095 00097 const NbOfBookings_T& getNbOfBookings() const { 00098 return _nbOfBookings; 00099 } 00100 00102 const NbOfBookings_T& getNbOfGroupBookings() const { 00103 return _groupNbOfBookings; 00104 } 00105 00107 const NbOfBookings_T& getNbOfPendingGroupBookings() const { 00108 return _groupPendingNbOfBookings; 00109 } 00110 00112 const NbOfBookings_T& getNbOfStaffBookings() const { 00113 return _staffNbOfBookings; 00114 } 00115 00117 const NbOfBookings_T& getNbOfWLBookings() const { 00118 return _wlNbOfBookings; 00119 } 00120 00122 const NbOfCancellations_T& getNbOfCancellations() const { 00123 return _nbOfCancellations; 00124 } 00125 00127 const NbOfBookings_T& getETB() const { 00128 return _etb; 00129 } 00130 00132 const Availability_T& getNetClassAvailability() const { 00133 return _netClassAvailability; 00134 } 00135 00137 const Availability_T& getSegmentAvailability() const { 00138 return _segmentAvailability; 00139 } 00140 00142 const Availability_T& getNetRevenueAvailability() const { 00143 return _netRevenueAvailability; 00144 } 00145 00147 const Yield_T& getYield () const { return _yield; } 00148 const Yield_T& getAdjustedYield () const { return _adjustedYield; } 00149 00151 const MeanValue_T& getMean () const { return _mean; } 00152 const StdDevValue_T& getStdDev () const {return _stdDev; } 00153 const MeanValue_T& getPriceDemMean () const { return _priceDemMean; } 00154 const StdDevValue_T& getPriceDemStdDev () const { return _priceDemStdDev; } 00155 const MeanValue_T& getCumuPriceDemMean () const { 00156 return _cumuPriceDemMean; 00157 } 00158 const StdDevValue_T& getCumuPriceDemStdDev () const { 00159 return _cumuPriceDemStdDev; 00160 } 00161 const MeanValue_T& getProductDemMean () const { return _productDemMean; } 00162 const StdDevValue_T& getProductDemStdDev () const {return _productDemStdDev; } 00163 00165 const GeneratedDemandVector_T& getGeneratedDemandVector () const { 00166 return _generatedDemandVector; 00167 } 00168 00169 public: 00170 // /////////// Setters //////////// 00172 void setCumulatedProtection (const ProtectionLevel_T& iPL) { 00173 _cumulatedProtection = iPL; 00174 } 00175 00177 void setProtection (const ProtectionLevel_T& iPL) { 00178 _protection = iPL; 00179 } 00180 00182 void setCumulatedBookingLimit (const BookingLimit_T& iBL) { 00183 _cumulatedBookingLimit = iBL; 00184 } 00185 00187 void setAuthorizationLevel (const AuthorizationLevel_T& iAU) { 00188 _au = iAU; 00189 } 00190 00192 void setSegmentAvailability (const Availability_T& iAvl) { 00193 _segmentAvailability = iAvl; 00194 } 00195 00197 void setYield (const Yield_T& iYield) { 00198 _yield = iYield; 00199 _adjustedYield = iYield; 00200 } 00201 void setAdjustedYield (const Yield_T& iYield) { _adjustedYield = iYield; } 00202 00204 void setMean (const MeanValue_T& iMean) { _mean = iMean; } 00205 void setStdDev (const StdDevValue_T& iStdDev) { _stdDev = iStdDev; } 00206 void setPriceDemMean (const MeanValue_T& iMean) { _priceDemMean = iMean; } 00207 void setPriceDemStdDev (const StdDevValue_T& iStdDev) { 00208 _priceDemStdDev = iStdDev; 00209 } 00210 void setCumuPriceDemMean (const MeanValue_T& iMean) { 00211 _cumuPriceDemMean = iMean; } 00212 void setCumuPriceDemStdDev (const StdDevValue_T& iStdDev) { 00213 _cumuPriceDemStdDev = iStdDev; 00214 } 00215 void setProductDemMean (const MeanValue_T& iMean) { 00216 _productDemMean = iMean; 00217 } 00218 void setProductDemStdDev (const StdDevValue_T& iStdDev) { 00219 _productDemStdDev = iStdDev; 00220 } 00221 00222 public: 00223 // /////////// Display support methods ///////// 00226 void toStream (std::ostream& ioOut) const { 00227 ioOut << toString(); 00228 } 00229 00232 void fromStream (std::istream& ioIn) { 00233 } 00234 00236 std::string toString() const; 00237 00239 const std::string describeKey() const { 00240 return _key.toString(); 00241 } 00242 00243 public: 00244 // ////////////// Business Methods ///////////////// 00246 void sell (const NbOfBookings_T&); 00247 00249 void cancel (const NbOfBookings_T&); 00250 00253 void generateDemandSamples (const NbOfSamples_T&); 00254 00257 void generateDemandSamples (const NbOfSamples_T&, const RandomSeed_T&); 00258 00259 protected: 00260 // ////////// Constructors and destructors ///////// 00262 BookingClass (const Key_T&); 00264 virtual ~BookingClass(); 00265 00266 private: 00268 BookingClass(); 00270 BookingClass (const BookingClass&); 00271 00272 00273 protected: 00274 // ////////// Attributes ///////// 00276 Key_T _key; 00277 00279 BomAbstract* _parent; 00280 00282 HolderMap_T _holderMap; 00283 00285 SubclassCode_T _subclassCode; 00286 00288 ProtectionLevel_T _cumulatedProtection; 00289 00291 ProtectionLevel_T _protection; 00292 00294 BookingLimit_T _cumulatedBookingLimit; 00295 00297 AuthorizationLevel_T _au; 00298 00300 NbOfSeats_T _nego; 00301 00303 OverbookingRate_T _noShowPercentage; 00304 00306 OverbookingRate_T _cancellationPercentage; 00307 00309 NbOfBookings_T _nbOfBookings; 00310 00312 NbOfBookings_T _groupNbOfBookings; 00313 00315 NbOfBookings_T _groupPendingNbOfBookings; 00316 00318 NbOfBookings_T _staffNbOfBookings; 00319 00321 NbOfBookings_T _wlNbOfBookings; 00322 00324 NbOfCancellations_T _nbOfCancellations; 00325 00327 NbOfBookings_T _etb; 00328 00330 Availability_T _netClassAvailability; 00331 00333 Availability_T _segmentAvailability; 00334 00336 Availability_T _netRevenueAvailability; 00337 00339 Yield_T _yield; 00340 Yield_T _adjustedYield; 00341 00343 MeanValue_T _mean; 00344 StdDevValue_T _stdDev; 00345 00347 MeanValue_T _priceDemMean; 00348 StdDevValue_T _priceDemStdDev; 00349 00351 MeanValue_T _cumuPriceDemMean; 00352 StdDevValue_T _cumuPriceDemStdDev; 00353 00355 MeanValue_T _productDemMean; 00356 StdDevValue_T _productDemStdDev; 00357 00359 GeneratedDemandVector_T _generatedDemandVector; 00360 }; 00361 00362 } 00363 #endif // __STDAIR_BOM_BOOKINGCLASS_HPP