StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
BookingClass.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_BOOKINGCLASS_HPP
2 #define __STDAIR_BOM_BOOKINGCLASS_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
17 
18 namespace stdair {
19 
24  class BookingClass : public BomAbstract {
25  template <typename BOM> friend class FacBom;
26  template <typename BOM> friend class FacCloneBom;
27  friend class FacBomManager;
28 
29  public:
30  // ////////// Type definitions ////////////
33 
34  public:
35  // /////////// Getters ////////////
37  const Key_T& getKey() const {
38  return _key;
39  }
40 
42  const ClassCode_T& getClassCode() const {
43  return _key.getClassCode();
44  }
45 
47  BomAbstract* const getParent() const {
48  return _parent;
49  }
50 
52  const HolderMap_T& getHolderMap() const {
53  return _holderMap;
54  }
55 
58  return _subclassCode;
59  }
60 
63  return _au;
64  }
65 
68  return _protection;
69  }
70 
73  return _cumulatedProtection;
74  }
75 
79  }
80 
83  return _nego;
84  }
85 
88  return _noShowPercentage;
89  }
90 
94  }
95 
98  return _nbOfBookings;
99  }
100 
103  return _groupNbOfBookings;
104  }
105 
109  }
110 
113  return _staffNbOfBookings;
114  }
115 
118  return _wlNbOfBookings;
119  }
120 
123  return _nbOfCancellations;
124  }
125 
127  const NbOfBookings_T& getETB() const {
128  return _etb;
129  }
130 
133  return _netClassAvailability;
134  }
135 
138  return _segmentAvailability;
139  }
140 
144  }
145 
147  const Yield_T& getYield () const { return _yield; }
148  const Yield_T& getAdjustedYield () const { return _adjustedYield; }
149 
151  const MeanValue_T& getMean () const { return _mean; }
152  const StdDevValue_T& getStdDev () const {return _stdDev; }
153  const MeanValue_T& getPriceDemMean () const { return _priceDemMean; }
154  const StdDevValue_T& getPriceDemStdDev () const { return _priceDemStdDev; }
156  return _cumuPriceDemMean;
157  }
159  return _cumuPriceDemStdDev;
160  }
161  const MeanValue_T& getProductDemMean () const { return _productDemMean; }
163 
166  return _generatedDemandVector;
167  }
168 
169  public:
170  // /////////// Setters ////////////
173  _cumulatedProtection = iPL;
174  }
175 
177  void setProtection (const ProtectionLevel_T& iPL) {
178  _protection = iPL;
179  }
180 
184  }
185 
188  _au = iAU;
189  }
190 
193  _segmentAvailability = iAvl;
194  }
195 
197  void setYield (const Yield_T& iYield) {
198  _yield = iYield;
199  _adjustedYield = iYield;
200  }
201  void setAdjustedYield (const Yield_T& iYield) { _adjustedYield = iYield; }
202 
204  void setMean (const MeanValue_T& iMean) { _mean = iMean; }
205  void setStdDev (const StdDevValue_T& iStdDev) { _stdDev = iStdDev; }
206  void setPriceDemMean (const MeanValue_T& iMean) { _priceDemMean = iMean; }
207  void setPriceDemStdDev (const StdDevValue_T& iStdDev) {
208  _priceDemStdDev = iStdDev;
209  }
210  void setCumuPriceDemMean (const MeanValue_T& iMean) {
211  _cumuPriceDemMean = iMean; }
212  void setCumuPriceDemStdDev (const StdDevValue_T& iStdDev) {
213  _cumuPriceDemStdDev = iStdDev;
214  }
215  void setProductDemMean (const MeanValue_T& iMean) {
216  _productDemMean = iMean;
217  }
218  void setProductDemStdDev (const StdDevValue_T& iStdDev) {
219  _productDemStdDev = iStdDev;
220  }
221 
222  public:
223  // /////////// Display support methods /////////
226  void toStream (std::ostream& ioOut) const {
227  ioOut << toString();
228  }
229 
232  void fromStream (std::istream& ioIn) {
233  }
234 
236  std::string toString() const;
237 
239  const std::string describeKey() const {
240  return _key.toString();
241  }
242 
243  public:
244  // ////////////// Business Methods /////////////////
246  void sell (const NbOfBookings_T&);
247 
249  void cancel (const NbOfBookings_T&);
250 
253  void generateDemandSamples (const NbOfSamples_T&);
254 
257  void generateDemandSamples (const NbOfSamples_T&, const RandomSeed_T&);
258 
259  protected:
260  // ////////// Constructors and destructors /////////
262  BookingClass (const Key_T&);
264  virtual ~BookingClass();
265 
266  private:
268  BookingClass();
270  BookingClass (const BookingClass&);
271 
272 
273  protected:
274  // ////////// Attributes /////////
276  Key_T _key;
277 
280 
283 
286 
289 
292 
295 
298 
301 
304 
307 
310 
313 
316 
319 
322 
325 
328 
331 
334 
337 
341 
345 
349 
353 
357 
360  };
361 
362 }
363 #endif // __STDAIR_BOM_BOOKINGCLASS_HPP
void toStream(std::ostream &ioOut) const
const Availability_T & getNetClassAvailability() const
ProtectionLevel_T _cumulatedProtection
void cancel(const NbOfBookings_T &)
NbOfBookings_T _etb
Utility class for linking StdAir-based objects.
void setPriceDemStdDev(const StdDevValue_T &iStdDev)
std::string toString() const
double Availability_T
BookingLimit_T _cumulatedBookingLimit
const ProtectionLevel_T & getProtection() const
OverbookingRate_T _noShowPercentage
void setPriceDemMean(const MeanValue_T &iMean)
const MeanValue_T & getPriceDemMean() const
Handle on the StdAir library context.
const std::string toString() const
BookingClassKey Key_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
MeanValue_T _priceDemMean
GeneratedDemandVector_T _generatedDemandVector
void setStdDev(const StdDevValue_T &iStdDev)
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
MeanValue_T _productDemMean
void setCumulatedBookingLimit(const BookingLimit_T &iBL)
const Yield_T & getYield() const
NbOfRequests_T NbOfBookings_T
const AuthorizationLevel_T & getAuthorizationLevel() const
const NbOfSeats_T & getNegotiatedSpace() const
void fromStream(std::istream &ioIn)
void setProductDemMean(const MeanValue_T &iMean)
StdDevValue_T _productDemStdDev
const MeanValue_T & getMean() const
AuthorizationLevel_T _au
void setCumulatedProtection(const ProtectionLevel_T &iPL)
const BookingLimit_T & getCumulatedBookingLimit() const
const NbOfBookings_T & getNbOfGroupBookings() const
double NbOfSeats_T
BomAbstract * _parent
NbOfBookings_T _staffNbOfBookings
const SubclassCode_T & getSubclassCode() const
const MeanValue_T & getProductDemMean() const
double StdDevValue_T
Base class for Factory layer.
Definition: FacBom.hpp:22
ProtectionLevel_T _protection
double MeanValue_T
const NbOfBookings_T & getNbOfWLBookings() const
NbOfBookings_T _groupNbOfBookings
Availability_T _netClassAvailability
const Availability_T & getNetRevenueAvailability() const
BomAbstract *const getParent() const
const OverbookingRate_T & getCancellationPercentage() const
StdDevValue_T _stdDev
std::vector< double > GeneratedDemandVector_T
const NbOfCancellations_T & getNbOfCancellations() const
const ProtectionLevel_T & getCumulatedProtection() const
const StdDevValue_T & getProductDemStdDev() const
const Yield_T & getAdjustedYield() const
NbOfBookings_T _groupPendingNbOfBookings
void setProtection(const ProtectionLevel_T &iPL)
const OverbookingRate_T & getNoShowPercentage() const
double AuthorizationLevel_T
void setYield(const Yield_T &iYield)
Availability_T _segmentAvailability
const NbOfBookings_T & getNbOfStaffBookings() const
const Availability_T & getSegmentAvailability() const
void setCumuPriceDemMean(const MeanValue_T &iMean)
unsigned int NbOfSamples_T
const std::string describeKey() const
void generateDemandSamples(const NbOfSamples_T &)
unsigned long int RandomSeed_T
StdDevValue_T _priceDemStdDev
void setProductDemStdDev(const StdDevValue_T &iStdDev)
void setMean(const MeanValue_T &iMean)
const StdDevValue_T & getPriceDemStdDev() const
NbOfBookings_T _wlNbOfBookings
const StdDevValue_T & getCumuPriceDemStdDev() const
const NbOfBookings_T & getNbOfPendingGroupBookings() const
const NbOfBookings_T & getNbOfBookings() const
const MeanValue_T & getCumuPriceDemMean() const
void setSegmentAvailability(const Availability_T &iAvl)
const ClassCode_T & getClassCode() const
SubclassCode_T _subclassCode
StdDevValue_T _cumuPriceDemStdDev
MeanValue_T _cumuPriceDemMean
OverbookingRate_T _cancellationPercentage
const StdDevValue_T & getStdDev() const
NbOfRequests_T NbOfCancellations_T
const NbOfBookings_T & getETB() const
NbOfCancellations_T _nbOfCancellations
const ClassCode_T & getClassCode() const
void setAuthorizationLevel(const AuthorizationLevel_T &iAU)
void setAdjustedYield(const Yield_T &iYield)
void setCumuPriceDemStdDev(const StdDevValue_T &iStdDev)
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
std::string ClassCode_T
const Key_T & getKey() const
const HolderMap_T & getHolderMap() const
unsigned short SubclassCode_T
void sell(const NbOfBookings_T &)
Availability_T _netRevenueAvailability
NbOfBookings_T _nbOfBookings
const GeneratedDemandVector_T & getGeneratedDemandVector() const