10 #include <stdair/stdair_basic_types.hpp>
11 #include <stdair/service/Logger.hpp>
23 const short lNbOfFlights =
27 const short lNbOfUncensoredData =
30 if (lNbOfUncensoredData > 1) {
32 const stdair::NbOfBookings_T lNbOfUncensoredBookings =
35 const double lMeanOfUncensoredBookings =
36 static_cast<double>(lNbOfUncensoredBookings/lNbOfUncensoredData);
38 const double lStdDevOfUncensoredBookings =
40 (lMeanOfUncensoredBookings, lNbOfUncensoredData);
42 std::vector<bool> toBeUnconstrained =
45 double lDemandMean = lMeanOfUncensoredBookings;
46 double lStdDev = lStdDevOfUncensoredBookings;
52 bool stopUnconstraining =
false;
53 while (stopUnconstraining ==
false) {
54 stopUnconstraining =
true;
56 for (
short i = 0; i < lNbOfFlights; ++i) {
57 if (toBeUnconstrained.at(i) ==
true) {
59 const stdair::NbOfBookings_T demand =
64 const stdair::NbOfBookings_T expectedDemand =
65 ioHistoricalBookingHolder.
66 calculateExpectedDemand (lDemandMean, lStdDev, i, demand);
68 assert (expectedDemand >= 0 || expectedDemand < 0);
71 static_cast<double>(expectedDemand - demand);
76 if (absDiff < 0.001) {
77 toBeUnconstrained.at (i) =
false;
80 stopUnconstraining =
false;
88 if (stopUnconstraining ==
false) {