14 const std::string DemandGenerationMethod::_labels[
LAST_VALUE] =
15 {
"PoissonProcess",
"StatisticsOrder" };
18 const char DemandGenerationMethod::_methodLabels[
LAST_VALUE] = {
'P',
'S' };
22 DemandGenerationMethod::DemandGenerationMethod() : _method (
LAST_VALUE) {
27 DemandGenerationMethod::
29 : _method (iDemandGenerationMethod._method) {
33 DemandGenerationMethod::
35 : _method (iDemandGenerationMethod) {
42 switch (iMethodChar) {
43 case 'P': oMethod =
POI_PRO;
break;
44 case 'S': oMethod =
STA_ORD;
break;
50 std::ostringstream oMessage;
51 oMessage <<
"The demand (booking request) generation method '"
53 <<
"' is not known. Known demand (booking request) generation "
54 <<
"methods: " << lLabels;
62 DemandGenerationMethod::DemandGenerationMethod (
const char iMethodChar)
63 : _method (getMethod (iMethodChar)) {
67 DemandGenerationMethod::
68 DemandGenerationMethod (
const std::string& iMethodStr) {
70 const size_t lSize = iMethodStr.size();
72 const char lMethodChar = iMethodStr[0];
79 return _labels[iMethod];
85 return _methodLabels[iMethod];
91 std::ostringstream oStr;
92 oStr << _methodLabels[iMethod];
98 std::ostringstream ostr;
99 for (
unsigned short idx = 0; idx !=
LAST_VALUE; ++idx) {
103 ostr << _labels[idx];
116 const char oMethodChar = _methodLabels[_method];
122 std::ostringstream oStr;
123 oStr << _methodLabels[_method];
129 std::ostringstream ostr;
130 ostr << _labels[_method];
137 return (_method == iMethod);