From: <den...@us...> - 2010-12-03 10:04:53
|
Revision: 378 http://stdair.svn.sourceforge.net/stdair/?rev=378&view=rev Author: denis_arnaud Date: 2010-12-03 09:22:27 +0000 (Fri, 03 Dec 2010) Log Message: ----------- [API] Further specified the API. Modified Paths: -------------- trunk/stdair/stdair/sources.mk trunk/stdair/stdair/stdair_basic_types.hpp trunk/stdair/stdair/stdair_demand_types.hpp trunk/stdair/stdair/stdair_inventory_types.hpp trunk/stdair/stdair/stdair_types.hpp Added Paths: ----------- trunk/stdair/stdair/stdair_maths_types.hpp trunk/stdair/stdair/stdair_rm_types.hpp Modified: trunk/stdair/stdair/sources.mk =================================================================== --- trunk/stdair/stdair/sources.mk 2010-12-03 09:18:14 UTC (rev 377) +++ trunk/stdair/stdair/sources.mk 2010-12-03 09:22:27 UTC (rev 378) @@ -3,8 +3,10 @@ $(top_srcdir)/stdair/stdair_log.hpp \ $(top_srcdir)/stdair/stdair_db.hpp \ $(top_srcdir)/stdair/stdair_basic_types.hpp \ + $(top_srcdir)/stdair/stdair_maths_types.hpp \ $(top_srcdir)/stdair/stdair_date_time_types.hpp \ $(top_srcdir)/stdair/stdair_inventory_types.hpp \ + $(top_srcdir)/stdair/stdair_rm_types.hpp \ $(top_srcdir)/stdair/stdair_demand_types.hpp \ $(top_srcdir)/stdair/stdair_fare_types.hpp \ $(top_srcdir)/stdair/stdair_types.hpp \ Modified: trunk/stdair/stdair/stdair_basic_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 09:18:14 UTC (rev 377) +++ trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -66,10 +66,15 @@ /** Define the number of seats required by a demand. */ // typedef unsigned short NbOfSeats_T; - // ////////////////////////////////////////////////////////////////////// - // Probability - /** Probability */ - typedef float Probability_T; + // ///////////// Technical //////////////// + /** File or directory name. + <br>It may contain paths, relative or absolute (e.g., /foo/bar + or C:\foo\bar). */ + typedef std::string Filename_T; + + /** Define the file address type (e.g. "a_directory/a_filename"). + <br>NOTE: That type should be deprecated. */ + typedef std::string FileAddress_T; } #endif // __STDAIR_STDAIR_BASIC_TYPES_HPP Modified: trunk/stdair/stdair/stdair_demand_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_demand_types.hpp 2010-12-03 09:18:14 UTC (rev 377) +++ trunk/stdair/stdair/stdair_demand_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -66,6 +66,9 @@ /** Define a Willingness-To-Pay (WTP) (e.g., 1000.0 Euros). */ typedef double WTP_T; + /** Define the name of a WTP-component of characteristics pattern. */ + typedef boost::tuples::tuple<double, WTP_T> CharacteristicsWTP_tuple_T; + /** Number of passengers (in a group) for a booking. */ typedef unsigned short PartySize_T; @@ -85,13 +88,15 @@ (in a travel solution block). */ typedef unsigned short NbOfTravelSolutions_T; + /** Define a indicator of demand to class matching. */ + typedef double MatchingIndicator_T; + /** Define the name of an event. */ typedef std::string EventName_T; /** Define a number of events. */ typedef double NbOfEvents_T; - // ////////////////////////////////////////////////////////////////////// /** Type definition for the hashed key of the DemandStreamKey object. */ typedef std::string DemandStreamKeyStr_T; @@ -105,5 +110,12 @@ /** Type of frequent flyer (P=Platinum, G=Gold, S=Silver, M=Member, N=None).*/ typedef std::string FrequentFlyer_T; + /** Define the Request status for booking (1-letter-code, e.g., + B: booked, C: cancelled, R: Rejected). */ + typedef std::string RequestStatus_T; + + /** Define a map between a BookingID and a TravelSolutionID. */ + typedef std::map<Identity_T, Identity_T> BookingTSIDMap_T; + } #endif // __STDAIR_STDAIR_DEMAND_TYPES_HPP Modified: trunk/stdair/stdair/stdair_inventory_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 09:18:14 UTC (rev 377) +++ trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -15,6 +15,9 @@ namespace stdair { // //////// Type definitions ///////// + /** Define the type for network ID. */ + typedef std::string NetworkID_T; + /** Define the Airline Code type (2-letter-code, e.g., BA). */ typedef std::string AirlineCode_T; @@ -122,5 +125,8 @@ /** Define the current index of a Bid-Price Vector (for a given LegCabin). */ typedef unsigned int SeatIndex_T; + /** Mode of inventory control. */ + typedef std::string ControlMode_T; + } #endif // __STDAIR_STDAIR_INVENTORY_TYPES_HPP Added: trunk/stdair/stdair/stdair_maths_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_maths_types.hpp (rev 0) +++ trunk/stdair/stdair/stdair_maths_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -0,0 +1,48 @@ +#ifndef __STDAIR_STDAIR_MATHS_TYPES_HPP +#define __STDAIR_STDAIR_MATHS_TYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <string> +#include <vector> +#include <map> +// Boost Random +#include <boost/random/linear_congruential.hpp> +#include <boost/random/uniform_real.hpp> +#include <boost/random/variate_generator.hpp> + +namespace stdair { + + // //////// Type definitions ///////// + /** Define the replication number. */ + typedef unsigned int ReplicationNumber_T; + + /** Define the seed type of an Exponential function. */ + typedef unsigned long int ExponentialSeed_T; + + /** Define the seed type of an Uniform function. */ + typedef unsigned long int UniformSeed_T; + + /** Seed for the random generation, so that it can be reproductible. */ + typedef unsigned long int RandomSeed_T; + + /** Random number generator. */ + typedef boost::minstd_rand BaseGenerator_T; + + /** Uniform random generator. */ + typedef boost::variate_generator<stdair::BaseGenerator_T&, + boost::uniform_real<> > UniformGenerator_T; + + /** Define a mean value (e.g., 20.2). */ + typedef double MeanValue_T; + + /** Define a standard deviation value (e.g., 1.5). */ + typedef double StdDevValue_T; + + /** Probability */ + typedef float Probability_T; + +} +#endif // __STDAIR_STDAIR_MATHS_TYPES_HPP Added: trunk/stdair/stdair/stdair_rm_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_rm_types.hpp (rev 0) +++ trunk/stdair/stdair/stdair_rm_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -0,0 +1,53 @@ +#ifndef __STDAIR_STDAIR_RM_TYPES_HPP +#define __STDAIR_STDAIR_RM_TYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <string> +#include <vector> + +namespace stdair { + + // //////// Type definitions ///////// + /** Frequency of the Data Collection Point description (daily, monthly or + detailed). */ + typedef std::string DCPModeFrequency_T; + + /** Mode of the Data Collection Point description (Forecaster only, + Optimizer only or both of them). */ + typedef std::string DCPMode_T; + + /** Mode of the forecaster. */ + typedef std::string ForecasterMode_T; + + /** Limit of similar flight-dates used in the forecaster. */ + typedef short HistoricalDataLimit_T; + + /** Mode of the forecaster. */ + typedef std::string OptimizerMode_T; + + /** Mode of the forecaster. */ + typedef std::string DicoOptimizerMode_T; + + /** Define the name of sell-up probability flag for RMS optimizer. */ + typedef bool SellupFlagForOptimizer_T; + + /** Define the name of sell-up probability for RMS optimizer. */ + typedef double SellupProbabilityForOptimizer_T; + + /** Define the name of sell-up probability vector for RMS optimizer. */ + typedef std::vector<SellupProbabilityForOptimizer_T> SellupProbabilityVector_T; + + /** Define the demand for a policy. */ + typedef NbOfBookings_T PolicyDemand_T; + + /** Define the total revenue of an unconstrained policy. */ + typedef double PolicyRevenue_T; + + /** Define the total revenue of an unconstrained policy. */ + typedef double PolicyRevenue_T; + +} +#endif // __STDAIR_STDAIR_RM_TYPES_HPP Modified: trunk/stdair/stdair/stdair_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_types.hpp 2010-12-03 09:18:14 UTC (rev 377) +++ trunk/stdair/stdair/stdair_types.hpp 2010-12-03 09:22:27 UTC (rev 378) @@ -4,147 +4,17 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <vector> -#include <map> -// Boost Random -#include <boost/random/linear_congruential.hpp> -#include <boost/random/uniform_real.hpp> -#include <boost/random/variate_generator.hpp> -// Boost (Extended STL) -#include <boost/date_time/gregorian/gregorian.hpp> -#include <boost/date_time/posix_time/posix_time.hpp> -#include <boost/tuple/tuple.hpp> // StdAir #include <stdair/stdair_exceptions.hpp> #include <stdair/stdair_log.hpp> #include <stdair/stdair_db.hpp> #include <stdair/stdair_basic_types.hpp> #include <stdair/stdair_demand_types.hpp> +#include <stdair/stdair_maths_types.hpp> #include <stdair/stdair_fare_types.hpp> #include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_rm_types.hpp> #include <stdair/stdair_date_time_types.hpp> #include <stdair/stdair_service.hpp> -namespace stdair { - - // //////// Type definitions ///////// - /** Define the type for network ID. */ - typedef std::string NetworkID_T; - - /** Define the file address type (e.g. "a_directory/a_filename")*/ - typedef std::string FileAddress_T; - - /** Define the replication number. */ - typedef unsigned int ReplicationNumber_T; - - /** Define the seed type of an Exponential function. */ - typedef unsigned long int ExponentialSeed_T; - - /** Define the seed type of an Uniform function. */ - typedef unsigned long int UniformSeed_T; - - /** Define the Request status for booking (1-letter-code, e.g., - B: booked, C: cancelled, R: Rejected). */ - typedef std::string RequestStatus_T; - - /** Define a mean value (e.g., 20.2). */ - typedef double MeanValue_T; - - /** Define a standard deviation value (e.g., 1.5). */ - typedef double StdDevValue_T; - - /** Define a map between a BookingID and a TravelSolutionID. */ - typedef std::map<Identity_T, Identity_T> BookingTSIDMap_T; - - /** Define a indicator of demand to class matching. */ - typedef double MatchingIndicator_T; - - /** Frequency of the Data Collection Point description (daily, monthly or - detailed). */ - typedef std::string DCPModeFrequency_T; - - /** Mode of the Data Collection Point description (Forecaster only, - Optimizer only or both of them). */ - typedef std::string DCPMode_T; - - /** Mode of the forecaster. */ - typedef std::string ForecasterMode_T; - - /** Limit of similar flight-dates used in the forecaster. */ - typedef short HistoricalDataLimit_T; - - /** Mode of the forecaster. */ - typedef std::string OptimizerMode_T; - - /** Mode of the forecaster. */ - typedef std::string DicoOptimizerMode_T; - - /** Mode of inventory control. */ - typedef std::string ControlMode_T; - - /** Define the name of a multiplier. */ - typedef double Multiplier_T; - - /** Define the name of a WTP-component of characteristics pattern. */ - typedef boost::tuples::tuple<double, double> CharacteristicsWTP_tuple_T; - - /** Define the name of sell-up probability flag for RMS optimizer. */ - typedef bool SellupFlagForOptimizer_T; - - /** Define the name of sell-up probability for RMS optimizer. */ - typedef double SellupProbabilityForOptimizer_T; - - /** Define the name of sell-up probability vector for RMS optimizer. */ - typedef std::vector<SellupProbabilityForOptimizer_T> - SellupProbabilityVector_T; - - /** Define the demand for a policy. */ - typedef NbOfBookings_T PolicyDemand_T; - - /** Define the total revenue of an unconstrained policy. */ - typedef double PolicyRevenue_T; - - /** Define the total revenue of an unconstrained policy. */ - typedef double PolicyRevenue_T; - - // ///////////// Technical //////////////// - /** File or directory name. - <br>It may contain paths, relative or absolute (e.g., /foo/bar - or C:\foo\bar). */ - typedef std::string Filename_T; - - // ////////////////////////////////////////////////////////////////////// - // Random generation - /** Seed for the random generation, so that it can be reproductible. */ - typedef unsigned long int RandomSeed_T; - - /** Random number generator. */ - typedef boost::minstd_rand BaseGenerator_T; - - /** Uniform random generator. */ - typedef boost::variate_generator<stdair::BaseGenerator_T&, - boost::uniform_real<> > UniformGenerator_T; - - // ////////////////////////////////////////////////////////////////////// - // Probability - /** Probability */ - typedef float Probability_T; - - // ////////////////////////////////////////////////////////////////////// - /** Type definition for the hashed key of the DemandStreamKey object. */ - typedef std::string DemandStreamKeyStr_T; - - /** Type of booking channel (D=direct, I=indirect, N=oNline, F=oFfline). */ - typedef std::string ChannelLabel_T; - - /** Type of trip type (RO=outbound of round-trip, RI=inbound of round-trip, - OW=one way). */ - typedef std::string TripType_T; - - /** Type of frequent flyer (P=Platinum, G=Gold, S=Silver, M=Member, N=None). */ - typedef std::string FrequentFlyer_T; - -} #endif // __STDAIR_STDAIR_TYPES_HPP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |