1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
Policy.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_POLICY_HPP
2
#define __STDAIR_BOM_POLICY_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <cmath>
9
// StdAir
10
#include <
stdair/stdair_basic_types.hpp
>
11
#include <
stdair/stdair_rm_types.hpp
>
12
#include <
stdair/bom/BomAbstract.hpp
>
13
#include <
stdair/bom/BookingClassTypes.hpp
>
14
#include <
stdair/bom/PolicyKey.hpp
>
15
17
namespace
boost
{
18
namespace
serialization
{
19
class
access;
20
}
21
}
22
23
namespace
stdair
{
24
30
class
Policy
:
public
BomAbstract
{
31
template
<
typename
BOM>
friend
class
FacBom
;
32
friend
class
FacBomManager
;
33
friend
class
boost::serialization::access
;
34
35
public
:
36
// ////////// Type definitions ////////////
40
typedef
PolicyKey
Key_T
;
41
42
public
:
43
// /////////////////// Getters ////////////////////////
45
const
Key_T
&
getKey
()
const
{
46
return
_key;
47
}
48
50
BomAbstract
*
const
getParent
()
const
{
51
return
_parent;
52
}
53
57
const
HolderMap_T
&
getHolderMap
()
const
{
58
return
_holderMap;
59
}
60
62
const
BookingClassList_T
&
getBookingClassList
()
const
;
63
65
const
NbOfBookings_T
&
getDemand
()
const
{
66
return
_demand;
67
}
68
70
const
StdDevValue_T
&
getStdDev
()
const
{
71
return
_stdDev;
72
}
73
75
const
Yield_T
&
getYield
()
const
{
76
return
_yield;
77
}
78
80
const
Revenue_T
getTotalRevenue
()
const
;
81
82
public
:
83
// ///////////////////// Setters /////////////////////
85
void
setDemand
(
const
NbOfBookings_T
& iDemand) {
86
_demand = iDemand;
87
}
88
90
void
setStdDev
(
const
StdDevValue_T
& iStdDev) {
91
_stdDev = iStdDev;
92
}
93
95
void
setYield
(
const
Yield_T
& iYield) {
96
_yield = iYield;
97
}
98
100
void
resetDemandForecast
() {
101
_demand = 0.0;
102
_stdDev = 0.0;
103
_yieldDemandMap.clear();
104
}
105
107
void
addYieldDemand
(
const
Yield_T
&,
const
NbOfBookings_T
&);
108
109
public
:
110
// /////////// Display support methods /////////
116
void
toStream
(std::ostream& ioOut)
const
{
117
ioOut <<
toString
();
118
}
119
125
void
fromStream
(std::istream& ioIn) {
126
}
127
131
std::string
toString
()
const
;
132
136
const
std::string
describeKey
()
const
{
137
return
_key.toString();
138
}
139
140
141
public
:
142
// /////////// (Boost) Serialisation support methods /////////
146
template
<
class
Archive>
147
void
serialize
(Archive& ar,
const
unsigned
int
iFileVersion);
148
149
private
:
157
void
serialisationImplementationExport()
const
;
158
void
serialisationImplementationImport();
159
160
161
protected
:
162
// /////////// Constructors and destructor. ////////////
166
Policy
(
const
Key_T
&);
167
171
virtual
~Policy
();
172
173
private
:
177
Policy
();
178
182
Policy
(
const
Policy
&);
183
184
185
private
:
186
// //////////// Attributes ////////////
190
Key_T
_key;
191
195
BomAbstract
* _parent;
196
200
HolderMap_T
_holderMap;
201
205
NbOfBookings_T
_demand;
206
210
StdDevValue_T
_stdDev;
211
215
Yield_T
_yield;
216
220
YieldDemandMap_T
_yieldDemandMap;
221
222
};
223
}
224
#endif
// __STDAIR_BOM_POLICY_HPP
BomAbstract.hpp
BookingClassTypes.hpp
PolicyKey.hpp
stdair_basic_types.hpp
stdair_rm_types.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::StdDevValue_T
double StdDevValue_T
Definition
stdair_maths_types.hpp:84
stdair::NbOfBookings_T
NbOfRequests_T NbOfBookings_T
Definition
stdair_basic_types.hpp:104
stdair::BookingClassList_T
std::list< BookingClass * > BookingClassList_T
Definition
BookingClassTypes.hpp:20
stdair::HolderMap_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition
BomAbstract.hpp:63
stdair::Yield_T
double Yield_T
Definition
stdair_inventory_types.hpp:113
stdair::Revenue_T
double Revenue_T
Definition
stdair_basic_types.hpp:85
stdair::YieldDemandMap_T
std::map< const Yield_T, double > YieldDemandMap_T
Definition
stdair_rm_types.hpp:71
boost
Forward declarations.
Definition
AirlineClassList.hpp:16
boost::serialization
Definition
AirlineClassList.hpp:17
stdair::BomAbstract::BomAbstract
BomAbstract()
Definition
BomAbstract.hpp:53
stdair::Policy::getDemand
const NbOfBookings_T & getDemand() const
Definition
Policy.hpp:65
stdair::Policy::getStdDev
const StdDevValue_T & getStdDev() const
Definition
Policy.hpp:70
stdair::Policy::addYieldDemand
void addYieldDemand(const Yield_T &, const NbOfBookings_T &)
Definition
Policy.cpp:70
stdair::Policy::getBookingClassList
const BookingClassList_T & getBookingClassList() const
Definition
Policy.cpp:52
stdair::Policy::setYield
void setYield(const Yield_T &iYield)
Definition
Policy.hpp:95
stdair::Policy::resetDemandForecast
void resetDemandForecast()
Definition
Policy.hpp:100
stdair::Policy::getHolderMap
const HolderMap_T & getHolderMap() const
Definition
Policy.hpp:57
stdair::Policy::Policy
Policy(const Key_T &)
Definition
Policy.cpp:31
stdair::Policy::toStream
void toStream(std::ostream &ioOut) const
Definition
Policy.hpp:116
stdair::Policy::getParent
BomAbstract *const getParent() const
Definition
Policy.hpp:50
stdair::Policy::describeKey
const std::string describeKey() const
Definition
Policy.hpp:136
stdair::Policy::setStdDev
void setStdDev(const StdDevValue_T &iStdDev)
Definition
Policy.hpp:90
stdair::Policy::~Policy
virtual ~Policy()
Definition
Policy.cpp:35
stdair::Policy::getTotalRevenue
const Revenue_T getTotalRevenue() const
Definition
Policy.cpp:57
stdair::Policy::toString
std::string toString() const
Definition
Policy.cpp:39
stdair::Policy::Key_T
PolicyKey Key_T
Definition
Policy.hpp:40
stdair::Policy::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
stdair::Policy::getYield
const Yield_T & getYield() const
Definition
Policy.hpp:75
stdair::Policy::getKey
const Key_T & getKey() const
Definition
Policy.hpp:45
stdair::Policy::FacBom
friend class FacBom
Definition
Policy.hpp:31
stdair::Policy::fromStream
void fromStream(std::istream &ioIn)
Definition
Policy.hpp:125
stdair::Policy::access
friend class boost::serialization::access
Definition
Policy.hpp:33
stdair::Policy::FacBomManager
friend class FacBomManager
Definition
Policy.hpp:32
stdair::Policy::setDemand
void setDemand(const NbOfBookings_T &iDemand)
Definition
Policy.hpp:85
stdair::PolicyKey
Key of a given policy, made of a policy code.
Definition
PolicyKey.hpp:26
Generated for StdAir by
1.17.0