From: <qua...@us...> - 2009-11-04 10:39:53
|
Revision: 59 http://stdair.svn.sourceforge.net/stdair/?rev=59&view=rev Author: quannaus Date: 2009-11-04 10:39:37 +0000 (Wed, 04 Nov 2009) Log Message: ----------- [dev] added some objects. Modified Paths: -------------- trunk/stdair/stdair/basic/sources.mk trunk/stdair/stdair/bom/AirlineFeatureMap.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassContent.cpp trunk/stdair/stdair/bom/BookingClassContent.hpp trunk/stdair/stdair/bom/BookingClassMap.cpp trunk/stdair/stdair/bom/BookingClassMap.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/FlightDateContent.cpp trunk/stdair/stdair/bom/FlightDateContent.hpp trunk/stdair/stdair/bom/FlightDateMap.cpp trunk/stdair/stdair/bom/FlightDateMap.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/InventoryMap.cpp trunk/stdair/stdair/bom/InventoryMap.hpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegCabinContent.cpp trunk/stdair/stdair/bom/LegCabinContent.hpp trunk/stdair/stdair/bom/LegCabinMap.cpp trunk/stdair/stdair/bom/LegCabinMap.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateContent.cpp trunk/stdair/stdair/bom/LegDateContent.hpp trunk/stdair/stdair/bom/LegDateMap.cpp trunk/stdair/stdair/bom/LegDateMap.hpp trunk/stdair/stdair/bom/OptimizerStruct.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentCabinContent.cpp trunk/stdair/stdair/bom/SegmentCabinContent.hpp trunk/stdair/stdair/bom/SegmentCabinMap.cpp trunk/stdair/stdair/bom/SegmentCabinMap.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/SegmentDateContent.cpp trunk/stdair/stdair/bom/SegmentDateContent.hpp trunk/stdair/stdair/bom/SegmentDateMap.cpp trunk/stdair/stdair/bom/SegmentDateMap.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/core/Makefile.am trunk/stdair/stdair/factory/FacBomStructure.hpp Added Paths: ----------- trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/BasConst_BookingClass.hpp trunk/stdair/stdair/basic/BasConst_Inventory.hpp trunk/stdair/stdair/basic/BasConst_Period_BOM.hpp trunk/stdair/stdair/basic/BasConst_WorldSchedule.hpp trunk/stdair/stdair/basic/BasConst_Yield.hpp trunk/stdair/stdair/bom/DoWStruct.cpp trunk/stdair/stdair/bom/DoWStruct.hpp trunk/stdair/stdair/bom/StructAbstract.hpp Property Changed: ---------------- trunk/stdair/stdair/basic/ Property changes on: trunk/stdair/stdair/basic ___________________________________________________________________ Modified: svn:ignore - Makefile Makefile.in + Makefile Makefile.in .deps .libs Added: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst.cpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,482 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <string> +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/basic/BasConst_WorldSchedule.hpp> +#include <stdair/basic/BasConst_Inventory.hpp> +#include <stdair/basic/BasConst_BookingClass.hpp> +#include <stdair/basic/BasConst_Yield.hpp> +#include <stdair/basic/BasConst_Period_BOM.hpp> + +namespace stdair { + + // ///////// General ///////// + /** Default very small value. */ + const double DEFAULT_EPSILON_VALUE = 0.0001; + + /** Default flight speed (number of kilometers per hour). */ + const unsigned int DEFAULT_FLIGHT_SPEED = 900; + + /** Default number of generated flight dates . */ + const NbOfFlightDates_T DEFAULT_NB_OF_FLIGHTDATES = 0.0; + + + // // ///////// GSL ///////// + // /** Default (GSL) random generator type. */ + // const gsl_rng_type* DEFAULT_LATUS_RANDOM_GENERATOR_TYPE = gsl_rng_default; + + // /** Default seed value for Exponential distribution. */ + // const ExponentialSeed_T DEFAULT_EXPONENTIAL_SEED = 0; + + // /** Default seed value for Exponential distribution. */ + // const UniformSeed_T DEFAULT_UNIFORM_SEED = 0; + + // // ///////// Labels in General Configuration Files ///////// + // /** Default file path separator*/ + // const std::string DEFAULT_CONFIG_FILEPATH_SEPARATOR = "/"; + + // /** Default label for RDS. */ + // const std::string DEFAULT_CONFIG_RDS_LABEL = "rds"; + // /** Default label for RDS file path. */ + // const std::string DEFAULT_CONFIG_RDS_FILEPATH_LABEL = "rds_path"; + // /** Default label for RDS Id (= folder holding RDS). */ + // const std::string DEFAULT_CONFIG_RDS_ID_LABEL = "rds_id"; + // /** Default label for RDS manifest. */ + // const std::string DEFAULT_CONFIG_RDS_MANIFEST_LABEL = "rds_manifest"; + // /** Default label for RDS airline configuration file name. */ + // const std::string DEFAULT_CONFIG_RDS_AIRLINE_CONFIGURATION_LABEL = + // "airlineconfiguration"; + + // /** Default label for output files. */ + // const std::string DEFAULT_CONFIG_OUTPUT_FILE_LABEL = "output_files"; + // /** Default label for inventory output file name. */ + // const std::string DEFAULT_CONFIG_INVENTORY_OUTPUT_FILE_LABEL = + // "inventory_output"; + // /** Default label for simulation output file name. */ + // const std::string DEFAULT_CONFIG_SIMULATION_OUTPUT_FILE_LABEL = + // "simulation_output"; + + // // ///////// Lables in RDS XML file ///////// + // const std::string DEFAULT_CONFIG_RDS_DEMAND_ARRIVAL_FILENAME_LABEL = + // "demandpattern"; + // const std::string DEFAULT_CONFIG_RDS_CANCEL_FILENAME_LABEL = + // "cancelratecurve"; + // const std::string DEFAULT_CONFIG_RDS_CHARACTERISTIC_FILENAME_LABEL = + // "characteristics"; + // const std::string DEFAULT_CONFIG_RDS_DEMAND_FILENAME_LABEL = "demands"; + // const std::string DEFAULT_CONFIG_RDS_SCHEDULE_FILENAME_LABEL = "schedule"; + // const std::string DEFAULT_CONFIG_RDS_FARE_FILENAME_LABEL = "fares"; + // const std::string DEFAULT_CONFIG_RDS_YIELD_FILENAME_LABEL = "yields"; + // const std::string DEFAULT_CONFIG_RDS_AU_RULES_FILENAME_LABEL = "aurules"; + // const std::string DEFAULT_CONFIG_RDS_LFDTD_RULES_FILENAME_LABEL = "lfdtdrules"; + // const std::string DEFAULT_CONFIG_RDS_DCP_FILENAME_LABEL = + // "datacollectionpoints"; + + // // ///////// BOOST Date-Time ///////// + // // Time duration representing a full day + // // (i.e., 24h or 1,440 minutes or 86,400 seconds) + + // /** Time duration representing a full day (in boost::time_duration unit).*/ + // const Duration_T BOOST_TIME_DURATION_FOR_A_DAY = + // boost::posix_time::hours(24); + + // /** Time duration representing a full day (in seconds).*/ + // const int TIME_DURATION_FOR_A_DAY_IN_SECONDS = + // static_cast<const int> (BOOST_TIME_DURATION_FOR_A_DAY.total_seconds()); + + // /** Time duration representing a full hour (in seconds).*/ + // const int TIME_DURATION_FOR_AN_HOUR_IN_SECONDS = 3600; + + // /** Time duration representing a full minute (in seconds).*/ + // const int TIME_DURATION_FOR_A_MINUTE_IN_SECONDS = 60; + + // /** Null time duration (in boost::time_duration unit).*/ + // const Duration_T NULL_BOOST_TIME_DURATION = + // boost::posix_time::hours(0)+ boost::posix_time::minutes (0) + // + boost::posix_time::seconds (0); + + // /** Date duration representing a full day (in boost::date_duration unit).*/ + // const DateOffSet_T BOOST_DATE_DURATION_FOR_A_DAY (1); + + // /** Date duration representing the window of time used for statistical + // analysis. */ + // const DateOffSet_T DEFAULT_ANALYSIS_TIME_WINDOW (180); + + // /** Date duration representing the period of reservation for a + // typical flight. */ + // const DateOffSet_T DEFAULT_RESERVATION_PERIOD_LENGTH (365); + + + // //////// (Flight-)Period-related BOM /////// + /** Default number of duration days. */ + const DayDuration_T DEFAULT_DAY_DURATION (0); + + /** Default date period (0-length, i.e., it lasts one day).*/ + const DatePeriod_T BOOST_DEFAULT_DATE_PERIOD (Date_T (2007, 1, 1), + Date_T (2007, 1, 1)); + + const std::string DOW_STR[] = {"Mon", "Tue", "Wed", "Thu", "Fri", + "Sat", "Sun"}; + + /** Default DOW String (e.g., "1111100"). */ + const DOW_String_T DEFAULT_DOW_STRING ("1111100"); + + /** Default Date OffSet (e.g., 0). */ + const DateOffSet_T DEFAULT_DATE_OFFSET (0); + + // // //////// WorldSchedule /////// + // /** Default update date for the WorldSchedule. */ + // const Date_T DEFAULT_WORLD_SCHEDULE_UPDATE_DATE (2007, + // boost::gregorian::Jan, + // 1); + + + // // //////// WholeDemand /////// + // /** Default update date for the WholeDemand. */ + // const Date_T DEFAULT_WHOLE_DEMAND_UPDATE_DATE (2007, + // boost::gregorian::Jan, + // 1); + + // /** Default update date&time. */ + // const DateTime_T DEFAULT_DEMAND_DATETIME (DEFAULT_WHOLE_DEMAND_UPDATE_DATE, + // NULL_BOOST_TIME_DURATION); + + // // //////// Fare Rules /////// + // /** Default saturdayStay value (false). */ + // const SaturdayStay_T DEFAULT_SATURDAY_STAY = false; + + // /** Default change fees value (false). */ + // const ChangeFees_T DEFAULT_CHANGE_FEES = false; + + // /** Default non refundable value (false). */ + // const NonRefundable_T DEFAULT_NON_REFUNDABLE = false; + + // /** Default airlineCode value ('XX'). */ + // const AirlineCode_T DEFAULT_AIRLINE_CODE = "XX"; + + // /** Default airlineCode value (''). */ + // const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE = ""; + + // /** Default airportCode value ('XXX'). */ + // const AirportCode_T DEFAULT_AIRPORT_CODE = "XXX"; + + // /** Default family code value ('X'). */ + // const ClassCode_T DEFAULT_FAMILY_CODE = "0"; + + // /** Default classCode value ('X'). */ + // const ClassCode_T DEFAULT_CLASS_CODE = "X"; + + // /** Default number of airlines. */ + // const NbOfAirlines_T DEFAULT_NBOFAIRLINES = 0; + + // /** Default classCode value (''). */ + // const ClassCode_T DEFAULT_NULL_CLASS_CODE = ""; + + // /** Default flightPathCode value (''). */ + // const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE = ""; + + // // //////// DemandFeatures /////// + // /** Default SaturdayStay average ratio of demand (value between [0, 100]). */ + // const SaturdayStayRatio_T DEFAULT_SATURDAY_STAY_RATIO = 50; + + // /** Default Change fees average ratio (value between [0, 100]). */ + // const ChangeFeesRatio_T DEFAULT_CHANGE_FEES_RATIO = 50; + + // /** Default Non refundable average ratio (value between [0, 100]). */ + // const NonRefundableRatio_T DEFAULT_NON_REFUNDABLE_RATIO = 50; + + // /** Default passenger type (Leisure or Business). */ + // const PassengerType_T DEFAULT_PASSENGER_TYPE = "L"; + + // /** Default distribution pattern identifier. */ + // const DistributionPatternId_T DEFAULT_DISTRIBUTION_PATTERN_ID = ""; + + // /** Default cancellation rate curve identifier. */ + // const CancellationRateCurveId_T DEFAULT_CANCELLATION_RATE_CURVE_ID = ""; + + // /** Default airline preference identifier. */ + // const AirlinePreferenceId_T DEFAULT_AIRLINE_PREFERENCE_ID = ""; + + // /** Default percentage pair of cancellation and no-show. */ + // const CancellationNoShowRatePair_T DEFAULT_PERCENTAGE_PAIR (0.0, 0.0); + + // /** Default characteristics pattern identifier. */ + // const CharacteristicsPatternId_T DEFAULT_CHARACTERISTICS_PATTERN_ID = ""; + + // //////// (Segment-)Class-related BOM /////// + /** Default distance value (kilometers). */ + const Distance_T DEFAULT_DISTANCE_VALUE = 0; + + /** Default number of bookings (with counted cancellation) + for BookingClass. */ + const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS = 0; + + /** Default number of booking (without cancellation) + demands for BookingClass. */ + const NbOfBookings_T DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS = 0; + + /** Default unconstrained demand for BookingClass. */ + const NbOfBookings_T DEFAULT_CLASS_UNCONSTRAINED_DEMAND = 0; + + /** Default remaining future demand mean for BookingClass. */ + const NbOfBookings_T DEFAULT_CLASS_REMAINING_DEMAND_MEAN = 0; + + /** Default remaining futre demand standard deviation for BookingClass. */ + const NbOfBookings_T DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION = 0; + + /** Default number of cancellations for BookingClass. */ + const NbOfCancellations_T DEFAULT_CLASS_NB_OF_CANCELLATIONS = 0; + + /** Default number of no-shows for BookingClass. */ + const NbOfNoShows_T DEFAULT_CLASS_NB_OF_NOSHOWS = 0; + + /** Default cabin capacity for Leg cabins. */ + const CabinCapacity_T DEFAULT_CABIN_CAPACITY = 0.0; + + /** Default commited space value for Leg cabins. */ + const CommitedSpace_T DEFAULT_COMMITED_SPACE = 0.0; + + /** Default commited space value for Leg cabins. */ + const BlockSpace_T DEFAULT_BLOCK_SPACE = 0.0; + + /** Default availability for BookingClass. */ + const Availability_T DEFAULT_CLASS_AVAILABILITY = 0.0; + + /** Default boolean for censorship flag given the status of + availability for BookingClass. */ + const CensorshipFlag_T DEFAULT_CLASS_CENSORSHIPFLAG = false; + + /** Default list of censorship flag given the status of + availability for BookingClass. */ + const CensorshipFlagList_T DEFAULT_CLASS_CENSORSHIPFLAG_LIST = std::vector<CensorshipFlag_T>(); + + /** Default booking limit value for BookingClass. */ + const BookingLimit_T DEFAULT_CLASS_BOOKING_LIMIT = 9999.0; + + /** Default authorization level for BookingClass. */ + const AuthorizationLevel_T DEFAULT_CLASS_AUTHORIZATION_LEVEL = 9999.0; + + /** Default MAX value of authorization level for BookingClass. */ + const AuthorizationLevel_T DEFAULT_CLASS_MAX_AUTHORIZATION_LEVEL = 9999.0; + + /** Default MIN value of authorization level for BookingClass. */ + const AuthorizationLevel_T DEFAULT_CLASS_MIN_AUTHORIZATION_LEVEL = 0.0; + + /** Default over-booking rate for BookingClass. */ + const OverbookingRate_T DEFAULT_CLASS_OVERBOOKING_RATE = 0.0; + + /** Default booking rate for OnD bookings over overall class bookings. */ + const BookingRatio_T DEFAULT_OND_BOOKING_RATE = 0.0; + + /** Default closed class code. */ + const ClassCode_T DEFAULT_CLOSED_CLASS_CODE = "CC"; + + /** Default Fare value for BookingClass. */ + const Fare_T DEFAULT_CLASS_FARE_VALUE = 0.0; + + /** Default yield value for a virtual class. */ + const Yield_T DEFAULT_CLASS_YIELD_VALUE = 0.0; + + /** Default Revenue value. */ + const Revenue_T DEFAULT_REVENUE_VALUE = 0.0; + + /** Default load factor value (100%). */ + const Percentage_T DEFAULT_LOAD_FACTOR_VALUE = 100.0; + + // //////// (Leg-)YieldRange-related BOM /////// + /** Default yield value. */ + const Yield_T DEFAULT_YIELD_VALUE = 0.0; + + /** Default yield max value. */ + const Yield_T DEFAULT_YIELD_MAX_VALUE = std::numeric_limits<double>::max(); + + /** Default number of bookings for YieldRangeStruct_T. */ + const NbOfBookings_T DEFAULT_YIELD_NB_OF_BOOKINGS = 0.0; + + /** Default booking number. */ + const Identity_T DEFAULT_BOOKING_NUMBER = 0; + + /** Default cancellation number for YieldRangeStruct_T. */ + const NbOfCancellations_T DEFAULT_YIELD_NB_OF_CANCELLATIONS = 0.0; + + /** Default no-shows number for YieldRangeStruct_T. */ + const NbOfNoShows_T DEFAULT_YIELD_NB_OF_NOSHOWS = 0.0; + + /** Default availability for YieldRangeStruct_T. */ + const Availability_T DEFAULT_YIELD_AVAILABILITY = 0.0; + + /** Default boolean for booking limit availability for + YieldRangeStruct_T. */ + const CensorshipFlag_T DEFAULT_YIELD_CENSORSHIPFLAG = false; + + /** Default booking limit value for YieldRangeStruct_T. */ + const BookingLimit_T DEFAULT_YIELD_BOOKING_LIMIT = 0.0; + + /** Default over-booking rate for YieldRangeStruct_T. */ + const OverbookingRate_T DEFAULT_YIELD_OVERBOOKING_RATE = 0.0; + + // //////// OnD-related BOM /////// + /** Default value of Fare. */ + const Fare_T DEFAULT_OND_FARE_VALUE = 0.0; + + // /** Default number of bookings. */ + // const NbOfBookings_T DEFAULT_OND_NB_OF_BOOKINGS = 0.0; + + // /** Default remaining future demand mean for OnD. */ + // const NbOfBookings_T DEFAULT_OND_REMAINING_DEMAND_MEAN = 0.0; + + // /** Default remaining futre demand standard deviation for OnD. */ + // const NbOfBookings_T DEFAULT_OND_REMAINING_DEMAND_STANDARD_DEVIATION = 0.0; + + // // //////// Travel Solutions /////// + // /** Default Minimum connection time. */ + // const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); + + // /** Default Matching Indicator value. */ + // const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); + + // /** Default price value (0.0). */ + // const PriceValue_T DEFAULT_PRICE_VALUE (0.0); + + // /** Default currency (euro). */ + // const PriceCurrency_T DEFAULT_CURRENCY ("EUR"); + + // /** Default availability status for a travel solution. */ + // const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS = false; + + // // //////// Cancellation /////// + // /** Default Fare value */ + // const Fare_T DEFAULT_FARE_VALUE = 0.0; + + // /** Default number of bookings. */ + // const NbOfBookings_T DEFAULT_NB_OF_BOOKINGS = 0; + + // /** Default date&time. */ + // const DateTime_T DEFAULT_CANCELLATION_DATETIME + // (DEFAULT_WORLD_SCHEDULE_UPDATE_DATE, + // NULL_BOOST_TIME_DURATION); + + // // //////// CityPair //////// + // /** Default booking date for BookingDay. */ + // const Date_T DEFAULT_BOOKING_DATE (2007, boost::gregorian::Jan, 1); + + // /** Default departure date for CityPairDate. */ + // const Date_T DEFAULT_DEPARTURE_DATE (2008, boost::gregorian::Jan, 1); + + // /** Date duration representing the time during which a flight-date is open + // to the reservation (in boost::date_duration unit).*/ + // const DateOffSet_T DEFAULT_FLIGHT_DATE_RESERVATION_DURATION (365); + + // /** Default number of seats required whenever a demand is processed into + // the simulator. */ + // const unsigned short DEFAULT_NUMBER_OF_REQUIRED_SEATS = 1; + + // // //////// Flight Period Actions //////// + // // //////// RMS mode /////// + // /** Default forecaster mode. */ + // const ForecasterMode_T DEFAULT_FORECAST_MODE = "NoForecast"; + + // /** First forecaster mode. */ + // const ForecasterMode_T FIRST_FORECAST_MODE = "Forecaster1"; + + // /** Basic forecaster mode. */ + // const ForecasterMode_T BASIC_FORECAST_MODE = "BasicForecaster"; + + // /** Neural forecaster mode. */ + // const ForecasterMode_T NEURAL_FORECAST_MODE = "NeuralForecaster"; + + // /** Q forecaster mode. */ + // const ForecasterMode_T Q_FORECAST_MODE = "QForecaster"; + + // /** Default optimizer mode. */ + // const OptimizerMode_T DEFAULT_OPTIMIZER_MODE = "FCFS"; + + // /** Optimizer mode for rules like LF & DTD threshold. */ + // const OptimizerMode_T LF_DTD_RULES_OPTIMIZER_MODE = "LFDTDRules"; + + // /** Optimizer mode for EMSR heuristic. */ + // const OptimizerMode_T EMSR_OPTIMIZER_MODE = "EMSR"; + + // /** Optimizer mode for EMSR-a heuristic. */ + // const OptimizerMode_T EMSRA_OPTIMIZER_MODE = "EMSRa"; + + // // /** Optimizer mode for EMSR-a with sell up probability. */ + // // const OptimizerMode_T EMSRA_SELLUP_OPTIMIZER_MODE = "EMSRaSellup"; + + // /** Optimizer mode for EMSR-b heuristic. */ + // const OptimizerMode_T EMSRB_OPTIMIZER_MODE = "EMSRb"; + + // /** Optimizer mode for Optimal Optimization by Monte-Carlo. */ + // const OptimizerMode_T MC_OPTIMIZER_MODE = "MC"; + + // /** Optimizer mode for Leg-Based Iterative DAVN Optimization with + // Monte-Carlo. */ + // const OptimizerMode_T LB_ITERATIVE_DAVN_OPTIMIZER_WITH_MC_MODE = "LB_DAVN_MC"; + + // /** Optimizer mode for Leg-Based Iterative DAVN Optimization with + // EMSR. */ + // const OptimizerMode_T LB_ITERATIVE_DAVN_OPTIMIZER_WITH_EMSR_MODE = "LB_DAVN_EMSR"; + + // // /** No sell-up for optimizer by default*/ + // // const SellupFlagForOptimizer_T DEFAULT_SELLUP_FLAG_FOR_OPTIMIZER = false; + + // /** Defaut control mode. */ + // const ControlMode_T DEFAULT_CONTROL_MODE = "STD"; + + // /** Theft control mode. */ + // const ControlMode_T THEFT_CONTROL_MODE = "THEFT"; + + // /** Default number of draws for Monte-Carlo Integration method. */ + // const int DEFAULT_NUMBER_OF_RANDOM_DRAWS = 1000; + + // /** Default epsilon for convergence test. */ + // const double DEFAULT_CONVERGENCE_EPSILON = 0.1; + + // /** Default max number of iterations for Iterative DAVN. */ + // const int DEFAULT_NB_OF_ITERATIONS_DAVN = 10; + + // // //////// Characteristics /////// + // /** Default k-factor (0.3).*/ + // const Multiplier_T DEFAULT_KFACTOR = 0.3; + + // /** Default basefare [used for computing WTP] (0).*/ + // const Fare_T DEFAULT_BASEFARE = 0; + + // /** Default elasticity multiplier [used for computing WTP] (1.5). */ + // const Multiplier_T DEFAULT_EMULTIPLIER = 1.5; + + // // //////// DICO mode /////// + // /** Default DICO studied airline. */ + // const AirlineCode_T DEFAULT_DICO_AIRLINE = "AD"; + // //const AirlineCode_T DEFAULT_DICO_STUDIED_AIRLINE = "AA"; + + // /** Default second studied airline for DICO. */ + // const AirlineCode_T DEFAULT_SECOND_DICO_AIRLINE = "AL"; + // //const AirlineCode_T DEFAULT_SECOND_DICO_STUDIED_AIRLINE = "BA"; + + // /** Default DICO studied date. */ + // const Date_T DEFAULT_DICO_STUDIED_DATE (2009, boost::gregorian::Jun, 29); + // //const Date_T DEFAULT_DICO_STUDIED_DATE (2009, boost::gregorian::Jun, 27); + + // /** Default DICO optimiser (dico mode). */ + // const DicoOptimizerMode_T DEFAULT_DICO_OPTIMIZER = "dico"; + + // /** Default DICO optimiser (robust dico mode). */ + // const DicoOptimizerMode_T DEFAULT_ROBUST_DICO_OPTIMIZER = + // "robustdico"; + + // /** Default DICO optimiser (fast robust dico mode). */ + // const DicoOptimizerMode_T DEFAULT_FAST_ROBUST_DICO_OPTIMIZER = + // "fastrobustdico"; + + // //////// Inventory-related BOM /////// + /** Default Bid-Price. */ + const BidPrice_T DEFAULT_BID_PRICE = 0.0; + + /** Default Bid-Price Vector. */ + const BidPriceVector_T DEFAULT_BID_PRICE_VECTOR = std::vector<BidPrice_T>(); + +} Added: trunk/stdair/stdair/basic/BasConst_BookingClass.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_BookingClass.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_BookingClass.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,97 @@ +#ifndef __STDAIR_BAS_BASCONST_BOOKINGCLASS_HPP +#define __STDAIR_BAS_BASCONST_BOOKINGCLASS_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + // //////// (Segment-)Class-related BOM /////// + /** Default distance value (kilometers). */ + extern const Distance_T DEFAULT_DISTANCE_VALUE; + + /** Default closed class code. */ + extern const ClassCode_T DEFAULT_CLOSED_CLASS_CODE; + + /** Default number of bookings (with counted cancellation) + for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS; + + /** Default number of bookings (without cancellation) + for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS; + + /** Default unconstrained demand for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_UNCONSTRAINED_DEMAND; + + /** Default remaining future demand mean for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_REMAINING_DEMAND_MEAN; + + /** Default remaining futre demand standard deviation for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION; + + /** Default number of cancellations for BookingClass. */ + extern const NbOfCancellations_T DEFAULT_CLASS_NB_OF_CANCELLATIONS; + + /** Default number of no-shows for BookingClass. */ + extern const NbOfNoShows_T DEFAULT_CLASS_NB_OF_NOSHOWS; + + /** Default cabin capacity for Leg cabins. */ + extern const CabinCapacity_T DEFAULT_CABIN_CAPACITY; + + /** Default commited space value for Leg cabins. */ + extern const CommitedSpace_T DEFAULT_COMMITED_SPACE; + + /** Default commited space value for Leg cabins. */ + extern const BlockSpace_T DEFAULT_BLOCK_SPACE; + + /** Default availability for BookingClass. */ + extern const Availability_T DEFAULT_CLASS_AVAILABILITY; + + /** Default boolean for censorship flag given the status of + availability for BookingClass. */ + extern const CensorshipFlag_T DEFAULT_CLASS_CENSORSHIPFLAG; + + /** Default list of censorship flag given the status of + availability for BookingClass. */ + extern const CensorshipFlagList_T DEFAULT_CLASS_CENSORSHIPFLAG_LIST; + + /** Default booking limit value for BookingClass. */ + extern const BookingLimit_T DEFAULT_CLASS_BOOKING_LIMIT; + + /** Default authorization level for BookingClass. */ + extern const AuthorizationLevel_T DEFAULT_CLASS_AUTHORIZATION_LEVEL; + + /** Default MAX value of authorization level for BookingClass. */ + extern const AuthorizationLevel_T DEFAULT_CLASS_MAX_AUTHORIZATION_LEVEL; + + /** Default MIN value of authorization level for BookingClass. */ + extern const AuthorizationLevel_T DEFAULT_CLASS_MIN_AUTHORIZATION_LEVEL; + + /** Default over-booking rate for BookingClass. */ + extern const OverbookingRate_T DEFAULT_CLASS_OVERBOOKING_RATE; + + /** Default over-booking rate for BookingClass. */ + extern const Fare_T DEFAULT_CLASS_FARE_VALUE; + + /** Default revenue value for BookingClass. */ + extern const Revenue_T DEFAULT_REVENUE_VALUE; + + /** Default currency (euro). */ + extern const PriceCurrency_T DEFAULT_CURRENCY; + + /** Default load factor value (100%). */ + extern const Percentage_T DEFAULT_LOAD_FACTOR_VALUE; + + /** Default number of duration days (0). */ + extern const DayDuration_T DEFAULT_DAY_DURATION; + + /** Default epsilon value between customer requirements + and a fare rule. */ + extern const double DEFAULT_EPSILON_VALUE; + +} +#endif // __STDAIR_BAS_BASCONST_BOOKINGCLASS_HPP Added: trunk/stdair/stdair/basic/BasConst_Inventory.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_Inventory.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_Inventory.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,20 @@ +#ifndef __STDAIR_BAS_BASCONST_INVENTORY_HPP +#define __STDAIR_BAS_BASCONST_INVENTORY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + // //////// Inventory-related BOM /////// + /** Default Bid-Price. */ + extern const BidPrice_T DEFAULT_BID_PRICE; + + /** Default Bid-Price Vector. */ + extern const BidPriceVector_T DEFAULT_BID_PRICE_VECTOR; + +} +#endif // __STDAIR_BAS_BASCONST_INVENTORY_HPP Added: trunk/stdair/stdair/basic/BasConst_Period_BOM.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_Period_BOM.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_Period_BOM.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,29 @@ +#ifndef __STDAIR_BAS_BASCONST_PERIOD_BOM_HPP +#define __STDAIR_BAS_BASCONST_PERIOD_BOM_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + // //////// (Flight-)Period-related BOM /////// + /** Default date period (0-length, i.e., it lasts one day).*/ + extern const DatePeriod_T BOOST_DEFAULT_DATE_PERIOD; + + /** Representation of Dow-Of-the-Week */ + extern const std::string DOW_STR[]; + + /** Default DOW String (e.g., "1111100"). */ + extern const DOW_String_T DEFAULT_DOW_STRING; + + /** Default Date OffSet (e.g., 0). */ + extern const DateOffSet_T DEFAULT_DATE_OFFSET; + + /** Default Duration in days (e.g., 0). */ + extern const DayDuration_T DEFAULT_DAY_DURATION; + +} +#endif // __STDAIR_BAS_BASCONST_PERIOD_BOM_HPP Added: trunk/stdair/stdair/basic/BasConst_WorldSchedule.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_WorldSchedule.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_WorldSchedule.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,40 @@ +#ifndef __STDAIR_BAS_BASCONST_WORLDSCHEDULE_HPP +#define __STDAIR_BAS_BASCONST_WORLDSCHEDULE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// LATUS Common +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + /** Default epsilon value. */ + extern const double DEFAULT_EPSILON_VALUE; + + /** Default flight speed (number of kilometers per hour). */ + extern const unsigned int DEFAULT_FLIGHT_SPEED; + + /** Default cabin capacity for Leg cabins. */ + extern const CabinCapacity_T DEFAULT_CABIN_CAPACITY; + + /** Default number of generated flight dates . */ + extern const NbOfFlightDates_T DEFAULT_NB_OF_FLIGHTDATES; + + /** Default number of bookings for BookingClass. */ + extern const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS; + + /** Default distance value (kilometers). */ + extern const Distance_T DEFAULT_DISTANCE_VALUE; + + /** Default value of Fare. */ + extern const Fare_T DEFAULT_CLASS_FARE_VALUE; + + /** Default revenue value. */ + extern const Revenue_T DEFAULT_REVENUE_VALUE; + + /** Default booking rate for OnD bookings over overall class bookings. */ + extern const BookingRatio_T DEFAULT_OND_BOOKING_RATE; + +} +#endif // __STDAIR_BAS_BASCONST_WORLDSCHEDULE_HPP Added: trunk/stdair/stdair/basic/BasConst_Yield.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_Yield.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_Yield.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,20 @@ +#ifndef __STDAIR_BAS_BASCONST_YIELD_HPP +#define __STDAIR_BAS_BASCONST_YIELD_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> + +namespace stdair { + + // //////// (Leg-)Yield-related BOM /////// + /** Default yield value. */ + extern const Yield_T DEFAULT_YIELD_VALUE; + + /** Default yield max value. */ + extern const Yield_T DEFAULT_YIELD_MAX_VALUE; + +} +#endif // __STDAIR_BAS_BASCONST_YIELD_HPP Modified: trunk/stdair/stdair/basic/sources.mk =================================================================== --- trunk/stdair/stdair/basic/sources.mk 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/basic/sources.mk 2009-11-04 10:39:37 UTC (rev 59) @@ -1,3 +1,9 @@ bas_h_sources = \ - $(top_srcdir)/stdair/basic/BasTypes.hpp -bas_cc_sources = + $(top_srcdir)/stdair/basic/BasTypes.hpp \ + $(top_srcdir)/stdair/basic/BasConst_WorldSchedule.hpp \ + $(top_srcdir)/stdair/basic/BasConst_Inventory.hpp \ + $(top_srcdir)/stdair/basic/BasConst_BookingClass.hpp \ + $(top_srcdir)/stdair/basic/BasConst_Yield.hpp \ + $(top_srcdir)/stdair/basic/BasConst_Period_BOM.hpp +bas_cc_sources = \ + $(top_srcdir)/stdair/basic/BasConst.cpp Modified: trunk/stdair/stdair/bom/AirlineFeatureMap.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureMap.cpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/AirlineFeatureMap.cpp 2009-11-04 10:39:37 UTC (rev 59) @@ -47,8 +47,8 @@ } // ////////////////////////////////////////////////////////////////////// - AirlineFeatureMap_T::iterator AirlineFeatureMap_T:: - find (const MapKey_T& iKey) const { + AirlineFeatureMap_T:: + iterator AirlineFeatureMap_T::find (const MapKey_T& iKey) const { return _airlineFeatureHolder.find (iKey); } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -13,6 +13,7 @@ namespace stdair { // Forward declarations. class FacBomContent; + class AirlineFeatureSet; struct BomRootKey_T; struct InventoryList_T; struct InventoryMap_T; @@ -103,7 +104,20 @@ /** Get a InventoryMap_T for iteration methods. */ InventoryMap_T getInventoryMap () const; + + /** Get the reference of the AirlineFeatureSet object. */ + const AirlineFeatureSet& getAirlineFeatureSet() const { + assert (_airlineFeatureSet != NULL); + return *_airlineFeatureSet; + } + public: + // //////////// Setters ////////////// + /** Set the reference to the AirlineFeatureSet object. */ + void setAirlineFeatureSet (const AirlineFeatureSet* ioAirlineFeatureSet_ptr){ + _airlineFeatureSet = ioAirlineFeatureSet_ptr; + } + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { @@ -124,6 +138,9 @@ // Attributes /** Reference structure. */ BomStructure_T& _bomRootStructure; + + /** Set of all AirlineFeatures.*/ + const AirlineFeatureSet* _airlineFeatureSet; }; } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -38,7 +38,89 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef BookingClass ContentChild_T; + + public: + // /////////// Getters ///////////// + /** Get the FareFamily (parent class). */ + // FareFamily* getFareFamily() const { +// return _fareFamily; +// } + + // ////// Getters from the parent class /////// +// /** Get the airline code (from the parent class). */ +// const AirlineCode_T& getAirlineCode() const; + +// /** Get the flight number (from the parent class). */ +// const FlightNumber_T& getFlightNumber() const; + +// /** Get the flight-date (from the parent class). */ +// const Date_T& getFlightDateDate() const; + +// /** Get the board point (from the parent class). */ +// const AirportCode_T& getBoardPoint () const; + +// /** Get the off point (from the parent class). */ +// const AirportCode_T& getOffPoint () const; + +// /** Get the board date (from the parent class). */ +// const Date_T& getBoardDate () const; + +// /** Get the cabin code (from the parent class). */ +// const CabinCode_T& getCabinCode () const; + +// /** Get the board time (from the parent class). */ +// const Duration_T& getBoardTime () const; + +// /** Get the off date (from the parent class). */ +// const Date_T& getOffDate () const; + +// /** Get the off time (from the parent class). */ +// const Duration_T& getOffTime () const; + +// /** Get the elapsed time (from the parent class). */ +// const Duration_T& getElapsedTime() const; + +// /** Get the distance (from the parent class). */ +// const Distance_T& getDistance() const; + +// /** Get the date off set (from the parent class). */ +// const DateOffSet_T getDateOffSet () const; + +// /** Get the time off set between board and off points (from the +// parent class). */ +// const Duration_T getTimeOffSet() const; + +// /** Retrieve, if existing, theOnD corresponding to the +// given OnDKey. +// <br>If not existing, return the NULL pointer. */ +// OnD* getOnD (const OnDKey_T& iOnDKey) const; + +// /** Get the size of the OnD list. */ +// const unsigned int getOnDListSize () const { +// return _onDList.size(); +// } + +// /** Get the list of OnDs related to this class. */ +// const OnDList_T& getOnDList() const { +// return _onDList; +// } + + public: + // ///////// Setters ////////// + /** Set the Fare family (parent class). */ +// void setFareFamily (FareFamily& ioFareFamily) { +// _fareFamily = &ioFareFamily; +// } + /** Reset the number of bookings to its intial state. */ + //void reset (); + +// /** Reset the booking fare. */ +// void resetFare(); + +// /** Reset the booking yield. */ +// void resetYield(); + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @@ -60,6 +142,46 @@ at the same level). */ const std::string describeShortKey() const; + /** Give a description of the structure (for display purposes). */ + //const std::string describe() const; + + /** Get a string describing the solution (Fare, MatchIndicator...). */ + //const std::string describeSolution() const; + + public: + // ///////// Business Methods ////////// + /** Update the number of bookings. */ +// bool updateInventoryForReservation (const NbOfBookings_T&); + +// /** Update the number of cancellations. */ +// bool updateInventoryForCancellation (const NbOfCancellations_T&); + +// /** Update the number of no-shows. */ +// bool updateInventoryForNoShow (const NbOfNoShows_T&); + + +// /** Update the revenue of the booking. */ +// bool updateRevenue (const NbOfBookings_T&, const Fare_T&, +// const AnalysisStatus_T&); + +// /** Add the current censorship flag into the flag list. */ +// void addCurrentCensorshipFlagToTheFlagList(); + +// /** Build the Class-Segment code (for example:B-NCE-BKK->BNCEBKK). */ +// const std::string buildClassSegmentCode() const; + +// /** Insert a new OnD reference. */ +// void addOnD (OnD&); + +// /** Calculate the ratio of booking for this booking only +// (without OnD bookings). */ +// const BookingRatio_T calculateNetProductRatio(); + + protected: + /** Update some statistics of the SegmentCabin parent object.*/ +// void updateParentStatistics (const Revenue_T&, +// const NbOfBookings_T&) const; + private: /** Retrieve the BOM structure object. */ BomStructure_T& getBomStructure () { @@ -81,6 +203,12 @@ // Attributes /** Reference structure. */ BomStructure_T& _bookingClassStructure; + + /** Parent class: FareFamily. */ +// FareFamily* _fareFamily; + +// /** List of OnD references related to this bookingClass. */ +// OnDList_T _onDList; }; } Modified: trunk/stdair/stdair/bom/BookingClassContent.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassContent.cpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BookingClassContent.cpp 2009-11-04 10:39:37 UTC (rev 59) @@ -4,17 +4,54 @@ // STL #include <cassert> // STDAIR +#include <stdair/basic/BasConst_BookingClass.hpp> +#include <stdair/basic/BasConst_Yield.hpp> #include <stdair/bom/BookingClassContent.hpp> namespace stdair { // //////////////////////////////////////////////////////////////////// - BookingClassContent::BookingClassContent (const BomKey_T& iKey) : _key (iKey) { + BookingClassContent::BookingClassContent (const BomKey_T& iKey) + : _key (iKey), + _nbOfBookings (DEFAULT_CLASS_NB_OF_BOOKINGS), + _totalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), + _lastDCPTotalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), + _unconstrainedDemand (DEFAULT_CLASS_UNCONSTRAINED_DEMAND), + _nbOfCancellations (DEFAULT_CLASS_NB_OF_CANCELLATIONS), + _nbOfNoShows (DEFAULT_CLASS_NB_OF_NOSHOWS), + _availability (DEFAULT_CLASS_AVAILABILITY), + _classRevenue (DEFAULT_REVENUE_VALUE), + _currentCensorshipFlag (DEFAULT_CLASS_CENSORSHIPFLAG), + _censorshipFlagList (DEFAULT_CLASS_CENSORSHIPFLAG_LIST), + _bookingLimit (DEFAULT_CLASS_BOOKING_LIMIT), + _authorizationLevel(DEFAULT_CLASS_AUTHORIZATION_LEVEL), + _MAX (DEFAULT_CLASS_MAX_AUTHORIZATION_LEVEL), + _MIN (DEFAULT_CLASS_MIN_AUTHORIZATION_LEVEL), + _overbookingRate (1 + DEFAULT_CLASS_OVERBOOKING_RATE), + _fare (DEFAULT_CLASS_FARE_VALUE), + _adjustedYield (DEFAULT_YIELD_VALUE), + _yield (DEFAULT_YIELD_VALUE), + _remainingDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), + _remainingProductDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), + _remainingDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION), + _remainingProductDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION) { } // //////////////////////////////////////////////////////////////////// BookingClassContent::~BookingClassContent () { } + + // ////////////////////////////////////////////////////////////////////// + void BookingClassContent::setRemainingDemandMean(NbOfBookings_T& iMean) { + _remainingDemandMean = iMean; + _remainingProductDemandMean = iMean; + } + // ////////////////////////////////////////////////////////////////////// + void BookingClassContent::setRemainingDemandSD(NbOfBookings_T& iSD) { + _remainingDemandSD = iSD; + _remainingProductDemandSD = iSD; + } + } Modified: trunk/stdair/stdair/bom/BookingClassContent.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassContent.hpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BookingClassContent.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -24,7 +24,198 @@ return _key; } + /** Get the booking code (part of the primary key). */ + const ClassCode_T& getClassCode() const { + return _key.getClassCode(); + } + + /** Get the number of bookings of the bookingClass. */ + const NbOfBookings_T& getNbOfBookings() const { + return _nbOfBookings; + } + + /** Get the number of bookings (without cancellation counted) + of the bookingClass. */ + const NbOfBookings_T& getTotalNbOfBookings() const { + return _totalNbOfBookings; + } + + /** Get the number of bookings at the last DCP(without + cancellation counted) of the bookingClass. */ + const NbOfBookings_T& getLastDCPTotalNbOfBookings() const { + return _lastDCPTotalNbOfBookings; + } + + /** Get the unconstrained demand (last DCP) of the bookingClass. */ + const NbOfBookings_T& getUnconstrainedDemand () const { + return _unconstrainedDemand; + } + + /** Get the number of cancellations of the bookingClass. */ + const NbOfCancellations_T& getNbOfCancellations() const { + return _nbOfCancellations; + } + + /** Get the number of no-shows of the bookingClass. */ + const NbOfNoShows_T& getNbOfNoShows() const { + return _nbOfNoShows; + } + + /** Get the overbooking rate dedicated to the booking. */ + const OverbookingRate_T& getOverbookingRate() const { + return _overbookingRate; + } + + /** Get the list of censorship flags. */ + const CensorshipFlagList_T& getCensorshipFlagList() const { + return _censorshipFlagList; + } + + /** Get the current censorship flag. */ + const CensorshipFlag_T& getCurrentCensorshipFlag() const { + return _currentCensorshipFlag; + } + + /** Get the protection value. */ + const BookingLimit_T& getBookingLimit() const { + return _bookingLimit; + } + + /** Get the authorisation level value. */ + const AuthorizationLevel_T& getAuthorizationLevel () const { + return _authorizationLevel; + } + + /** Get the MAX value of AU. */ + const AuthorizationLevel_T& getMAX () const { + return _MAX; + } + + /** Get the MIN value of AU. */ + const AuthorizationLevel_T& getMIN () const { + return _MIN; + } + + /** Get the availability number. */ + const Availability_T& getAvailability() const { + return _availability; + } + + /** Get the revenue amount. */ + const Revenue_T& getRevenue() const { + return _classRevenue; + } + + /** Get the fare current value. */ + const Fare_T& getFare() const { + return _fare; + } + + /** Get the adjusted yield current value. */ + const Yield_T& getAdjustedYield() const { + return _adjustedYield; + } + + /** Get the yield current value. */ + const Yield_T& getYield() const { + return _yield; + } + + /** Get the remaining demand mean. */ + const NbOfBookings_T& getRemainingDemandMean() const { + return _remainingDemandMean; + } + + /** Get the remaining demand mean for the net booking product. */ + const NbOfBookings_T& getRemainingProductDemandMean() const { + return _remainingProductDemandMean; + } + + /** Get the remaining demand standard deviation. */ + const NbOfBookings_T& getRemainingDemandSD() const { + return _remainingDemandSD; + } + + /** Get the remaining demand standard deviation + for the net booking product. */ + const NbOfBookings_T& getRemainingProductDemandSD() const { + return _remainingProductDemandSD; + } + public: + // /////////// Setters //////////// + /** Set the booking limit. */ + void setBookingLimit (BookingLimit_T& iBookingLimit) { + _bookingLimit = iBookingLimit; + } + + /** Set the authorization level. */ + void setAuthorizationLevel (AuthorizationLevel_T& iAuthorizationLevel) { + _authorizationLevel = iAuthorizationLevel; + } + + /** Set the MAX value of AU. */ + void setMAX (const AuthorizationLevel_T& iMAX) { + _MAX = iMAX; + } + + /** Set the MIN value of AU. */ + void setMIN (const AuthorizationLevel_T& iMIN) { + _MIN = iMIN; + } + + /** Set the Availability number. */ + void setAvailability (Availability_T& iAvailability) { + _availability = iAvailability; + } + + /** Set the censorship flag status. */ + void setCensorshipFlagStatus (bool iFlagStatus) { + _currentCensorshipFlag = iFlagStatus; + } + + /** Set the fare value. */ + void setFare(Fare_T& iFare) { + _fare = iFare; + } + + /** Set the adjusted fare value. */ + void setAdjustedYield(Yield_T& iYield) { + _adjustedYield = iYield; + } + + /** Set the yield value. */ + void setYield(Yield_T& iYield) { + _yield = iYield; + } + + /** Set the unconstrained demand. */ + void setUnconstrainedDemand (NbOfBookings_T& iDemand) { + _unconstrainedDemand = iDemand; + } + + /** Set the total bookings for the DCP. */ + void setDCPTotalNbOfBookings (NbOfBookings_T& iBookings) { + _lastDCPTotalNbOfBookings = iBookings; + } + + /** Set the remaining demand mean. */ + void setRemainingDemandMean (NbOfBookings_T&); + + /** Set the remaining demand mean for the net booking product. */ + void setRemainingProductDemandMean (NbOfBookings_T& iMean) { + _remainingProductDemandMean = iMean; + } + + /** Set the remaining demand standard deviation. */ + void setRemainingDemandSD (NbOfBookings_T&); + + /** Set the remaining demand standard deviation. */ + void setRemainingProductDemandSD (NbOfBookings_T& iSD) { + _remainingProductDemandSD = iSD; + } + + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -58,6 +249,79 @@ // Attributes /** The key of both structure and content objects. */ BomKey_T _key; + + /** Number of current bookings in the booking. */ + NbOfBookings_T _nbOfBookings; + + /** Total number of bookings (without substraction of cancellation). */ + NbOfBookings_T _totalNbOfBookings; + + /** Total number of bookings at the last DCP (without + substraction of cancellation). */ + NbOfBookings_T _lastDCPTotalNbOfBookings; + + /** Unconstraining demnd value (last RMS Computation).*/ + NbOfBookings_T _unconstrainedDemand; + + /** Number of cancelled demands. */ + NbOfCancellations_T _nbOfCancellations; + + /** Number of no-shows. */ + NbOfNoShows_T _nbOfNoShows; + + /** Number of available seats. */ + Availability_T _availability; + + /** Total Revenue of the booking. */ + Revenue_T _classRevenue; + + /** Current Censorship flag which indicates whether the demand + is censored. */ + CensorshipFlag_T _currentCensorshipFlag; + + /** List of censorship flags which indicates whether the demand + is censored (one flag per DCP). */ + CensorshipFlagList_T _censorshipFlagList; + + /** Value of the booking limit of the booking. */ + BookingLimit_T _bookingLimit; + + /** Value of the authorization level of the booking. */ + AuthorizationLevel_T _authorizationLevel; + + /** MAX of Authorization Level (AU). */ + AuthorizationLevel_T _MAX; + + /** MIN of Authorization Level (AU). */ + AuthorizationLevel_T _MIN; + + /** Rate of allowed overbooking. */ + OverbookingRate_T _overbookingRate; + + /** Current Fare value of the booking. */ + Fare_T _fare; + + /** Current Adjusted Fare value of the booking. */ + Yield_T _adjustedYield; + + /** Current Yield value of the booking. */ + Yield_T _yield; + + /** Temporary attributes just for the forecaster prototype. */ + /** Remaining demand mean for the whole booking. */ + NbOfBookings_T _remainingDemandMean; + + /** Remaining demand mean for the product corresponding to this booking + (excluding (OnDs)). */ + NbOfBookings_T _remainingProductDemandMean; + + /** Remaining demand standrad deviation for the whole booking. */ + NbOfBookings_T _remainingDemandSD; + + /** Remaining demand standard deviation for the product + corresponding to this booking (excluding (OnDs)). */ + NbOfBookings_T _remainingProductDemandSD; + }; } Modified: trunk/stdair/stdair/bom/BookingClassMap.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.cpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BookingClassMap.cpp 2009-11-04 10:39:37 UTC (rev 59) @@ -45,6 +45,12 @@ BookingClassMap_T::reverse_iterator BookingClassMap_T::rend () const { return _bookingClassHolder.mapREnd (); } - + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T:: + iterator BookingClassMap_T::find (const MapKey_T& iKey) const { + return _bookingClassHolder.find (iKey); + } + } Modified: trunk/stdair/stdair/bom/BookingClassMap.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassMap.hpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/BookingClassMap.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -50,6 +50,10 @@ return the reverse iterator at the end of the map. */ reverse_iterator rend () const; + /** Retrieve, if existing, the BookingClass corresponding to the + given key. */ + iterator find (const MapKey_T&) const; + public: /** Default constructors. */ BookingClassMap_T (); Added: trunk/stdair/stdair/bom/DoWStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/DoWStruct.cpp (rev 0) +++ trunk/stdair/stdair/bom/DoWStruct.cpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,75 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STL +#include <sstream> +// STDAIR +#include <stdair/basic/BasConst_Period_BOM.hpp> +#include <stdair/bom/DoWStruct.hpp> + +namespace stdair { + + // ////////////////////////////////////////////////////////////////////// + DoWStruct_T::DoWStruct_T (const std::string& iDowString) { + const unsigned short lDowStringSize = iDowString.size(); + assert (lDowStringSize == 7); + + _dowList.reserve (lDowStringSize); + for (std::string::const_iterator itChar = iDowString.begin(); + itChar != iDowString.end(); ++itChar) { + const bool isDoWSet = (*itChar == '1')?true:false; + _dowList.push_back (isDoWSet); + } + } + + // ////////////////////////////////////////////////////////////////////// + DoWStruct_T::DoWStruct_T (const DoWStruct_T& iDowStruct) : + _dowList (iDowStruct._dowList) { + + } + + // ////////////////////////////////////////////////////////////////////// + const std::string DoWStruct_T::describeShort() const { + std::ostringstream ostr; + short i = 0; + for (BooleanList_T::const_iterator itDoW = _dowList.begin(); + itDoW != _dowList.end(); ++itDoW, ++i) { + const char lDoW = (*itDoW == true)?'1':'0'; + ostr << lDoW; + } + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string DoWStruct_T::describe() const { + std::ostringstream ostr; + short i = 0; + for (BooleanList_T::const_iterator itDoW = _dowList.begin(); + itDoW != _dowList.end(); ++itDoW, ++i) { + const bool lDoW = *itDoW; + if (lDoW == true) { + ostr << DOW_STR[i] << "."; + } + } + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + bool DoWStruct_T::getDayOfWeek (const unsigned short i) const { + return _dowList.at (i); + } + + // ////////////////////////////////////////////////////////////////////// + bool DoWStruct_T::getStandardDayOfWeek (const unsigned short i) const { + unsigned short iStd = i; + if (iStd == 0) { + iStd = 6; + } else { + --iStd; + } + return _dowList.at (iStd); + } + +} Added: trunk/stdair/stdair/bom/DoWStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/DoWStruct.hpp (rev 0) +++ trunk/stdair/stdair/bom/DoWStruct.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -0,0 +1,51 @@ +#ifndef __STDAIR_BOM_DOWSTRUCT_HPP +#define __STDAIR_BOM_DOWSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <string> +#include <vector> +// STDAIR +#include <stdair/bom/StructAbstract.hpp> + +namespace stdair { + + /** Define a Day Of the Week (DoW) sequence. + <br>For instance, 1..11.1 means that the period is active on + Mon., Thu., Fri. and Sun. */ + struct DoWStruct_T : public StructAbstract { + public: + /** Define the bit set representing the DoW. */ + typedef std::vector<bool> BooleanList_T; + + /** Attributes. */ + BooleanList_T _dowList; + + /** Get the i-th day of the week (Monday being the first one). */ + bool getDayOfWeek (const unsigned short i) const; + + /** Get the i-th day of the week (Sunday being the first one). */ + bool getStandardDayOfWeek (const unsigned short i) const; + + /** Display explicitly (e.g., "Mon.Tue.Wed.Thu.Fri."). */ + const std::string describe() const; + + /** Display as a bit set (e.g., "1111100"). */ + const std::string describeShort() const; + + public: + /** Constructor from a given bit set (e.g., "0000011" for the + week-ends). */ + DoWStruct_T (const std::string& iDowString); + + /** Default constructor. */ + DoWStruct_T (); + + /** Default constructor. */ + DoWStruct_T (const DoWStruct_T&); + }; + +} +#endif // __STDAIR_BOM_DOWSTRUCT_HPP Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-28 10:05:59 UTC (rev 58) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-11-04 10:39:37 UTC (rev 59) @@ -51,6 +51,56 @@ typedef LegDate SecondContentChild_T; public: + // /////////// Getters ///////////// + /** Get a SegmentDateList_T for iteration methods. */ + SegmentDateList_T getSegmentDateList () const; + + /** Get a SegmentDateMap_T for iteration methods. */ + SegmentDateMap_T getSegmentDateMap () const; + + /** Get a LegDateList_T for iteration methods. */ + LegDateList_T getLegDateList () const; + + /** Get a LegDateMap_T for iteration methods. */ + LegDateMap_T getLegDateMap () const; + + /** Get the list of class structures */ + // BookingClassMap_T getClassList() const { +// return _bookingClassList; +// } + + /** Get the airline code (from the parent class). */ + // const AirlineCode_T& getAirlineCode() const; + +// /** Retrieve, if existing, the LegDate corresponding to the +// given board point (LegDate key). +// <br>If not existing, return the NULL pointer. */ +// LegDate* getLegDate (const AirportCode_T& iBoardPoint) const; + +// /** Retrieve, if existing, the SegmentDate corresponding to the +// given (board point, off point) pair (SegmentDate key). +// <br>If not existing, return the NULL pointer. */ +// SegmentDate* getSegmentDate (const AirportCode_T& iBoardPoint, +// const AirportCode_T& iOffPoint) const; + +// /** Return the BookingClass corresponding to a given key. +// <br>When no BookingClass, matching the given key, can be found, +// the NULL pointer is returned. +// <br>Otherwise, a pointer is returned on the BookingClass object. */ +// BookingClass* getBookingClass (const std::string&) const; + +// /** Retrieve, if existing, theOnD corresponding to the +// given OnDKey. +// <br>If not existing, return the NULL pointer. */ +// OnD* getOnD (const OnDKey_T& iOnDKey) const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _flightDateStructure; + } + + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -71,26 +121,9 @@ at the same level). */ const std::string describeShortKey() const; - public: - // /////////// Getters ///////////// - /** Get a SegmentDateList_T for iteration methods. */ - SegmentDateList_T getSegmentDateList () const; + /** Display the full FlightDate context. */ + //const std::string display() con... [truncated message content] |