TravelCCM Logo  1.00.1
C++ Travel Customer Choice Model Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
ChoiceManager.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // StdAir
7 #include <stdair/bom/TravelSolutionStruct.hpp>
8 #include <stdair/bom/BookingRequestStruct.hpp>
9 // TravelCCM
14 
15 namespace TRAVELCCM {
16 
17  // ////////////////////////////////////////////////////////////////////
18  const stdair::TravelSolutionStruct* ChoiceManager::
19  chooseTravelSolution (stdair::TravelSolutionList_T& ioTravelSolutionList,
20  const stdair::BookingRequestStruct& iBookingRequest,
21  const stdair::PassengerChoiceModel::EN_PassengerChoiceModel& iPassengerChoiceModel) {
22 
23  const stdair::TravelSolutionStruct* oTravelSolution_ptr = NULL;
24 
25  switch (iPassengerChoiceModel) {
26  case stdair::PassengerChoiceModel::HYBRID:
27 
28  // Return the cheapest solution which minimises the fare plus the
29  // disutility for each unsatisfied restriction.
30  oTravelSolution_ptr =
31  HybridModel::chooseTravelSolution (ioTravelSolutionList,
32  iBookingRequest);
33  break;
34 
35  case stdair::PassengerChoiceModel::HARD_RESTRICTION:
36 
37  // Return the cheapest solution which satisfies the hard restrictions
38  // such as change fees and non refundable.
39  oTravelSolution_ptr =
40  HardRestrictionModel::chooseTravelSolution (ioTravelSolutionList,
41  iBookingRequest);
42  break;
43  case stdair::PassengerChoiceModel::PRICE_ORIENTED:
44 
45  // Return the cheapest solution
46  oTravelSolution_ptr =
47  PriceOrientedModel::chooseTravelSolution (ioTravelSolutionList,
48  iBookingRequest);
49  break;
50  default:
51  assert(false);
52  break;
53  }
54  return oTravelSolution_ptr;
55  }
56 
57 }