From: <den...@us...> - 2010-08-13 18:23:29
|
Revision: 267 http://stdair.svn.sourceforge.net/stdair/?rev=267&view=rev Author: denis_arnaud Date: 2010-08-13 18:23:14 +0000 (Fri, 13 Aug 2010) Log Message: ----------- [Dev] Added a pragma check for non-Fedora SOCI distributions. Modified Paths: -------------- trunk/stdair/stdair/command/DBManagerForAirlines.cpp trunk/stdair/stdair/dbadaptor/DbaAirline.hpp trunk/stdair/stdair/service/DBSessionManager.cpp Modified: trunk/stdair/stdair/command/DBManagerForAirlines.cpp =================================================================== --- trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-08-13 14:47:29 UTC (rev 266) +++ trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-08-13 18:23:14 UTC (rev 267) @@ -8,8 +8,8 @@ #include <soci/core/soci.h> #include <soci/backends/mysql/soci-mysql.h> #else // SOCI_HEADERS_BURIED -#include <soci.h> -#include <soci-mysql.h> +#include <soci/soci.h> +#include <soci/soci-mysql.h> #endif // SOCI_HEADERS_BURIED // StdAir #include <stdair/bom/AirlineStruct.hpp> Modified: trunk/stdair/stdair/dbadaptor/DbaAirline.hpp =================================================================== --- trunk/stdair/stdair/dbadaptor/DbaAirline.hpp 2010-08-13 14:47:29 UTC (rev 266) +++ trunk/stdair/stdair/dbadaptor/DbaAirline.hpp 2010-08-13 18:23:14 UTC (rev 267) @@ -8,7 +8,7 @@ #if defined(SOCI_HEADERS_BURIED) #include <soci/core/soci.h> #else // SOCI_HEADERS_BURIED -#include <soci.h> +#include <soci/soci.h> #endif // SOCI_HEADERS_BURIED // Forward declarations Modified: trunk/stdair/stdair/service/DBSessionManager.cpp =================================================================== --- trunk/stdair/stdair/service/DBSessionManager.cpp 2010-08-13 14:47:29 UTC (rev 266) +++ trunk/stdair/stdair/service/DBSessionManager.cpp 2010-08-13 18:23:14 UTC (rev 267) @@ -10,8 +10,8 @@ #include <soci/core/soci.h> #include <soci/backends/mysql/soci-mysql.h> #else // SOCI_HEADERS_BURIED -#include <soci.h> -#include <soci-mysql.h> +#include <soci/soci.h> +#include <soci/soci-mysql.h> #endif // SOCI_HEADERS_BURIED // StdAir #include <stdair/basic/BasDBParams.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2010-08-13 18:56:35
|
Revision: 269 http://stdair.svn.sourceforge.net/stdair/?rev=269&view=rev Author: nbondoux Date: 2010-08-13 18:56:29 +0000 (Fri, 13 Aug 2010) Log Message: ----------- When using non buried SOCI headers, CFLAGS must contain include/soci dir. Modified Paths: -------------- trunk/stdair/stdair/command/DBManagerForAirlines.cpp trunk/stdair/stdair/dbadaptor/DbaAirline.hpp trunk/stdair/stdair/service/DBSessionManager.cpp Modified: trunk/stdair/stdair/command/DBManagerForAirlines.cpp =================================================================== --- trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-08-13 18:55:13 UTC (rev 268) +++ trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-08-13 18:56:29 UTC (rev 269) @@ -8,8 +8,8 @@ #include <soci/core/soci.h> #include <soci/backends/mysql/soci-mysql.h> #else // SOCI_HEADERS_BURIED -#include <soci/soci.h> -#include <soci/soci-mysql.h> +#include <soci.h> +#include <mysql/soci-mysql.h> #endif // SOCI_HEADERS_BURIED // StdAir #include <stdair/bom/AirlineStruct.hpp> Modified: trunk/stdair/stdair/dbadaptor/DbaAirline.hpp =================================================================== --- trunk/stdair/stdair/dbadaptor/DbaAirline.hpp 2010-08-13 18:55:13 UTC (rev 268) +++ trunk/stdair/stdair/dbadaptor/DbaAirline.hpp 2010-08-13 18:56:29 UTC (rev 269) @@ -8,7 +8,7 @@ #if defined(SOCI_HEADERS_BURIED) #include <soci/core/soci.h> #else // SOCI_HEADERS_BURIED -#include <soci/soci.h> +#include <soci.h> #endif // SOCI_HEADERS_BURIED // Forward declarations Modified: trunk/stdair/stdair/service/DBSessionManager.cpp =================================================================== --- trunk/stdair/stdair/service/DBSessionManager.cpp 2010-08-13 18:55:13 UTC (rev 268) +++ trunk/stdair/stdair/service/DBSessionManager.cpp 2010-08-13 18:56:29 UTC (rev 269) @@ -10,8 +10,8 @@ #include <soci/core/soci.h> #include <soci/backends/mysql/soci-mysql.h> #else // SOCI_HEADERS_BURIED -#include <soci/soci.h> -#include <soci/soci-mysql.h> +#include <soci.h> +#include <mysql/soci-mysql.h> #endif // SOCI_HEADERS_BURIED // StdAir #include <stdair/basic/BasDBParams.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-08-16 07:55:45
|
Revision: 270 http://stdair.svn.sourceforge.net/stdair/?rev=270&view=rev Author: quannaus Date: 2010-08-16 07:55:36 +0000 (Mon, 16 Aug 2010) Log Message: ----------- [dev] Implemented a sale. Modified Paths: -------------- trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/BasConst_Inventory.hpp trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/ReachableUniverse.cpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentCabinContent.cpp trunk/stdair/stdair/bom/SegmentCabinContent.hpp trunk/stdair/stdair/bom/SegmentPathPeriod.cpp Modified: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/basic/BasConst.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -142,6 +142,9 @@ /** Default availability. */ const Availability_T DEFAULT_AVAILABILITY = 0.0; + /** Maximal offered capacity in a cabin. */ + const Availability_T MAXIMAL_AVAILABILITY = 9999.0; + /** Default boolean for censorship flag given the status of availability for BookingClass. */ const CensorshipFlag_T DEFAULT_CLASS_CENSORSHIPFLAG = false; @@ -226,11 +229,11 @@ // //////// Travel Solutions /////// - /** Default Minimum connection time. */ - const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); + /** Default Minimal connection time. */ + const Duration_T DEFAULT_MINIMAL_CONNECTION_TIME (0, 30, 0); - /** Default maximum connection time. */ - const Duration_T DEFAULT_MAXIMUM_CONNECTION_TIME (24, 0, 0); + /** Default maximal connection time. */ + const Duration_T DEFAULT_MAXIMAL_CONNECTION_TIME (24, 0, 0); /** Default Matching Indicator value. */ const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); @@ -249,14 +252,14 @@ /** Default Bid-Price Vector. */ const BidPriceVector_T DEFAULT_BID_PRICE_VECTOR = std::vector<BidPrice_T>(); - /** Maximum number of legs linked to a single flight-date. + /** Maximal number of legs linked to a single flight-date. <br>Note that the number of derived segments is n*(n+1)/2 if n is the number of legs. */ - const unsigned short MAXIMUM_NUMBER_OF_LEGS_IN_FLIGHT = 7; + const unsigned short MAXIMAL_NUMBER_OF_LEGS_IN_FLIGHT = 7; - /** Maximum number of segments linked to a single O&D + /** Maximal number of segments linked to a single O&D (Origin & Destination). */ - const unsigned short MAXIMUM_NUMBER_OF_SEGMENTS_IN_OND = 3; + const unsigned short MAXIMAL_NUMBER_OF_SEGMENTS_IN_OND = 3; // ////////// BomManager-related constants /////////// Modified: trunk/stdair/stdair/basic/BasConst_Inventory.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_Inventory.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/basic/BasConst_Inventory.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -16,14 +16,17 @@ /** Default Bid-Price Vector. */ extern const BidPriceVector_T DEFAULT_BID_PRICE_VECTOR; - /** Maximum number of legs linked to a single flight-date. + /** Maximal number of legs linked to a single flight-date. <br>Note that the number of derived segments is n*(n+1)/2 if n is the number of legs. */ - extern const unsigned short MAXIMUM_NUMBER_OF_LEGS_IN_FLIGHT; + extern const unsigned short MAXIMAL_NUMBER_OF_LEGS_IN_FLIGHT; - /** Maximum number of segments linked to a single O&D + /** Maximal number of segments linked to a single O&D (Origin & Destination). */ - extern const unsigned short MAXIMUM_NUMBER_OF_SEGMENTS_IN_OND; + extern const unsigned short MAXIMAL_NUMBER_OF_SEGMENTS_IN_OND; + + /** Maximal offered capacity in a cabin. */ + extern const Availability_T MAXIMAL_AVAILABILITY; } #endif // __STDAIR_BAS_BASCONST_INVENTORY_HPP Modified: trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -16,11 +16,11 @@ /** Default distance value (kilometers). */ extern const Distance_T DEFAULT_DISTANCE_VALUE; - /** Default Minimum connection time. */ - extern const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME; + /** Default Minimal connection time. */ + extern const Duration_T DEFAULT_MINIMAL_CONNECTION_TIME; - /** Default maximum connection time. */ - extern const Duration_T DEFAULT_MAXIMUM_CONNECTION_TIME; + /** Default maximal connection time. */ + extern const Duration_T DEFAULT_MAXIMAL_CONNECTION_TIME; /** Null time duration (in boost::time_duration unit).*/ extern const Duration_T NULL_BOOST_TIME_DURATION; Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -58,6 +58,11 @@ return _structure.getParent().getParent(). getParent().getParent().getKey().getAirlineCode(); } + + // //////////////////////////////////////////////////////////////////// + void BookingClass::sell (const NbOfBookings_T& iNbOfBookings) { + _nbOfBookings += iNbOfBookings; + } } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -69,6 +69,10 @@ at any level). */ const std::string describeKey() const; + // ////////////// Business Methodes ///////////////// + /** Register a sale. */ + void sell (const NbOfBookings_T&); + protected: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -80,7 +80,12 @@ // //////////////////////////////////////////////////////////////////// SegmentDate* FlightDate::getSegmentDate (const SegmentDateKey_T& iKey) const { - return _structure.getChildPtr<SegmentDate> (iKey.toString() ); + return _structure.getChildPtr<SegmentDate> (iKey.toString()); } + + // //////////////////////////////////////////////////////////////////// + SegmentDate* FlightDate::getSegmentDate (const std::string& iKey) const { + return _structure.getChildPtr<SegmentDate> (iKey); + } } Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -74,6 +74,7 @@ given SegmentDate key. <br>If not existing, return the NULL pointer. */ SegmentDate* getSegmentDate (const SegmentDateKey_T&) const; + SegmentDate* getSegmentDate (const std::string&) const; public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/Inventory.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -78,6 +78,12 @@ } // //////////////////////////////////////////////////////////////////// + FlightDate* Inventory:: + getFlightDate (const std::string& iKey) const { + return _structure.getChildPtr<FlightDate> (iKey); + } + + // //////////////////////////////////////////////////////////////////// FlightPeriod* Inventory:: getFlightPeriod (const FlightPeriodKey_T& iKey) const { return _structure.getChildPtr<FlightPeriod> (iKey.toString()); Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/Inventory.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -101,6 +101,7 @@ given flight number and flight date (FlightDate key). <br>If not existing, return the NULL pointer. */ FlightDate* getFlightDate (const FlightDateKey_T&) const; + FlightDate* getFlightDate (const std::string&) const; /** Retrieve, if existing, the FlightPeriod corresponding to the given flight number and flight period (FlightPeriod key). Modified: trunk/stdair/stdair/bom/LegCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -52,6 +52,12 @@ oStr << _structure.describeParentKey() << ", " << describeShortKey(); return oStr.str(); } + + // //////////////////////////////////////////////////////////////////// + void LegCabin::updateFromReservation (const NbOfBookings_T& iNbOfBookings) { + _commitedSpace += iNbOfBookings; + _availabilityPool = _offeredCapacity - _commitedSpace; + } } Modified: trunk/stdair/stdair/bom/LegCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -72,6 +72,11 @@ at any level). */ const std::string describeKey() const; + public: + // /////////// Business methods ////////// + /** Register a sale. */ + void updateFromReservation (const NbOfBookings_T&); + protected: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/ReachableUniverse.cpp =================================================================== --- trunk/stdair/stdair/bom/ReachableUniverse.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/ReachableUniverse.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -76,7 +76,7 @@ addSegmentPathPeriod (const SegmentPathPeriod& iSegmentPathPeriod) { const NbOfSegments_T& lNbOfSegments = iSegmentPathPeriod.getNbOfSegments (); assert (lNbOfSegments > 0 - && lNbOfSegments <= MAXIMUM_NUMBER_OF_SEGMENTS_IN_OND); + && lNbOfSegments <= MAXIMAL_NUMBER_OF_SEGMENTS_IN_OND); // If needed, initialise the list of lists with empty fixed-length // segment path period lists. Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -65,10 +65,25 @@ } // //////////////////////////////////////////////////////////////////// + LegCabinList_T SegmentCabin::getLegCabinList () const { + return _structure.getChildrenHolder<LegCabin>(); + } + + // //////////////////////////////////////////////////////////////////// + LegCabinMap_T SegmentCabin::getLegCabinMap () const { + return _structure.getChildrenHolder<LegCabin>(); + } + + // //////////////////////////////////////////////////////////////////// BookingClass* SegmentCabin:: getBookingClass (const ClassCode_T& iClassCode) const { return _structure.getChildPtr<BookingClass> (iClassCode); } + + // //////////////////////////////////////////////////////////////////// + void SegmentCabin::updateFromReservation (const NbOfBookings_T& iNbOfBookings){ + _commitedSpace += iNbOfBookings; + } } Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -60,6 +60,8 @@ /** Get a list or map of a children type for iteration methods. */ BookingClassList_T getBookingClassList () const; BookingClassMap_T getBookingClassMap () const; + LegCabinList_T getLegCabinList () const; + LegCabinMap_T getLegCabinMap () const; /** Retrieve, if existing, the BookingClass corresponding to the given class code. @@ -82,6 +84,11 @@ /** Get a string describing the whole key (differentiating two objects at any level). */ const std::string describeKey() const; + + public: + // /////////// Business methods ////////// + /** Register a sale. */ + void updateFromReservation (const NbOfBookings_T&); protected: /** Constructors are private so as to force the usage of the Factory Modified: trunk/stdair/stdair/bom/SegmentCabinContent.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinContent.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/SegmentCabinContent.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -19,11 +19,7 @@ _commitedSpace (DEFAULT_COMMITED_SPACE), _availabilityPool (DEFAULT_AVAILABILITY), _bidPriceVector (DEFAULT_BID_PRICE_VECTOR), - _currentBidPrice (DEFAULT_BID_PRICE), - _cabinRevenue (DEFAULT_REVENUE_VALUE), - _cabinAverageFare (DEFAULT_FARE_VALUE), - _cabinUnitRevenue (DEFAULT_REVENUE_VALUE), - _cabinRPK (DEFAULT_DISTANCE_VALUE) { + _currentBidPrice (DEFAULT_BID_PRICE) { } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/SegmentCabinContent.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinContent.hpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/SegmentCabinContent.hpp 2010-08-16 07:55:36 UTC (rev 270) @@ -54,26 +54,6 @@ return _availabilityPool; } - /** Get the total cabin revenue. */ - const Revenue_T& getRevenue () const { - return _cabinRevenue; - } - - /** Get the cabin average fare. */ - const Fare_T& getAverageFare() const { - return _cabinAverageFare; - } - - /** Get the unit revenue value for this cabin. */ - const Revenue_T& getUnitRevenue () const { - return _cabinUnitRevenue; - } - - /** Get the Revenue Passanger Kilometer for this cabin. */ - const Distance_T& getRPK() const { - return _cabinRPK; - } - /** Retrive the current Bid-Price. */ const BidPrice_T& getCurrentBidPrice () const { return _currentBidPrice; @@ -111,26 +91,6 @@ _availabilityPool = iAvailabilityPool; } - /** Set the revenue amount. */ - void setRevenue (const Revenue_T& iCabinRevenue) { - _cabinRevenue = iCabinRevenue; - } - - /** Set the average cabin fare. */ - void setAverageCabinFare(Fare_T iCAFare) { - _cabinAverageFare = iCAFare; - } - - /** Set the Revenue Passanger Kilometer. */ - void setRPK (const Distance_T& iCabinRPK) { - _cabinRPK = iCabinRPK; - } - - /** Set the Unit Revenue. */ - void setUnitRevenue (const Revenue_T& iCabinURevenue) { - _cabinUnitRevenue = iCabinURevenue; - } - public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @@ -181,18 +141,6 @@ /** Current BidPrice. */ BidPrice_T _currentBidPrice; - - /** Total amount of money earned with cabin bookings. */ - Revenue_T _cabinRevenue; - - /** Value of the average fare of this cabin.*/ - Fare_T _cabinAverageFare; - - /** Value of the Unit Revenue (Revenue/ASK). */ - Revenue_T _cabinUnitRevenue; - - /** Value of the Revenue Passanger Kilometer for this cabin.*/ - Distance_T _cabinRPK; }; } Modified: trunk/stdair/stdair/bom/SegmentPathPeriod.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPathPeriod.cpp 2010-08-13 18:56:29 UTC (rev 269) +++ trunk/stdair/stdair/bom/SegmentPathPeriod.cpp 2010-08-16 07:55:36 UTC (rev 270) @@ -184,7 +184,7 @@ // can connect to a flight in the next day. if (lNextBoardingTime >= lLastOffTime) { const Duration_T lStopTime = lNextBoardingTime - lLastOffTime; - if (lStopTime < DEFAULT_MINIMUM_CONNECTION_TIME) { + if (lStopTime < DEFAULT_MINIMAL_CONNECTION_TIME) { return oSegmentPathPeriodKey; } else { // Calulcate the date offset of the next segment compare to @@ -216,7 +216,7 @@ } else { const Duration_T lStopTime = lNextBoardingTime - lLastOffTime + Duration_T (24, 0, 0); - if (lStopTime < DEFAULT_MINIMUM_CONNECTION_TIME) { + if (lStopTime < DEFAULT_MINIMAL_CONNECTION_TIME) { return oSegmentPathPeriodKey; } else { // Calulcate the date offset of the next segment compare to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-08-20 14:54:06
|
Revision: 273 http://stdair.svn.sourceforge.net/stdair/?rev=273&view=rev Author: quannaus Date: 2010-08-20 14:53:57 +0000 (Fri, 20 Aug 2010) Log Message: ----------- [dev] Implemented a new architecture for stdair. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/basic/sources.mk trunk/stdair/stdair/batches/stdair.cpp trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirlineFeatureKey.cpp trunk/stdair/stdair/bom/AirlineFeatureKey.hpp trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomRootKey.cpp trunk/stdair/stdair/bom/BomRootKey.hpp trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassKey.cpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/BookingClassTypes.hpp trunk/stdair/stdair/bom/BookingRequestStruct.hpp trunk/stdair/stdair/bom/Bucket.cpp trunk/stdair/stdair/bom/Bucket.hpp trunk/stdair/stdair/bom/BucketKey.cpp trunk/stdair/stdair/bom/BucketKey.hpp trunk/stdair/stdair/bom/BucketTypes.hpp trunk/stdair/stdair/bom/EventQueue.hpp trunk/stdair/stdair/bom/EventStruct.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/FlightDateKey.cpp trunk/stdair/stdair/bom/FlightDateKey.hpp trunk/stdair/stdair/bom/FlightDateTypes.hpp trunk/stdair/stdair/bom/FlightPeriod.cpp trunk/stdair/stdair/bom/FlightPeriod.hpp trunk/stdair/stdair/bom/FlightPeriodKey.cpp trunk/stdair/stdair/bom/FlightPeriodKey.hpp trunk/stdair/stdair/bom/FlightPeriodTypes.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/InventoryKey.cpp trunk/stdair/stdair/bom/InventoryKey.hpp trunk/stdair/stdair/bom/InventoryTypes.hpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegCabinKey.cpp trunk/stdair/stdair/bom/LegCabinKey.hpp trunk/stdair/stdair/bom/LegCabinTypes.hpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateKey.cpp trunk/stdair/stdair/bom/LegDateKey.hpp trunk/stdair/stdair/bom/LegDateTypes.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentCabinKey.cpp trunk/stdair/stdair/bom/SegmentCabinKey.hpp trunk/stdair/stdair/bom/SegmentCabinTypes.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/SegmentDateKey.cpp trunk/stdair/stdair/bom/SegmentDateKey.hpp trunk/stdair/stdair/bom/SegmentDateTypes.hpp trunk/stdair/stdair/bom/SegmentPeriod.cpp trunk/stdair/stdair/bom/SegmentPeriod.hpp trunk/stdair/stdair/bom/SegmentPeriodKey.cpp trunk/stdair/stdair/bom/SegmentPeriodKey.hpp trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp trunk/stdair/stdair/bom/YieldStore.cpp trunk/stdair/stdair/bom/YieldStore.hpp trunk/stdair/stdair/bom/YieldStoreKey.cpp trunk/stdair/stdair/bom/YieldStoreKey.hpp trunk/stdair/stdair/bom/YieldStoreTypes.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/command/CmdBomManager.cpp trunk/stdair/stdair/command/CmdBomManager.hpp trunk/stdair/stdair/factory/sources.mk trunk/stdair/stdair/service/STDAIR_Service.cpp trunk/stdair/stdair/service/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/BomAbstract.hpp trunk/stdair/stdair/bom/KeyAbstract.hpp trunk/stdair/stdair/bom/RelationShip.hpp trunk/stdair/stdair/bom/RelationShipAbstract.hpp trunk/stdair/stdair/factory/FacAbstract.cpp trunk/stdair/stdair/factory/FacAbstract.hpp trunk/stdair/stdair/factory/FacBom.hpp trunk/stdair/stdair/factory/FacBomManager.cpp trunk/stdair/stdair/factory/FacBomManager.hpp trunk/stdair/stdair/service/FacSupervisor.cpp trunk/stdair/stdair/service/FacSupervisor.hpp Removed Paths: ------------- trunk/stdair/stdair/basic/CategoricalAttribute.hpp trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp trunk/stdair/stdair/basic/ContinuousAttribute.hpp trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp trunk/stdair/stdair/basic/DemandCharacteristics.cpp trunk/stdair/stdair/basic/DemandCharacteristics.hpp trunk/stdair/stdair/basic/DemandDistribution.cpp trunk/stdair/stdair/basic/DemandDistribution.hpp trunk/stdair/stdair/basic/DictionaryManager.cpp trunk/stdair/stdair/basic/DictionaryManager.hpp trunk/stdair/stdair/basic/RandomGeneration.cpp trunk/stdair/stdair/basic/RandomGeneration.hpp trunk/stdair/stdair/basic/RandomGenerationContext.cpp trunk/stdair/stdair/basic/RandomGenerationContext.hpp trunk/stdair/stdair/bom/AirlineFeatureContent.cpp trunk/stdair/stdair/bom/AirlineFeatureContent.hpp trunk/stdair/stdair/bom/BomChildrenHolder.hpp trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomContent.hpp trunk/stdair/stdair/bom/BomIterator.hpp trunk/stdair/stdair/bom/BomKey.hpp trunk/stdair/stdair/bom/BomList.hpp trunk/stdair/stdair/bom/BomMap.hpp trunk/stdair/stdair/bom/BomMultimap.hpp trunk/stdair/stdair/bom/BomRootContent.cpp trunk/stdair/stdair/bom/BomRootContent.hpp trunk/stdair/stdair/bom/BomRootTypes.hpp trunk/stdair/stdair/bom/BomSource.hpp trunk/stdair/stdair/bom/BomStopContent.hpp trunk/stdair/stdair/bom/BomStructure.hpp trunk/stdair/stdair/bom/BomTypes.hpp trunk/stdair/stdair/bom/BookingClassContent.cpp trunk/stdair/stdair/bom/BookingClassContent.hpp trunk/stdair/stdair/bom/BucketContent.cpp trunk/stdair/stdair/bom/BucketContent.hpp trunk/stdair/stdair/bom/DemandStream.cpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/DemandStreamContent.cpp trunk/stdair/stdair/bom/DemandStreamContent.hpp trunk/stdair/stdair/bom/DemandStreamKey.cpp trunk/stdair/stdair/bom/DemandStreamKey.hpp trunk/stdair/stdair/bom/DemandStreamTypes.hpp trunk/stdair/stdair/bom/FlightDateContent.cpp trunk/stdair/stdair/bom/FlightDateContent.hpp trunk/stdair/stdair/bom/FlightPeriodContent.cpp trunk/stdair/stdair/bom/FlightPeriodContent.hpp trunk/stdair/stdair/bom/InventoryContent.cpp trunk/stdair/stdair/bom/InventoryContent.hpp trunk/stdair/stdair/bom/LegCabinContent.cpp trunk/stdair/stdair/bom/LegCabinContent.hpp trunk/stdair/stdair/bom/LegDateContent.cpp trunk/stdair/stdair/bom/LegDateContent.hpp trunk/stdair/stdair/bom/OriginDestinationSet.cpp trunk/stdair/stdair/bom/OriginDestinationSet.hpp trunk/stdair/stdair/bom/OriginDestinationSetContent.cpp trunk/stdair/stdair/bom/OriginDestinationSetContent.hpp trunk/stdair/stdair/bom/OriginDestinationSetKey.cpp trunk/stdair/stdair/bom/OriginDestinationSetKey.hpp trunk/stdair/stdair/bom/OriginDestinationSetTypes.hpp trunk/stdair/stdair/bom/ReachableUniverse.cpp trunk/stdair/stdair/bom/ReachableUniverse.hpp trunk/stdair/stdair/bom/ReachableUniverseContent.cpp trunk/stdair/stdair/bom/ReachableUniverseContent.hpp trunk/stdair/stdair/bom/ReachableUniverseKey.cpp trunk/stdair/stdair/bom/ReachableUniverseKey.hpp trunk/stdair/stdair/bom/ReachableUniverseTypes.hpp trunk/stdair/stdair/bom/SegmentCabinContent.cpp trunk/stdair/stdair/bom/SegmentCabinContent.hpp trunk/stdair/stdair/bom/SegmentDateContent.cpp trunk/stdair/stdair/bom/SegmentDateContent.hpp trunk/stdair/stdair/bom/SegmentPathPeriod.cpp trunk/stdair/stdair/bom/SegmentPathPeriod.hpp trunk/stdair/stdair/bom/SegmentPathPeriodContent.cpp trunk/stdair/stdair/bom/SegmentPathPeriodContent.hpp trunk/stdair/stdair/bom/SegmentPathPeriodKey.cpp trunk/stdair/stdair/bom/SegmentPathPeriodKey.hpp trunk/stdair/stdair/bom/SegmentPathPeriodTypes.hpp trunk/stdair/stdair/bom/SegmentPeriodContent.cpp trunk/stdair/stdair/bom/SegmentPeriodContent.hpp trunk/stdair/stdair/bom/Structure.hpp trunk/stdair/stdair/bom/YieldStoreContent.cpp trunk/stdair/stdair/bom/YieldStoreContent.hpp trunk/stdair/stdair/factory/FacBomContent.cpp trunk/stdair/stdair/factory/FacBomContent.hpp trunk/stdair/stdair/factory/FacBomStructure.cpp trunk/stdair/stdair/factory/FacBomStructure.hpp trunk/stdair/stdair/factory/FacSupervisor.cpp trunk/stdair/stdair/factory/FacSupervisor.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -39,12 +39,18 @@ class NonInitialisedServiceException : public RootException { }; + class NonInitialisedContainerException : public RootException { }; + + class NonInitialisedRelationShip : public RootException { }; + class MemoryAllocationException : public RootException { }; class ObjectLinkingException : public RootException { }; class ParserException : public RootException { }; + class DocumentNotFoundException : public RootException { }; + class CodeConversionException : public ParserException { }; class CodeDuplicationException : public ParserException { }; @@ -58,8 +64,6 @@ class SQLDatabaseConnectionImpossibleException : public SQLDatabaseException { }; - class DocumentNotFoundException : public RootException { }; - // /////////////// Log ///////////// /** Level of logs. */ namespace LOG { @@ -216,7 +220,7 @@ typedef double MeanValue_T; /** Define a standard deviation value (e.g., 1.5). */ - typedef double StandardDeviationValue_T; + typedef double StdDevValue_T; /** Define the cabin capacity (resource, e.g., 200 seats). <br>The capacity is expressed as a double to cope with overbooking. */ @@ -421,9 +425,6 @@ /** Probability */ typedef float Probability_T; - /** Dictionary key. */ - typedef unsigned char DictionaryKey_T; - // ////////////////////////////////////////////////////////////////////// // Date / Time /** Time duration in (integer) number of seconds */ @@ -476,4 +477,82 @@ typedef std::map<CabinCode_T, ClassList_String_T> CabinBookingClassMap_T; } + +#define CATCH \ + catch (const stdair::FileNotFoundException& ex) { \ + std::cerr << "FileNotFoundException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::NonInitialisedLogServiceException& ex) { \ + std::cerr << "NonInitialisedLogServiceException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::NonInitialisedDBSessionManagerException& ex) { \ + std::cerr << "NonInitialisedDBSessionManagerException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::NonInitialisedServiceException& ex) { \ + std::cerr << "NonInitialisedServiceException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::NonInitialisedContainerException& ex) { \ + std::cerr << "NonInitialisedContainerException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::NonInitialisedRelationShip& ex) { \ + std::cerr << "NonInitialisedRelationShip" << std::endl; \ + return -1; \ + \ + } catch (const stdair::MemoryAllocationException& ex) { \ + std::cerr << "MemoryAllocationException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::ObjectLinkingException& ex) { \ + std::cerr << "ObjectLinkingException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::CodeConversionException& ex) { \ + std::cerr << "CodeConversionException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::CodeDuplicationException& ex) { \ + std::cerr << "CodeDuplicationException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::ObjectCreationgDuplicationException& ex) { \ + std::cerr << "ObjectCreationgDuplicationException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::ObjectNotFoundException& ex) { \ + std::cerr << "ObjectNotFoundException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::DocumentNotFoundException& ex) { \ + std::cerr << "DocumentNotFoundException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::SQLDatabaseConnectionImpossibleException& ex) { \ + std::cerr << "SQLDatabaseConnectionImpossibleException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::SQLDatabaseException& ex) { \ + std::cerr << "SQLDatabaseException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::ParserException& ex) { \ + std::cerr << "ParserException" << std::endl; \ + return -1; \ + \ + } catch (const stdair::RootException& ex) { \ + std::cerr << "RootException" << std::endl; \ + return -1; \ + \ + } catch (const std::exception& stde) { \ + std::cerr << "Standard exception: " << stde.what() << std::endl; \ + return -1; \ + \ + } catch (...) { \ + return -1; \ + } \ + #endif // __STDAIR_STDAIR_TYPES_HPP Deleted: trunk/stdair/stdair/basic/CategoricalAttribute.hpp =================================================================== --- trunk/stdair/stdair/basic/CategoricalAttribute.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/CategoricalAttribute.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,138 +0,0 @@ -#ifndef __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP -#define __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <map> -#include <iosfwd> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DictionaryManager.hpp> - -namespace stdair { - - /** Class modeling the distribution of values that can be taken by a - categorical attribute. */ - template <class T> - struct CategoricalAttribute { - - public: - /** Define the probability mass function type. */ - typedef std::map<T, DictionaryKey_T> ProbabilityMassFunction_T; - - /** Define the inverse cumulative distribution type. */ - typedef std::map<DictionaryKey_T, T> InverseCumulativeDistribution_T; - - private: - // ///////////// Getters /////////// - /** Get the probability mass function. */ - const ProbabilityMassFunction_T& getProbabilityMassFunction() const { - return _probabilityMassFunction; - } - - /** Get the inverse cumulative distribution. */ - const InverseCumulativeDistribution_T& getInverseCumulativeDistribution () const { - return _inverseCumulativeDistribution; - } - - // ///////////// Setters /////////// - /** Set the probability mass function */ - void setProbabilityMassFunction (const ProbabilityMassFunction_T& iProbabilityMassFunction) { - _probabilityMassFunction = iProbabilityMassFunction; - determineInverseCumulativeDistributionFromProbabilityMassFunction(); - } - - public: - // /////////////// Business Methods ////////// - /** Get value from inverse cumulative distribution. */ - const T getValue (Probability_T iCumulativeProbability) const { - const DictionaryKey_T lKey = - DictionaryManager::valueToKey (iCumulativeProbability); - return _inverseCumulativeDistribution. - lower_bound (lKey)->second; - } - - public: - // ////////////// Display Support Methods ////////// - /** Display probability mass function. */ - const std::string displayProbabilityMassFunction () const { - std::ostringstream oStr; - unsigned int idx = 0; - - for (typename ProbabilityMassFunction_T::const_iterator it = - _probabilityMassFunction.begin(); - it != _probabilityMassFunction.end(); ++it, ++idx) { - if (idx != 0) { - oStr << ", "; - } - oStr << it->first << ":" - << DictionaryManager::keyToValue (it->second); - } - - return oStr.str(); - } - - /** Display inverse cumulative distribution. */ - const std::string displayInverseCumulativeDistribution () const { - std::ostringstream oStr; - - for (typename InverseCumulativeDistribution_T::const_iterator it = - _inverseCumulativeDistribution.begin(); - it != _inverseCumulativeDistribution.end(); ++it) { - oStr << "cumulative prob: " << DictionaryManager::keyToValue (it->first) - << " value: " << it->second << std::endl; - } - - return oStr.str(); - } - - public: - // ////////// Constructors and destructors ///////// - /** Constructor by default */ - CategoricalAttribute (const ProbabilityMassFunction_T& iProbabilityMassFunction) - : _probabilityMassFunction (iProbabilityMassFunction) { - determineInverseCumulativeDistributionFromProbabilityMassFunction(); - } - /** Default constructors. */ - CategoricalAttribute () { } - CategoricalAttribute (const CategoricalAttribute& iCategoricalAttribute) - : _probabilityMassFunction (iCategoricalAttribute._probabilityMassFunction) { - determineInverseCumulativeDistributionFromProbabilityMassFunction(); - } - - /** Destructor */ - virtual ~CategoricalAttribute () { } - - - /** Determine inverse cumulative distribution from probability mass function (initialisation). */ - void determineInverseCumulativeDistributionFromProbabilityMassFunction () { - Probability_T cumulative_probability_so_far = 0.0; - for (typename ProbabilityMassFunction_T::const_iterator itProbabilityMassFunction = _probabilityMassFunction.begin(); - itProbabilityMassFunction != _probabilityMassFunction.end(); - ++itProbabilityMassFunction) { - Probability_T attribute_probability_mass = - DictionaryManager::keyToValue (itProbabilityMassFunction->second); - if (attribute_probability_mass > 0) { - T attribute_value = itProbabilityMassFunction->first; - cumulative_probability_so_far += attribute_probability_mass; - DictionaryKey_T lKey = - DictionaryManager::valueToKey (cumulative_probability_so_far); - //_inverseCumulativeDistribution[lKey] = attribute_value; - _inverseCumulativeDistribution.insert (typename InverseCumulativeDistribution_T::value_type (lKey, attribute_value)); - } - } - } - - private: - // ////////// Attributes ////////// - /** Probability mass function */ - ProbabilityMassFunction_T _probabilityMassFunction; - - /** Inverse cumulative distribution */ - InverseCumulativeDistribution_T _inverseCumulativeDistribution; - - }; -} -#endif // __STDAIR_BAS_CATEGORICALATTRIBUTE_HPP Deleted: trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp =================================================================== --- trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/CategoricalAttributeLite.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,122 +0,0 @@ -#ifndef __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP -#define __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <map> -#include <iosfwd> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DictionaryManager.hpp> -#include <stdair/service/Logger.hpp> - -namespace stdair { - - /** Class modeling the distribution of values that can be taken by a - categorical attribute. */ - template <class T> - struct CategoricalAttributeLite { - public: - /** Define the probability mass function type. */ - typedef std::map<T, Probability_T> ProbabilityMassFunction_T; - - public: - // /////////////// Business Methods ////////// - /** Get value from inverse cumulative distribution. */ - const T getValue (Probability_T iCumulativeProbability) const { - const DictionaryKey_T lKey = - DictionaryManager::valueToKey (iCumulativeProbability); - - for (unsigned int idx = 0; idx < _size; ++idx) { - if (_cumulativeDistribution[idx] >= lKey) { - return _valueArray[idx]; - } - } - - STDAIR_LOG_ERROR ("The following cumulative probability " - << "is out of range: " << iCumulativeProbability); - assert (false); - T t; - return t; - } - - public: - // ////////////// Display Support Methods ////////// - /** Display probability mass function. */ - const std::string displayProbabilityMass () const { - std::ostringstream oStr; - - for (unsigned int idx = 0; idx < _size; ++idx) { - if (idx != 0) { - oStr << ", "; - } - oStr << _valueArray [idx] << ":" - << DictionaryManager::keyToValue (_cumulativeDistribution[idx]); - } - return oStr.str(); - } - - public: - // ////////// Constructors and destructors ///////// - /** Constructor by default */ - CategoricalAttributeLite (const ProbabilityMassFunction_T& iValueMap) - : _size (iValueMap.size()) { - _cumulativeDistribution = new DictionaryKey_T[_size]; - _valueArray = new T[_size]; - init (iValueMap); - } - /** Destructor */ - virtual ~CategoricalAttributeLite () { - // TODO: Verify that the arrays are correctly cleaned. - delete _cumulativeDistribution; _cumulativeDistribution = NULL; - delete _valueArray; _valueArray = NULL; - } - - private: - /** Default constructors. */ - CategoricalAttributeLite (); - CategoricalAttributeLite (const CategoricalAttributeLite&); - - - /** Initialise the two arrays from the given map. */ - void init (const ProbabilityMassFunction_T& iValueMap) { - - Probability_T cumulative_probability_so_far = 0.0; - unsigned int idx = 0; - - // Browse the map to retrieve the values and to build the - // cumulative probabilities. - for (typename ProbabilityMassFunction_T::const_iterator itProbabilityMassFunction = iValueMap.begin(); - itProbabilityMassFunction != iValueMap.end(); - ++itProbabilityMassFunction, ++idx) { - - Probability_T attribute_probability_mass = - itProbabilityMassFunction->second; - if (attribute_probability_mass > 0) { - T attribute_value = itProbabilityMassFunction->first; - cumulative_probability_so_far += attribute_probability_mass; - DictionaryKey_T lKey = - DictionaryManager::valueToKey (cumulative_probability_so_far); - - // Build the two arrays. - _cumulativeDistribution[idx] = lKey; - _valueArray[idx] = attribute_value; - } - } - } - - private: - // ////////// Attributes ////////// - /** Size of the two arrays. */ - const unsigned int _size; - - /** Cumulative dictionary-coded distribution. */ - DictionaryKey_T* _cumulativeDistribution; - - /** The corresponding values. */ - T* _valueArray; - }; -} -#endif // __STDAIR_BAS_CATEGORICALATTRIBUTELITE_HPP Deleted: trunk/stdair/stdair/basic/ContinuousAttribute.hpp =================================================================== --- trunk/stdair/stdair/basic/ContinuousAttribute.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/ContinuousAttribute.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,154 +0,0 @@ -#ifndef __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP -#define __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DictionaryManager.hpp> -#include <stdair/service/Logger.hpp> - -namespace stdair { - - /** Class modeling the distribution of values that can be taken by a - continuous attribute. */ - template <class T> - struct ContinuousAttribute { - public: - - // ///////////// Type definitions ////////////// - /** */ - typedef std::multimap<T, DictionaryKey_T> ContinuousDistribution_T; - typedef std::multimap<DictionaryKey_T, T> ContinuousInverseDistribution_T; - - private: - // ///////////// Getters /////////// - /** Get the cumulative distribution. */ - const ContinuousDistribution_T& getCumulativeDistribution() const { - return _cumulativeDistribution; - } - - /** Get the inverse cumulative distribution. */ - const ContinuousInverseDistribution_T& getInverseCumulativeDistribution () const { - return _inverseCumulativeDistribution; - } - - private: - // ///////////// Setters /////////// - /** Set the cumulative distribution */ - void setCumulativeDistribution (const ContinuousDistribution_T& iCumulativeDistribution) { - _cumulativeDistribution = iCumulativeDistribution; - determineInverseCumulativeDistributionFromCumulativeDistribution(); - } - - public: - // /////////////// Business Methods ////////// - /** Get value from inverse cumulative distribution. */ - const T getValue (const Probability_T& iCumulativeProbability) const { - const DictionaryKey_T lKey = - DictionaryManager::valueToKey (iCumulativeProbability); - typename ContinuousInverseDistribution_T::const_iterator it = - _inverseCumulativeDistribution.lower_bound (lKey); - - Probability_T cumulativeProbabilityNextPoint = - DictionaryManager::keyToValue (it->first); - T valueNextPoint = it->second; - - if (it == _inverseCumulativeDistribution.begin()) { - STDAIR_LOG_DEBUG ("Last element"); - return valueNextPoint; - } - --it; - - Probability_T cumulativeProbabilityPreviousPoint = - DictionaryManager::keyToValue (it->first); - T valuePreviousPoint = it->second; - if (cumulativeProbabilityNextPoint == cumulativeProbabilityPreviousPoint) { - return valuePreviousPoint; - } - - return valuePreviousPoint + (valueNextPoint - valuePreviousPoint) - * (iCumulativeProbability - cumulativeProbabilityPreviousPoint) - / (cumulativeProbabilityNextPoint - cumulativeProbabilityPreviousPoint); - } - - public: - // ////////////// Display Support Methods ////////// - /** Display cumulative distribution */ - const std::string displayCumulativeDistribution() const { - std::ostringstream oStr; - unsigned int idx = 0; - for (typename ContinuousDistribution_T::const_iterator it = - _cumulativeDistribution.begin(); - it != _cumulativeDistribution.end(); ++it, ++idx) { - if (idx != 0) { - oStr << ", "; - } - oStr << it->first << ":" - << DictionaryManager::keyToValue (it->second); - } - return oStr.str(); - } - - /** Display inverse cumulative distribution */ - const std::string displayInverseCumulativeDistribution() const { - std::ostringstream oStr; - for (typename ContinuousInverseDistribution_T::const_iterator it = - _inverseCumulativeDistribution.begin(); - it != _inverseCumulativeDistribution.end(); ++it) { - oStr << "cumulative prob: " << DictionaryManager::keyToValue (it->first) - << " value: " << it->second << std::endl; - } - return oStr.str(); - } - - public: - // ////////// Constructors and destructors ///////// - /** Constructor by default */ - ContinuousAttribute () { } - - /** Constructor */ - ContinuousAttribute (const ContinuousDistribution_T& iCumulativeDistribution) - : _cumulativeDistribution (iCumulativeDistribution) { - determineInverseCumulativeDistributionFromCumulativeDistribution(); - } - - /** Copy constructor */ - ContinuousAttribute (const ContinuousAttribute& iContinuousAttribute) - : _cumulativeDistribution (iContinuousAttribute._cumulativeDistribution), - _inverseCumulativeDistribution (iContinuousAttribute._inverseCumulativeDistribution) { - } - - /** Destructor */ - virtual ~ContinuousAttribute () { } - - /** Determine inverse cumulative distribution from cumulative - distribution (initialisation). */ - void determineInverseCumulativeDistributionFromCumulativeDistribution () { - for (typename ContinuousDistribution_T::iterator itCumulativeDistribution = - _cumulativeDistribution.begin(); - itCumulativeDistribution != _cumulativeDistribution.end(); - ++itCumulativeDistribution) { - _inverseCumulativeDistribution. - insert (typename ContinuousInverseDistribution_T:: - value_type (itCumulativeDistribution->second, - itCumulativeDistribution->first)); - } - } - - private: - // ////////// Attributes ////////// - - /** Cumulative distribution */ - ContinuousDistribution_T _cumulativeDistribution; - - /** Inverse cumulative distribution */ - ContinuousInverseDistribution_T _inverseCumulativeDistribution; - }; - -} -#endif // __STDAIR_BAS_CONTINUOUSATTRIBUTE_HPP Deleted: trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp =================================================================== --- trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/ContinuousAttributeLite.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,129 +0,0 @@ -#ifndef __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP -#define __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -#include <map> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DictionaryManager.hpp> -#include <stdair/service/Logger.hpp> - -namespace stdair { - - /** Class modeling the distribution of values that can be taken by a - continuous attribute. */ - template <class T> - struct ContinuousAttributeLite { - public: - // ///////////// Type definitions ////////////// - typedef std::multimap<T, Probability_T> ContinuousDistribution_T; - - public: - // /////////////// Business Methods ////////// - /** Get value from inverse cumulative distribution. */ - const T getValue (const Probability_T& iCumulativeProbability) const { - const DictionaryKey_T lKey = - DictionaryManager::valueToKey (iCumulativeProbability); - unsigned int idx = 0; - - // Find the first cumulative probablity value greater or equal to lKey. - for (; idx < _size; ++idx) { - if (_cumulativeDistribution[idx] >= lKey) { - break; - } - } - - if (idx == 0) { - return _valueArray[idx]; - } - - Probability_T lCumulativeCurrentPoint = - DictionaryManager::keyToValue (_cumulativeDistribution[idx]); - Probability_T lCumulativePreviousPoint = - DictionaryManager::keyToValue (_cumulativeDistribution[idx-1]); - T lValueCurrentPoint = _valueArray[idx]; - T lValuePreviousPoint = _valueArray[idx-1]; - - if (lCumulativePreviousPoint == lCumulativeCurrentPoint) { - return lValuePreviousPoint; - } - - return lValuePreviousPoint + (lValueCurrentPoint - lValuePreviousPoint) - * (iCumulativeProbability - lCumulativePreviousPoint) - / (lCumulativeCurrentPoint - lCumulativePreviousPoint); - } - - public: - // ////////////// Display Support Methods ////////// - /** Display cumulative distribution */ - const std::string displayCumulativeDistribution() const { - std::ostringstream oStr; - - for (unsigned int idx = 0; idx < _size; ++idx) { - if (idx != 0) { - oStr << ", "; - } - oStr << _valueArray[idx] << ":" - << DictionaryManager::keyToValue (_cumulativeDistribution[idx]); - } - return oStr.str(); - } - - public: - // ////////// Constructors and destructors ///////// - /** Constructor */ - ContinuousAttributeLite (const ContinuousDistribution_T& iValueMap) - : _size (iValueMap.size()) { - _cumulativeDistribution = new DictionaryKey_T[_size]; - _valueArray = new T[_size]; - init (iValueMap); - } - - /** Destructor */ - virtual ~ContinuousAttributeLite () { - // TODO: Verify that the arrays are correctly cleaned. - delete _cumulativeDistribution; _cumulativeDistribution = NULL; - delete _valueArray; _valueArray = NULL; - } - - private: - /** Constructors by default */ - ContinuousAttributeLite (); - ContinuousAttributeLite (const ContinuousAttributeLite&); - - /** Determine inverse cumulative distribution from cumulative - distribution (initialisation). */ - void init (const ContinuousDistribution_T& iValueMap) { - unsigned int idx = 0; - - // Browse the map to retrieve the values and cumulative probabilities. - for (typename ContinuousDistribution_T::const_iterator it = - iValueMap.begin(); it != iValueMap.end(); ++it, ++idx) { - - T attributeValue = it->first; - DictionaryKey_T lKey = DictionaryManager::valueToKey (it->second); - - // Build the two arrays. - _cumulativeDistribution[idx] = lKey; - _valueArray[idx] = attributeValue; - } - } - - private: - // ////////// Attributes ////////// - /** Size of the two arrays. */ - const unsigned int _size; - - /** Cumulative dictionary-coded distribution. */ - DictionaryKey_T* _cumulativeDistribution; - - /** The corresponding values. */ - T* _valueArray; - }; - -} -#endif // __STDAIR_BAS_CONTINUOUSATTRIBUTELITE_HPP Deleted: trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp =================================================================== --- trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DemandCharacteristicTypes.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,69 +0,0 @@ -#ifndef __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP -#define __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// StdAir -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/ContinuousAttributeLite.hpp> -#include <stdair/basic/CategoricalAttributeLite.hpp> - -namespace stdair { - - /** Type definition for the continuous distribition of the duration - (as a float number). */ - typedef ContinuousAttributeLite<FloatDuration_T> ContinuousFloatDuration_T; - - /** Type definition for the arrival pattern cumulative distribution. */ - typedef ContinuousFloatDuration_T::ContinuousDistribution_T ArrivalPatternCumulativeDistribution_T; - - /** Define the point-of-sale probablity mass. */ - typedef CategoricalAttributeLite<AirportCode_T> POSProbabilityMass_T; - - /** Define the probability mass function type of point-of-sale. */ - typedef POSProbabilityMass_T::ProbabilityMassFunction_T POSProbabilityMassFunction_T; - - /** Define the booking channel probablity mass. */ - typedef CategoricalAttributeLite<ChannelLabel_T> ChannelProbabilityMass_T; - - /** Define the probability mass function type of booking channel. */ - typedef ChannelProbabilityMass_T::ProbabilityMassFunction_T ChannelProbabilityMassFunction_T; - - /** Define the trip type probablity mass. */ - typedef CategoricalAttributeLite<TripType_T> TripTypeProbabilityMass_T; - - /** Define the probability mass function type of trip type. */ - typedef TripTypeProbabilityMass_T::ProbabilityMassFunction_T TripTypeProbabilityMassFunction_T; - - /** Define the stay duration probablity mass. */ - typedef CategoricalAttributeLite<DayDuration_T> StayDurationProbabilityMass_T; - - /** Define the probability mass function type of stay duration. */ - typedef StayDurationProbabilityMass_T::ProbabilityMassFunction_T StayDurationProbabilityMassFunction_T; - - /** Define the frequent flyer probablity mass. */ - typedef CategoricalAttributeLite<FrequentFlyer_T> FrequentFlyerProbabilityMass_T; - - /** Define the probability mass function type of frequent flyer. */ - typedef FrequentFlyerProbabilityMass_T::ProbabilityMassFunction_T FrequentFlyerProbabilityMassFunction_T; - - /** Define the preferred departure time cumulative distribution. */ - typedef ContinuousAttributeLite<IntDuration_T> PreferredDepartureTimeCumulativeDistribution_T; - - /** Define the preferred departure time continuous distribution. */ - typedef PreferredDepartureTimeCumulativeDistribution_T::ContinuousDistribution_T PreferredDepartureTimeContinuousDistribution_T; - - /** Define the willingness-to-pay cumulative distribution. */ - typedef ContinuousAttributeLite<WTP_T> WTPCumulativeDistribution_T; - - /** Define the willingness-to-pay continuous distribution. */ - typedef WTPCumulativeDistribution_T::ContinuousDistribution_T WTPContinuousDistribution_T; - - /** Define the value of time cumulative distribution. */ - typedef ContinuousAttributeLite<PriceValue_T> ValueOfTimeCumulativeDistribution_T; - - /** Define the value of time continuous distribution. */ - typedef ValueOfTimeCumulativeDistribution_T::ContinuousDistribution_T ValueOfTimeContinuousDistribution_T; -} -#endif // __STDAIR_BAS_DEMANDCHARACTERISTICTYPES_HPP Deleted: trunk/stdair/stdair/basic/DemandCharacteristics.cpp =================================================================== --- trunk/stdair/stdair/basic/DemandCharacteristics.cpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DemandCharacteristics.cpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,78 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -#include <sstream> -// StdAir -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/BasConst_General.hpp> -#include <stdair/basic/DemandCharacteristics.hpp> - -namespace stdair { - - // ///////////////////////////////////////////////////// - DemandCharacteristics:: - DemandCharacteristics (const ArrivalPatternCumulativeDistribution_T& iArrivalPattern, - const POSProbabilityMassFunction_T& iPOSProbMass, - const ChannelProbabilityMassFunction_T& iChannelProbMass, - const TripTypeProbabilityMassFunction_T& iTripTypeProbMass, - const StayDurationProbabilityMassFunction_T& iStayDurationProbMass, - const FrequentFlyerProbabilityMassFunction_T& iFrequentFlyerProbMass, - const PreferredDepartureTimeContinuousDistribution_T& iPreferredDepartureTimeContinuousDistribution, - const WTPContinuousDistribution_T& iWTPContinuousDistribution, - const ValueOfTimeContinuousDistribution_T& iValueOfTimeContinuousDistribution) - : _arrivalPattern (iArrivalPattern), - _posProbabilityMass (iPOSProbMass), - _channelProbabilityMass (iChannelProbMass), - _tripTypeProbabilityMass (iTripTypeProbMass), - _stayDurationProbabilityMass (iStayDurationProbMass), - _frequentFlyerProbabilityMass (iFrequentFlyerProbMass), - _preferredDepartureTimeCumulativeDistribution (iPreferredDepartureTimeContinuousDistribution), - _wtpCumulativeDistribution (iWTPContinuousDistribution), - _valueOfTimeCumulativeDistribution (iValueOfTimeContinuousDistribution) { - } - - // ///////////////////////////////////////////////////// - DemandCharacteristics::~DemandCharacteristics () { - } - - // ///////////////////////////////////////////////////// - std::string DemandCharacteristics::display() const { - std::ostringstream oStr; - - // - oStr << "****************** Demand characteristics ******************" - << std::endl; - oStr << "Arrival pattern (days from departure, proportion): "; - oStr << _arrivalPattern.displayCumulativeDistribution() << std::endl; - oStr << "POS probability mass (POS, propotion): "; - oStr << _posProbabilityMass.displayProbabilityMass() - << std::endl; - oStr << "Channel probability mass (channel, propotion): "; - oStr << _channelProbabilityMass.displayProbabilityMass() - << std::endl; - oStr << "Trip type probability mass (trip type, propotion): "; - oStr << _tripTypeProbabilityMass.displayProbabilityMass() - << std::endl; - oStr << "Stay duration probability mass (number of days, propotion): "; - oStr << _stayDurationProbabilityMass.displayProbabilityMass() - << std::endl; - oStr << "Frequent flyer probability mass (frequent flyer, propotion): "; - oStr << _frequentFlyerProbabilityMass.displayProbabilityMass() - << std::endl; - oStr << "Preferred departure time cumulative distribution (time, proportion: "; - oStr << _preferredDepartureTimeCumulativeDistribution.displayCumulativeDistribution() << std::endl; - oStr << "WTP cumulative distribution (WTP, proportion: "; - oStr << _wtpCumulativeDistribution.displayCumulativeDistribution() - << std::endl; - oStr << "Value of time cumulative distribution (value of time, proportion: "; - oStr << _valueOfTimeCumulativeDistribution.displayCumulativeDistribution() - << std::endl; - - - return oStr.str(); - } - -} - Deleted: trunk/stdair/stdair/basic/DemandCharacteristics.hpp =================================================================== --- trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,79 +0,0 @@ -#ifndef __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP -#define __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -// StdAir -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DemandCharacteristicTypes.hpp> -#include <stdair/bom/DemandStreamKey.hpp> - -namespace stdair { - - /** Class modeling the characteristics of a demand type. */ - struct DemandCharacteristics { - - public: - // ////////////// Display Support Methods ////////// - /** Display demand characteristics */ - std::string display() const; - - - public: - // ////////// Constructors and destructors ///////// - /** Default constructor. */ - DemandCharacteristics (const ArrivalPatternCumulativeDistribution_T&, - const POSProbabilityMassFunction_T&, - const ChannelProbabilityMassFunction_T&, - const TripTypeProbabilityMassFunction_T&, - const StayDurationProbabilityMassFunction_T&, - const FrequentFlyerProbabilityMassFunction_T&, - const PreferredDepartureTimeContinuousDistribution_T&, - const WTPContinuousDistribution_T&, - const ValueOfTimeContinuousDistribution_T&); - - /** Destructor */ - ~DemandCharacteristics (); - private: - /** Default constructor. */ - DemandCharacteristics (); - /** Copy constructor. */ - DemandCharacteristics (const DemandCharacteristics&); - - public: - // //////////////////// Attributes ///////////////////// - /** Arrival pattern (cumulative distribution of timing of arrival - of requests (negative number of days between departure date - and request date). */ - const ContinuousFloatDuration_T _arrivalPattern; - - /** POS probability mass. */ - const POSProbabilityMass_T _posProbabilityMass; - - /** Channel probability mass. */ - const ChannelProbabilityMass_T _channelProbabilityMass; - - /** Trip type probability mass */ - const TripTypeProbabilityMass_T _tripTypeProbabilityMass; - - /** Stay duration probability mass */ - const StayDurationProbabilityMass_T _stayDurationProbabilityMass; - - /** Frequent flyer probability mass */ - const FrequentFlyerProbabilityMass_T _frequentFlyerProbabilityMass; - - /** Preferred departure time cumulative distribution. */ - const PreferredDepartureTimeCumulativeDistribution_T _preferredDepartureTimeCumulativeDistribution; - - /** Willingness-to-pay cumulative distribution */ - const WTPCumulativeDistribution_T _wtpCumulativeDistribution; - - /** Value of time cumulative distribution. */ - const ValueOfTimeCumulativeDistribution_T _valueOfTimeCumulativeDistribution; - }; - -} -#endif // __STDAIR_BAS_DEMAND_CHARACTERISTICS_HPP Deleted: trunk/stdair/stdair/basic/DemandDistribution.cpp =================================================================== --- trunk/stdair/stdair/basic/DemandDistribution.cpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DemandDistribution.cpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,51 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -#include <sstream> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/DemandDistribution.hpp> - -namespace stdair { - - // ///////////////////////////////////////////////////// - DemandDistribution:: - DemandDistribution (const NbOfRequests_T& iMean, - const StandardDeviationValue_T& iStandardDeviation) - : _meanNumberOfRequests (iMean), - _standardDeviationNumberOfRequests (iStandardDeviation){ - } - - // ///////////////////////////////////////////////////// - DemandDistribution::DemandDistribution () { - } - - // ///////////////////////////////////////////////////// - DemandDistribution::~DemandDistribution () { - } - - // ///////////////////////////////////////////////////// - DemandDistribution:: - DemandDistribution (const DemandDistribution& iDemandDistribution) - : _meanNumberOfRequests (iDemandDistribution._meanNumberOfRequests), - _standardDeviationNumberOfRequests (iDemandDistribution._standardDeviationNumberOfRequests) { - } - - // ///////////////////////////////////////////////////// - std::string DemandDistribution::display() const { - std::ostringstream oStr; - - oStr << "****************** Demand distribution ******************" - << std::endl; - oStr << "Mean number of requests .......... : " - << _meanNumberOfRequests << std::endl; - oStr << "Std dev of number of requests .... : " - << _standardDeviationNumberOfRequests << std::endl; - - return oStr.str(); - } - -} - Deleted: trunk/stdair/stdair/basic/DemandDistribution.hpp =================================================================== --- trunk/stdair/stdair/basic/DemandDistribution.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DemandDistribution.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,44 +0,0 @@ -#ifndef __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP -#define __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/basic/ContinuousAttribute.hpp> - -namespace stdair { - - /** Class modeling the distribution of a demand type. */ - struct DemandDistribution { - - // ////////////// Display Support Methods ////////// - /** Display demand distribution */ - std::string display() const; - - - // ////////// Constructors and destructors ///////// - /** Constructor. */ - DemandDistribution (const NbOfRequests_T& iMean, - const StandardDeviationValue_T& iStandardDeviation); - /** Default constructor. */ - DemandDistribution (); - /** Copy constructor. */ - DemandDistribution (const DemandDistribution&); - /** Destructor. */ - ~DemandDistribution (); - - - // ////////// Attributes ////////// - /** Mean number of requests */ - NbOfRequests_T _meanNumberOfRequests; - - /** Standard deviation of number of requests */ - StandardDeviationValue_T _standardDeviationNumberOfRequests; - }; - -} -#endif // __STDAIR_BAS_DEMAND_DISTRIBUTION_HPP Deleted: trunk/stdair/stdair/basic/DictionaryManager.cpp =================================================================== --- trunk/stdair/stdair/basic/DictionaryManager.cpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DictionaryManager.cpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,21 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/basic/DictionaryManager.hpp> - -namespace stdair { - // //////////////////////////////////////////////////////////////////// - const Probability_T DictionaryManager::keyToValue(const DictionaryKey_T iKey) { - return static_cast<Probability_T>(iKey) / 200; - } - - // //////////////////////////////////////////////////////////////////// - const DictionaryKey_T DictionaryManager:: - valueToKey (const Probability_T iValue) { - return iValue * 200; - } - - // DEBUG - unsigned int COUNT = 0; -} Deleted: trunk/stdair/stdair/basic/DictionaryManager.hpp =================================================================== --- trunk/stdair/stdair/basic/DictionaryManager.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/DictionaryManager.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,25 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -#ifndef __STDAIR_BOM_DICTIONARYMANAGER_HPP -#define __STDAIR_BOM_DICTIONARYMANAGER_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/STDAIR_Types.hpp> - -namespace stdair { - - /** Class wrapper of dictionary business methods. */ - class DictionaryManager { - public: - // //////////// Business methods ///////////////// - /** Convert from key to value. */ - static const Probability_T keyToValue (const DictionaryKey_T); - - /** Convert from value to key. */ - static const DictionaryKey_T valueToKey (const Probability_T); - - }; -} -#endif // __STDAIR_BOM_DICTIONARYMANAGER_HPP Deleted: trunk/stdair/stdair/basic/RandomGeneration.cpp =================================================================== --- trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,72 +0,0 @@ -// STL -#include <cassert> -#include <iostream> -// Boost -#include <boost/version.hpp> -#if BOOST_VERSION >= 103500 -#include <boost/math/distributions/normal.hpp> -#endif // BOOST_VERSION >= 103500 -//STDAIR -#include <stdair/basic/RandomGeneration.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - RandomGeneration::RandomGeneration (const RandomSeed_T& iSeed) - : _seed (iSeed), _generator (iSeed), - _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) { - init (); - } - - // ////////////////////////////////////////////////////////////////////// - RandomGeneration::RandomGeneration (const RandomGeneration& iRandomGeneration) - : _seed (iRandomGeneration._seed), - _generator (iRandomGeneration._generator), - _uniformGenerator (iRandomGeneration._uniformGenerator) { - } - - // ////////////////////////////////////////////////////////////////////// - RandomGeneration::RandomGeneration () - : _seed (0), _generator (0), - _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) { - assert (false); - } - - // ////////////////////////////////////////////////////////////////////// - RandomGeneration::~RandomGeneration () { - } - - // ////////////////////////////////////////////////////////////////////// - void RandomGeneration::init () { - } - - // ////////////////////////////////////////////////////////////////////// - RealNumber_T RandomGeneration::generateUniform01 () { - const RealNumber_T lVariateUnif = _uniformGenerator(); - return lVariateUnif; - } - - // ////////////////////////////////////////////////////////////////////// - RealNumber_T RandomGeneration:: - generateUniform (const RealNumber_T& iMinValue, const RealNumber_T& iMaxValue){ - const RealNumber_T lVariateUnif = - iMinValue + _uniformGenerator() * (iMaxValue - iMinValue); - return lVariateUnif; - } - - // ////////////////////////////////////////////////////////////////////// - RealNumber_T RandomGeneration:: - generateNormal (const RealNumber_T& mu, const RealNumber_T& sigma) { -#if BOOST_VERSION >= 103500 - const Probability_T lVariateUnif = generateUniform01 (); - const boost::math::normal lNormal (mu, sigma); - const RealNumber_T lRealNumberOfRequestsToBeGenerated = - boost::math::quantile(lNormal, lVariateUnif); -#else // BOOST_VERSION >= 103500 - // TODO: rely on GSL when Boost version smaller than 1.35 - const RealNumber_T lRealNumberOfRequestsToBeGenerated = 0.0; -#endif // BOOST_VERSION >= 103500 - - return lRealNumberOfRequestsToBeGenerated; - } -} Deleted: trunk/stdair/stdair/basic/RandomGeneration.hpp =================================================================== --- trunk/stdair/stdair/basic/RandomGeneration.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/RandomGeneration.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,64 +0,0 @@ -#ifndef __STDAIR_BAS_BOM_RANDOMGENERATION_HPP -#define __STDAIR_BAS_BOM_RANDOMGENERATION_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// Boost Random -#include <boost/random/uniform_real.hpp> -#include <boost/random/variate_generator.hpp> -// STDAIR -#include <stdair/STDAIR_Types.hpp> - -namespace stdair { - - /** Random generator. */ - struct RandomGeneration { - // //////////// Business Methods ///////////// - /** Generate a randomized number following a uniform distribution - between 0 (included) and 1 (excluded). */ - RealNumber_T generateUniform01 (); - - /** Generate a randomized number following a uniform distribution - between a minimum (included) and a maximum (excluded) - value. */ - RealNumber_T generateUniform (const RealNumber_T&, const RealNumber_T&); - - /** Generate a randomized number following a normal distribution - specified by a mean and a standard deviation. */ - RealNumber_T generateNormal (const RealNumber_T&, const RealNumber_T&); - - // ////////// Constructors and destructors ///////// - /** Constructor. */ - RandomGeneration (const RandomSeed_T&); - /** Default constructors. */ - RandomGeneration (); - RandomGeneration (const RandomGeneration&); - /** Destructor. */ - ~RandomGeneration (); - /** Initialize the random generator. - <br>A uniform random number distribution is defined, which - produces "real" values between 0 and 1 (0 inclusive, 1 - exclusive). */ - void init (); - - // ////////// Attributes ////////// - /** The seed of the random generator. - <br>The seed is unsigned, otherwise the wrong overload may be - selected when using mt19937 as the boost::base_generator_type. */ - RandomSeed_T _seed; - - /** Random number generator engine. - <br>The random number generator is currently based on boost::minstd_rand. - Alternates are boost::mt19937, boost::ecuyer1988. */ - BaseGenerator_T _generator; - - /** Random number generator. - <br>It is initialized with a reproducible seed and a uniform - distribution. */ - boost::variate_generator<BaseGenerator_T&, - boost::uniform_real<> > _uniformGenerator; - }; - -} -#endif // __STDAIR_BAS_BOM_RANDOMGENERATION_HPP Deleted: trunk/stdair/stdair/basic/RandomGenerationContext.cpp =================================================================== --- trunk/stdair/stdair/basic/RandomGenerationContext.cpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/RandomGenerationContext.cpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,38 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <iosfwd> -// STDAIR -#include <stdair/basic/RandomGenerationContext.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - RandomGenerationContext::RandomGenerationContext () - : _cumulativeProbabilitySoFar (0.0), - _numberOfRequestsGeneratedSoFar (0) { - } - - // ////////////////////////////////////////////////////////////////////// - RandomGenerationContext::RandomGenerationContext (const RandomGenerationContext& iRandomGenerationContext) - : _cumulativeProbabilitySoFar (iRandomGenerationContext._cumulativeProbabilitySoFar), - _numberOfRequestsGeneratedSoFar (iRandomGenerationContext._numberOfRequestsGeneratedSoFar) { - } - - // ////////////////////////////////////////////////////////////////////// - RandomGenerationContext::~RandomGenerationContext () { - } - - // ////////////////////////////////////////////////////////////////////// - void RandomGenerationContext::incrementGeneratedRequestsCounter () { - ++_numberOfRequestsGeneratedSoFar; - } - - // ////////////////////////////////////////////////////////////////////// - void RandomGenerationContext::reset () { - _cumulativeProbabilitySoFar = 0.0; - _numberOfRequestsGeneratedSoFar = 0; - } - -} Deleted: trunk/stdair/stdair/basic/RandomGenerationContext.hpp =================================================================== --- trunk/stdair/stdair/basic/RandomGenerationContext.hpp 2010-08-20 10:40:49 UTC (rev 272) +++ trunk/stdair/stdair/basic/RandomGenerationContext.hpp 2010-08-20 14:53:57 UTC (rev 273) @@ -1,43 +0,0 @@ -#ifndef __STDAIR_BAS_RANDOM_GENERATION_CONTEXT_HPP -#define __STDAIR_BAS_RANDOM_GENERATION_CONTEXT_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <iosfwd> -// STDAIR -#include <stdair/STDAIR_Types.hpp> - -namespace stdair { - - /** Structure holding the context necessary for demand random generation. */ - struct RandomGenerationContext { - - // ////////// Constructors and destructors ///////// - /** Constructor by default */ - RandomGenerationContext (); - /** Default constructors. */ - RandomGenerationContext (const RandomGenerationContext&); - /** Destructor */ - ~RandomGenerationContext (); - - // /////////////// Business Methods ////////// - /** Increment counter of requests generated so far */ - void incrementGeneratedRequestsCounter (); - - /** Reset the counters. */ - void reset (); - - // ////////// Attributes ////////// - /** Cumulative probability in arrival pattern for last request - generated so far (needed for sequential generat... [truncated message content] |
From: <den...@us...> - 2010-08-20 17:46:43
|
Revision: 276 http://stdair.svn.sourceforge.net/stdair/?rev=276&view=rev Author: denis_arnaud Date: 2010-08-20 17:46:36 +0000 (Fri, 20 Aug 2010) Log Message: ----------- [Dev] Added a full example for BOM tree construction. Modified Paths: -------------- trunk/stdair/stdair/batches/stdair.cpp trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightPeriod.cpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/LegCabin.cpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/OptimizerStruct.cpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentPeriod.cpp Modified: trunk/stdair/stdair/batches/stdair.cpp =================================================================== --- trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/batches/stdair.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -17,6 +17,18 @@ #include <stdair/bom/BomRoot.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/LegDate.hpp> +#include <stdair/bom/LegDateTypes.hpp> +#include <stdair/bom/LegCabin.hpp> +#include <stdair/bom/LegCabinTypes.hpp> +#include <stdair/bom/SegmentDate.hpp> +#include <stdair/bom/SegmentDateTypes.hpp> +#include <stdair/bom/SegmentCabin.hpp> +#include <stdair/bom/SegmentCabinTypes.hpp> +#include <stdair/bom/BookingClass.hpp> +#include <stdair/bom/BookingClassTypes.hpp> #include <stdair/factory/FacBomManager.hpp> #include <stdair/service/Logger.hpp> #include <stdair/config/stdair-paths.hpp> @@ -32,7 +44,8 @@ input file. That latter must then be given with the -i option. */ const bool K_STDAIR_DEFAULT_BUILT_IN_INPUT = false; -/** Early return status (so that it can be differentiated from an error). */ +/** Early return status (so that it can be differentiated from an + error). */ const int K_STDAIR_EARLY_RETURN_STATUS = 99; // ///////// Parsing of Options & Configuration ///////// @@ -144,28 +157,332 @@ // DEBUG STDAIR_LOG_DEBUG ("StdAir will build the BOM tree from built-in specifications."); - // Create the bom root. + // ///////////// Step 0.0: Initialisation //////////// + // Create the root of the Bom tree (i.e., a BomRoot object) stdair::BomRoot& lBomRoot = stdair::FacBom<stdair::BomRoot>::instance().create(); - // Create the inventories. + // Step 0.1: Inventory level + // Create an Inventory for BA stdair::InventoryKey lBAKey ("BA"); stdair::Inventory& lBAInv = stdair::FacBom<stdair::Inventory>::instance().create (lBAKey); stdair::FacBomManager::addToList (lBomRoot, lBAInv); + + // Create an Inventory for AF stdair::InventoryKey lAFKey ("AF"); stdair::Inventory& lAFInv = stdair::FacBom<stdair::Inventory>::instance().create (lAFKey); stdair::FacBomManager::addToList (lBomRoot, lAFInv); - // Display the BOM root. + // ////// BA /////// + // Step 0.2: Flight-date level + // Create a FlightDate (BA15/10-JUN-2010) for BA's Inventory + stdair::FlightNumber_T lFlightNumber = 15; + stdair::Date_T lDate (2010, 6, 10); + stdair::FlightDateKey lFlightDateKey (lFlightNumber, lDate); + + stdair::FlightDate& lBA15_20100610_FD = + stdair::FacBom<stdair::FlightDate>::instance().create (lFlightDateKey); + stdair::FacBomManager::addToList (lBAInv, lBA15_20100610_FD); + + // Display the flight-date + // STDAIR_LOG_DEBUG ("FlightDate: " << lBA15_20100610_FD.toString()); + + // Step 0.3: Segment-date level + // Create a first SegmentDate (LHR-SYD) for BA's Inventory + const stdair::AirportCode_T lLHR ("LHR"); + const stdair::AirportCode_T lSYD ("SYD"); + stdair::SegmentDateKey lSegmentDateKey (lLHR, lSYD); + + stdair::SegmentDate& lLHRSYDSegment = + stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey); + stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRSYDSegment); + + // Display the segment-date + // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRSYDSegment.toString()); + + // Create a second SegmentDate (LHR-BKK) for BA's Inventory + const stdair::AirportCode_T lBKK ("BKK"); + lSegmentDateKey = stdair::SegmentDateKey (lLHR, lBKK); + + stdair::SegmentDate& lLHRBKKSegment = + stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey); + stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRBKKSegment); + + // Display the segment-date + // STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRBKKSegment.toString()); + + + // Create a third SegmentDate (BKK-SYD) for BA's Inventory + lSegmentDateKey = stdair::SegmentDateKey (lBKK, lSYD); + + stdair::SegmentDate& lBKKSYDSegment = + stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey); + stdair::FacBomManager::addToList (lBA15_20100610_FD, lBKKSYDSegment); + + // Display the segment-date + // STDAIR_LOG_DEBUG ("SegmentDate: " << lBKKSYDSegment.toString()); + + // Step 0.4: Leg-date level + // Create a first LegDate (LHR) for BA's Inventory + stdair::LegDateKey lLegDateKey (lLHR); + + stdair::LegDate& lLHRLeg = + stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey); + stdair::FacBomManager::addToList (lBA15_20100610_FD, lLHRLeg); + + // Display the leg-date + // STDAIR_LOG_DEBUG ("LegDate: " << lLHRLeg.toString()); + + // Create a second LegDate (BKK) + lLegDateKey = stdair::LegDateKey (lBKK); + + stdair::LegDate& lBKKLeg = + stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey); + stdair::FacBomManager::addToList (lBA15_20100610_FD, lBKKLeg); + + // Display the leg-date + // STDAIR_LOG_DEBUG ("LegDate: " << lBKKLeg.toString()); + + // Step 0.5: segment-cabin level + // Create a SegmentCabin (Y) for the Segment LHR-BKK of BA's Inventory + const stdair::CabinCode_T lY ("Y"); + stdair::SegmentCabinKey lYSegmentCabinKey (lY); + + stdair::SegmentCabin& lLHRBKKSegmentYCabin = + stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey); + stdair::FacBomManager::addToList (lLHRBKKSegment, lLHRBKKSegmentYCabin); + + // Display the segment-cabin + // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRBKKSegmentYCabin.toString()); + + // Create a SegmentCabin (Y) of the Segment BKK-SYD; + stdair::SegmentCabin& lBKKSYDSegmentYCabin = + stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey); + stdair::FacBomManager::addToList (lBKKSYDSegment, lBKKSYDSegmentYCabin); + + // Display the segment-cabin + // STDAIR_LOG_DEBUG ("SegmentCabin: " << lBKKSYDSegmentYCabin.toString()); + + // Create a SegmentCabin (Y) of the Segment LHR-SYD; + stdair::SegmentCabin& lLHRSYDSegmentYCabin = + stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey); + stdair::FacBomManager::addToList (lLHRSYDSegment, lLHRSYDSegmentYCabin); + + // Display the segment-cabin + // STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRSYDSegmentYCabin.toString()); + + // Step 0.6: leg-cabin level + // Create a LegCabin (Y) for the Leg LHR-BKK on BA's Inventory + stdair::LegCabinKey lYLegCabinKey (lY); + + stdair::LegCabin& lLHRLegYCabin = + stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey); + stdair::FacBomManager::addToList (lLHRLeg, lLHRLegYCabin); + + // Display the leg-cabin + // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString()); + + // Create a LegCabin (Y) for the Leg BKK-SYD + stdair::LegCabin& lBKKLegYCabin = + stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey); + stdair::FacBomManager::addToList (lBKKLeg, lBKKLegYCabin); + + // Display the leg-cabin + // STDAIR_LOG_DEBUG ("LegCabin: " << lBKKLegYCabin.toString()); + + // Step 0.7: booking class level + // Create a BookingClass (Q) for the Segment LHR-BKK, cabin Y on BA's Inv + const stdair::ClassCode_T lQ ("Q"); + stdair::BookingClassKey lQBookingClassKey (lQ); + + stdair::BookingClass& lLHRBKKSegmentYCabinQClass = + stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey); + stdair::FacBomManager::addToList (lLHRBKKSegmentYCabin, + lLHRBKKSegmentYCabinQClass); + + // Display the booking class + // STDAIR_LOG_DEBUG ("BookingClass: " + // << lLHRBKKSegmentYCabinQClass.toString()); + + // Create a BookingClass (Q) for the Segment BKK-LHR, cabin Y + stdair::BookingClass& lBKKSYDSegmentYCabinQClass = + stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey); + stdair::FacBomManager::addToList (lBKKSYDSegmentYCabin, + lBKKSYDSegmentYCabinQClass); + + // Display the booking class + // STDAIR_LOG_DEBUG ("BookingClass: " + // << lLHRBKKSegmentYCabinQClass.toString()); + + // Create a BookingClass (Q) for the Segment LHR-SYD, cabin Y + stdair::BookingClass& lLHRSYDSegmentYCabinQClass = + stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey); + stdair::FacBomManager::addToList (lLHRSYDSegmentYCabin, + lLHRSYDSegmentYCabinQClass); + + // Display the booking class + // STDAIR_LOG_DEBUG ("BookingClass: " + // << lLHRBKKSegmentYCabinQClass.toString()); + + + // ////// AF /////// + // Step 0.2: Flight-date level + // Create a FlightDate (AF102/20-MAR-2010) for AF's Inventory + lFlightNumber = 102; + lDate = stdair::Date_T (2010, 3, 20); + lFlightDateKey = stdair::FlightDateKey (lFlightNumber, lDate); + + stdair::FlightDate& lAF102_20100320_FD = + stdair::FacBom<stdair::FlightDate>::instance().create (lFlightDateKey); + stdair::FacBomManager::addToList (lAFInv, lAF102_20100320_FD); + + // Display the flight-date + // STDAIR_LOG_DEBUG ("FlightDate: " << lAF102_20100320_FD.toString()); + + // Step 0.3: Segment-date level + // Create a SegmentDate (CDG-SFO) for AF's Inventory + const stdair::AirportCode_T lCDG ("CDG"); + const stdair::AirportCode_T lSFO ("SFO"); + lSegmentDateKey = stdair::SegmentDateKey (lCDG, lSFO); + + stdair::SegmentDate& lCDGSFOSegment = + stdair::FacBom<stdair::SegmentDate>::instance().create (lSegmentDateKey); + stdair::FacBomManager::addToList (lAF102_20100320_FD, lCDGSFOSegment); + + // Display the segment-date + // STDAIR_LOG_DEBUG ("SegmentDate: " << lCDGSFOSegment.toString()); + + // Step 0.4: Leg-date level + // Create a LegDate (CDG) for AF's Inventory + lLegDateKey = stdair::LegDateKey (lCDG); + + stdair::LegDate& lCDGLeg = + stdair::FacBom<stdair::LegDate>::instance().create (lLegDateKey); + stdair::FacBomManager::addToList (lAF102_20100320_FD, lCDGLeg); + + // Display the leg-date + // STDAIR_LOG_DEBUG ("LegDate: " << lCDGLeg.toString()); + + // Step 0.5: segment-cabin level + // Create a SegmentCabin (Y) for the Segment CDG-SFO of AF's Inventory + stdair::SegmentCabin& lCDGSFOSegmentYCabin = + stdair::FacBom<stdair::SegmentCabin>::instance().create(lYSegmentCabinKey); + stdair::FacBomManager::addToList (lCDGSFOSegment, lCDGSFOSegmentYCabin); + + // Display the segment-cabin + // STDAIR_LOG_DEBUG ("SegmentCabin: " << lCDGSFOSegmentYCabin.toString()); + + // Step 0.6: leg-cabin level + // Create a LegCabin (Y) for the Leg CDG-SFO on AF's Inventory + stdair::LegCabin& lCDGLegYCabin = + stdair::FacBom<stdair::LegCabin>::instance().create (lYLegCabinKey); + stdair::FacBomManager::addToList (lCDGLeg, lCDGLegYCabin); + + // Display the leg-cabin + // STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString()); + + // Step 0.7: booking class level + // Create a BookingClass (Q) for the Segment CDG-SFO, cabin Y on AF's Inv + stdair::BookingClass& lCDGSFOSegmentYCabinQClass = + stdair::FacBom<stdair::BookingClass>::instance().create(lQBookingClassKey); + stdair::FacBomManager::addToList (lCDGSFOSegmentYCabin, + lCDGSFOSegmentYCabinQClass); + + // Display the booking class + // STDAIR_LOG_DEBUG ("BookingClass: " + // << lCDGSFOSegmentYCabinQClass.toString()); + + + // /////////// Step 1.0: Display the BOM tree ////////// + // 1.1. Inventory level const stdair::InventoryList_T& lInventoryList = stdair::BomManager::getList<stdair::Inventory> (lBomRoot); for (stdair::InventoryList_T::const_iterator itInv = lInventoryList.begin(); itInv != lInventoryList.end(); ++itInv) { const stdair::Inventory* lInv_ptr = *itInv; assert (lInv_ptr != NULL); + + // STDAIR_LOG_DEBUG ("Inventory: " << lInv_ptr->describeKey()); STDAIR_LOG_DEBUG (lInv_ptr->describeKey()); + + // 1.2. FlightDate level + const stdair::FlightDateList_T& lFlightDateList = + stdair::BomManager::getList<stdair::FlightDate> (*lInv_ptr); + for (stdair::FlightDateList_T::const_iterator itFD=lFlightDateList.begin(); + itFD != lFlightDateList.end(); ++itFD) { + const stdair::FlightDate* lFD_ptr = *itFD; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("FlightDate: " << lFD_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lFD_ptr->toString()); + + // 1.4. LegDate level + const stdair::LegDateList_T& lLegDateList = + stdair::BomManager::getList<stdair::LegDate> (*lFD_ptr); + for (stdair::LegDateList_T::const_iterator itLD = + lLegDateList.begin(); + itLD != lLegDateList.end(); ++itLD) { + const stdair::LegDate* lLD_ptr = *itLD; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("LegDate: " << lLD_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lLD_ptr->toString()); + + // 1.6. LegCabin level + const stdair::LegCabinList_T& lLegCabinList = + stdair::BomManager::getList<stdair::LegCabin> (*lLD_ptr); + for (stdair::LegCabinList_T::const_iterator itLC = + lLegCabinList.begin(); + itLC != lLegCabinList.end(); ++itLC) { + const stdair::LegCabin* lLC_ptr = *itLC; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("LegCabin: " << lLC_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lLC_ptr->toString()); + } + } + + // 1.3. SegmentDate level + const stdair::SegmentDateList_T& lSegmentDateList = + stdair::BomManager::getList<stdair::SegmentDate> (*lFD_ptr); + for (stdair::SegmentDateList_T::const_iterator itSD = + lSegmentDateList.begin(); + itSD != lSegmentDateList.end(); ++itSD) { + const stdair::SegmentDate* lSD_ptr = *itSD; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("SegmentDate: " << lSD_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lSD_ptr->toString()); + + // 1.5. SegmentCabin level + const stdair::SegmentCabinList_T& lSegmentCabinList = + stdair::BomManager::getList<stdair::SegmentCabin> (*lSD_ptr); + for (stdair::SegmentCabinList_T::const_iterator itSC = + lSegmentCabinList.begin(); + itSC != lSegmentCabinList.end(); ++itSC) { + const stdair::SegmentCabin* lSC_ptr = *itSC; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("SegmentCabin: " << lSC_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lSC_ptr->toString()); + + // 1.7. BookingClass level + const stdair::BookingClassList_T& lBookingClassList = + stdair::BomManager::getList<stdair::BookingClass> (*lSC_ptr); + for (stdair::BookingClassList_T::const_iterator itBC = + lBookingClassList.begin(); + itBC != lBookingClassList.end(); ++itBC) { + const stdair::BookingClass* lBC_ptr = *itBC; + assert (lFD_ptr != NULL); + + // STDAIR_LOG_DEBUG ("BookingClass: " << lBC_ptr->toString()); + STDAIR_LOG_DEBUG (" " << lBC_ptr->toString()); + } + } + } + } } } catch (const std::exception& stde) { Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -21,9 +21,7 @@ // //////////////////////////////////////////////////////////////////// std::string BookingClass::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -20,9 +20,7 @@ // //////////////////////////////////////////////////////////////////// std::string FlightDate::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/FlightPeriod.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightPeriod.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/FlightPeriod.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -20,9 +20,7 @@ // //////////////////////////////////////////////////////////////////// std::string FlightPeriod::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/Inventory.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -19,7 +19,7 @@ // //////////////////////////////////////////////////////////////////// std::string Inventory::toString() const { std::ostringstream oStr; - oStr << _key.toString(); + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/LegCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/LegCabin.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -30,7 +30,7 @@ // //////////////////////////////////////////////////////////////////// std::string LegCabin::toString() const { std::ostringstream oStr; - oStr << describeKey() << std::endl; + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/LegDate.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -23,9 +23,7 @@ // //////////////////////////////////////////////////////////////////// std::string LegDate::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/OptimizerStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -9,6 +9,7 @@ #include <stdair/bom/OptimizerStruct.hpp> namespace stdair { + // /////////////////////////////////////////////////////////////////// OptimizerStruct_T::OptimizerStruct_T () { } Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -29,9 +29,7 @@ // //////////////////////////////////////////////////////////////////// std::string SegmentCabin::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -21,9 +21,7 @@ // //////////////////////////////////////////////////////////////////// std::string SegmentDate::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } Modified: trunk/stdair/stdair/bom/SegmentPeriod.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPeriod.cpp 2010-08-20 15:30:16 UTC (rev 275) +++ trunk/stdair/stdair/bom/SegmentPeriod.cpp 2010-08-20 17:46:36 UTC (rev 276) @@ -21,9 +21,7 @@ // //////////////////////////////////////////////////////////////////// std::string SegmentPeriod::toString() const { std::ostringstream oStr; - - oStr << describeKey() << std::endl; - + oStr << describeKey(); return oStr.str(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-08-24 16:56:30
|
Revision: 280 http://stdair.svn.sourceforge.net/stdair/?rev=280&view=rev Author: quannaus Date: 2010-08-24 16:56:23 +0000 (Tue, 24 Aug 2010) Log Message: ----------- [dev] added the detailed list to RelationShip. Modified Paths: -------------- trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/RelationShip.hpp trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp trunk/stdair/stdair/factory/FacBomManager.hpp Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 14:57:23 UTC (rev 279) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-08-24 16:56:23 UTC (rev 280) @@ -18,12 +18,16 @@ template <typename CHILD, typename PARENT> static std::list<CHILD*>& getList (const PARENT&); template <typename CHILD, typename PARENT> + static std::list<std::pair<MapKey_T, CHILD*> >& getDetailedList (const PARENT&); + template <typename CHILD, typename PARENT> static std::map<const MapKey_T, CHILD*>& getMap (const PARENT&); /** Check if the list/map of children has been initialised. */ template <typename CHILD, typename PARENT> static bool hasList (const PARENT&); template <typename CHILD, typename PARENT> + static bool hasDetailedList (const PARENT&); + template <typename CHILD, typename PARENT> static bool hasMap (const PARENT&); /** Getter of the PARENT given the CHILD. */ @@ -47,6 +51,14 @@ } // //////////////////////////////////////////////////////////////////// + template <typename CHILD, typename PARENT> + std::list<std::pair<MapKey_T, CHILD*> >& BomManager:: + getDetailedList (const PARENT& iParent) { + return RelationShip<PARENT, CHILD>:: + instance().getChildrenDetailedList (iParent); + } + + // //////////////////////////////////////////////////////////////////// template <typename CHILD, typename PARENT> std::map<const MapKey_T, CHILD*>& BomManager::getMap (const PARENT& iParent) { return RelationShip<PARENT, CHILD>::instance().getChildrenMap (iParent); @@ -60,6 +72,13 @@ // //////////////////////////////////////////////////////////////////// template <typename CHILD, typename PARENT> + bool BomManager::hasDetailedList (const PARENT& iParent) { + return RelationShip<PARENT, CHILD>:: + instance().hasChildrenDetailedList (iParent); + } + + // //////////////////////////////////////////////////////////////////// + template <typename CHILD, typename PARENT> bool BomManager::hasMap (const PARENT& iParent) { return RelationShip<PARENT, CHILD>::instance().hasChildrenMap (iParent); } Modified: trunk/stdair/stdair/bom/RelationShip.hpp =================================================================== --- trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 14:57:23 UTC (rev 279) +++ trunk/stdair/stdair/bom/RelationShip.hpp 2010-08-24 16:56:23 UTC (rev 280) @@ -27,8 +27,11 @@ // ////////////////////////////////////////////////////////////////// // Internal type definitions. typedef std::list<CHILD*> ChildrenList_T; + typedef std::list<std::pair<MapKey_T, CHILD*> > ChildrenDetailedList_T; typedef std::map<const MapKey_T, CHILD*> ChildrenMap_T; typedef std::map<const PARENT*, ChildrenList_T> ParentChildrentList_T; + typedef std::map<const PARENT*, + ChildrenDetailedList_T> ParentChildrentDetailedList_T; typedef std::map<const PARENT*, ChildrenMap_T> ParentChildrentMap_T; typedef std::map<const CHILD*, PARENT*> ChildParentMap_T; // ////////////////////////////////////////////////////////////////// @@ -43,6 +46,7 @@ // ////////////////////// Business Methods ///////////////////////// /** Getter of the children conainter given the PARENT pointer. */ ChildrenList_T& getChildrenList (const PARENT&); + ChildrenDetailedList_T& getChildrenDetailedList (const PARENT&); ChildrenMap_T& getChildrenMap (const PARENT&); /** Getter of the PARENT given the CHILD. */ @@ -57,11 +61,13 @@ /** Check if the list/map of children has been initialised. */ bool hasChildrenList (const PARENT&); + bool hasChildrenDetailedList (const PARENT&); bool hasChildrenMap (const PARENT&); private: /** Add the given CHILD to the children containter of the given PARENT. */ void addChildToTheList (const PARENT&, CHILD&); + void addChildToTheDetailedList (const PARENT&, CHILD&, const MapKey_T&); void addChildToTheMap (const PARENT&, CHILD&); void addChildToTheMap (const PARENT&, CHILD&, const MapKey_T&); @@ -79,6 +85,7 @@ static RelationShip* _instance; /** The containers of relation ships. */ ParentChildrentList_T _parentChildrenList; + ParentChildrentDetailedList_T _parentChildrenDetailedList; ParentChildrentMap_T _parentChildrenMap; ChildParentMap_T _childParentMap; }; @@ -117,6 +124,24 @@ // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> + typename RelationShip<PARENT, CHILD>::ChildrenDetailedList_T& + RelationShip<PARENT, CHILD>::getChildrenDetailedList (const PARENT& iParent) { + ParentChildrentDetailedList_T& lParentChildrenDetailedList = + instance()._parentChildrenDetailedList; + typename ParentChildrentDetailedList_T::iterator itDetailedList = + lParentChildrenDetailedList.find (&iParent); + + if (itDetailedList == lParentChildrenDetailedList.end()) { + STDAIR_LOG_ERROR ("Cannot find the detailed list within: " + << iParent.describeKey()); + throw NonInitialisedContainerException (); + } + + return itDetailedList->second; + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> typename RelationShip<PARENT, CHILD>::ChildrenMap_T& RelationShip<PARENT, CHILD>::getChildrenMap (const PARENT& iParent) { ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap; @@ -146,6 +171,20 @@ // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>:: + hasChildrenDetailedList (const PARENT& iParent) { + ParentChildrentDetailedList_T& lParentChildrenDetailedList = + instance()._parentChildrenDetailedList; + typename ParentChildrentDetailedList_T::iterator itDetailedList = + lParentChildrenDetailedList.find (&iParent); + + if (itDetailedList == lParentChildrenDetailedList.end()) { + return false; + } + return true; + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> bool RelationShip<PARENT, CHILD>:: hasChildrenMap (const PARENT& iParent) { ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap; typename ParentChildrentMap_T::iterator itMap = @@ -225,6 +264,16 @@ // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>:: + addChildToTheDetailedList (const PARENT& iParent, CHILD& ioChild, + const MapKey_T& iKey) { + ParentChildrentDetailedList_T& lParentChildrenDetailedList = + instance()._parentChildrenDetailedList; + lParentChildrenDetailedList[&iParent]. + push_back (std::pair<const MapKey_T, CHILD*> (iKey, &ioChild)); + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> void RelationShip<PARENT, CHILD>:: addChildToTheMap (const PARENT& iParent, CHILD& ioChild) { ParentChildrentMap_T& lParentChildrenMap = instance()._parentChildrenMap; Modified: trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp 2010-08-24 14:57:23 UTC (rev 279) +++ trunk/stdair/stdair/bom/SegmentPeriodTypes.hpp 2010-08-24 16:56:23 UTC (rev 280) @@ -20,7 +20,11 @@ typedef std::list<SegmentPeriod*> SegmentPeriodList_T; /** Define the segment-period map. */ - typedef std::map<const MapKey_T&, SegmentPeriod*> SegmentPeriodMap_T; + typedef std::map<const MapKey_T, SegmentPeriod*> SegmentPeriodMap_T; + + /** Define the list of pair<MapKey_T, SegmentPeriod>. */ + typedef std::pair<MapKey_T, SegmentPeriod*> SegmentPeriodWithKey_T; + typedef std::list<SegmentPeriodWithKey_T> SegmentPeriodDetailedList_T; } #endif // __STDAIR_BOM_SEGMENTPERIODTYPES_HPP Modified: trunk/stdair/stdair/factory/FacBomManager.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomManager.hpp 2010-08-24 14:57:23 UTC (rev 279) +++ trunk/stdair/stdair/factory/FacBomManager.hpp 2010-08-24 16:56:23 UTC (rev 280) @@ -23,6 +23,8 @@ template <typename PARENT, typename CHILD> static void addToList (const PARENT&, CHILD&); template <typename PARENT, typename CHILD> + static void addToDetailedList (const PARENT&, CHILD&, const MapKey_T&); + template <typename PARENT, typename CHILD> static void addToMap (const PARENT&, CHILD&); template <typename PARENT, typename CHILD> static void addToMap (const PARENT&, CHILD&, const MapKey_T&); @@ -37,7 +39,7 @@ /** Clone the list of children between two objects. */ template <typename CHILD, typename PARENT> - static void cloneChildrenList (const PARENT&, const PARENT&); + static void cloneChildrenDetailedList (const PARENT&, const PARENT&); }; @@ -55,6 +57,15 @@ // //////////////////////////////////////////////////////////////////// template <typename PARENT, typename CHILD> void FacBomManager:: + addToDetailedList (const PARENT& iParent, CHILD& ioChild, + const MapKey_T& iKey) { + RelationShip<PARENT, CHILD>::instance().addChildToTheDetailedList (iParent, + ioChild, + iKey); + } + + // //////////////////////////////////////////////////////////////////// + template <typename PARENT, typename CHILD> void FacBomManager:: addToMap (const PARENT& iParent, CHILD& ioChild) { RelationShip<PARENT, CHILD>::instance().addChildToTheMap (iParent, ioChild); } @@ -89,10 +100,10 @@ // //////////////////////////////////////////////////////////////////// template <typename CHILD, typename PARENT> void FacBomManager:: - cloneChildrenList (const PARENT& iP1, const PARENT& iP2) { - const std::list<CHILD*>& lList = - RelationShip<PARENT, CHILD>::instance().getChildrenList (iP2); - RelationShip<PARENT, CHILD>::instance()._parentChildrenList[&iP1] = lList; + cloneChildrenDetailedList (const PARENT& iP1, const PARENT& iP2) { + const std::list<std::pair<MapKey_T, CHILD*> >& lDetailedList = + RelationShip<PARENT, CHILD>::instance().getChildrenDetailedList (iP2); + RelationShip<PARENT, CHILD>::instance()._parentChildrenDetailedList[&iP1] = lDetailedList; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-10-13 13:28:27
|
Revision: 341 http://stdair.svn.sourceforge.net/stdair/?rev=341&view=rev Author: quannaus Date: 2010-10-13 13:28:20 +0000 (Wed, 13 Oct 2010) Log Message: ----------- [dev] Added the default constructor for STDAIR_Service (with out logger and dbssession initialisation). Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Service.hpp trunk/stdair/stdair/service/STDAIR_Service.cpp Modified: trunk/stdair/stdair/STDAIR_Service.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Service.hpp 2010-10-04 09:11:49 UTC (rev 340) +++ trunk/stdair/stdair/STDAIR_Service.hpp 2010-10-13 13:28:20 UTC (rev 341) @@ -32,6 +32,11 @@ public: // ////////// Constructors and destructors ////////// /** + * @brief Default constructor. + */ + STDAIR_Service (); + + /** * @brief Constructor. * <br>The init() method is called; see the corresponding * documentation for more details. @@ -73,11 +78,6 @@ private: // /////// Construction and Destruction helper methods /////// /** - * @brief Default constructor. - */ - STDAIR_Service (); - - /** * @brief Default copy constructor. * @param[in] const STDAIR_Service& Reference on the STDAIR_Service handler * to be copied. Modified: trunk/stdair/stdair/service/STDAIR_Service.cpp =================================================================== --- trunk/stdair/stdair/service/STDAIR_Service.cpp 2010-10-04 09:11:49 UTC (rev 340) +++ trunk/stdair/stdair/service/STDAIR_Service.cpp 2010-10-13 13:28:20 UTC (rev 341) @@ -21,7 +21,6 @@ // ////////////////////////////////////////////////////////////////////// STDAIR_Service::STDAIR_Service () : _bomRoot (FacBom<BomRoot>::instance().create()) { - assert (false); } // ////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-10-14 16:40:24
|
Revision: 348 http://stdair.svn.sourceforge.net/stdair/?rev=348&view=rev Author: quannaus Date: 2010-10-14 16:40:17 +0000 (Thu, 14 Oct 2010) Log Message: ----------- [dev] Removed '_T' from 'Struct_T' - not a typedef. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/BasConst_General.hpp trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/DoWStruct.cpp trunk/stdair/stdair/bom/DoWStruct.hpp trunk/stdair/stdair/bom/FlightPeriod.hpp trunk/stdair/stdair/bom/FlightPeriodKey.cpp trunk/stdair/stdair/bom/FlightPeriodKey.hpp trunk/stdair/stdair/bom/OptimizerStruct.cpp trunk/stdair/stdair/bom/OptimizerStruct.hpp trunk/stdair/stdair/bom/PeriodStruct.cpp trunk/stdair/stdair/bom/PeriodStruct.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -94,6 +94,9 @@ /** Define the Airline Code type (2-letter-code, e.g., BA). */ typedef std::string AirlineCode_T; + /** Define a list of airline code. */ + typedef std::vector<AirlineCode_T> AirlineCodeList_T; + /** Location code (3-letter-code, e.g., LON). */ typedef std::string LocationCode_T; @@ -236,6 +239,9 @@ B, K, etc.). */ typedef std::string ClassCode_T; + /** Define a list of class code. */ + typedef std::vector<ClassCode_T> ClassCodeList_T; + /** Define the sub-class code (e.g., 0, 1, 2, etc.). The subclass is a sub-structure for the booking class, allowing to have specific rules for some criteria like POS. */ Modified: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/basic/BasConst.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -29,8 +29,7 @@ const Duration_T NULL_BOOST_TIME_DURATION = boost::posix_time::hours(0)+ boost::posix_time::minutes (0) + boost::posix_time::seconds (0); - - + // //////// (Flight-)Period-related BOM /////// /** Default number of duration days. */ const DayDuration_T DEFAULT_DAY_DURATION (0); Modified: trunk/stdair/stdair/basic/BasConst_General.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_General.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/basic/BasConst_General.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -53,5 +53,27 @@ /** Default random seed. */ extern const RandomSeed_T DEFAULT_RANDOM_SEED; + + /** Null time duration (in boost::time_duration unit).*/ + extern const Duration_T NULL_BOOST_TIME_DURATION; + + /** Default value of Availability. */ + extern const Fare_T DEFAULT_CLASS_FARE_VALUE; + + /** Default number of airlines. */ + extern const NbOfAirlines_T DEFAULT_NBOFAIRLINES; + + /** Default airlineCode value ('XX'). */ + extern const AirlineCode_T DEFAULT_AIRLINE_CODE; + + /** Default airlineCode value (''). */ + extern const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE; + + /** Default classCode value ('X'). */ + extern const ClassCode_T DEFAULT_CLASS_CODE; + + /** Default null classCode value (''). */ + extern const ClassCode_T DEFAULT_NULL_CLASS_CODE; + } #endif // __STDAIR_BAS_BASCONST_GENERAL_HPP Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -21,7 +21,7 @@ // //////////////////////////////////////////////////////////////////// void AirlineFeature::init (const ForecasterMode_T& iForecastMode, const HistoricalDataLimit_T& iHistoricalDataLimit, - const OptimizerStruct_T& iOptimizerStruct, + const OptimizerStruct& iOptimizerStruct, const ControlMode_T& iControlMode) { _forecasterMode = iForecastMode; _historicalDataLimit = iHistoricalDataLimit; Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -32,7 +32,7 @@ // //////////// Setters ////////// /** Intialization method. */ void init (const ForecasterMode_T&, const HistoricalDataLimit_T&, - const OptimizerStruct_T&, const ControlMode_T&); + const OptimizerStruct&, const ControlMode_T&); public: // /////////// Display support methods ///////// @@ -70,7 +70,7 @@ HistoricalDataLimit_T _historicalDataLimit; /** The type of optimizer. */ - OptimizerStruct_T _optimizerStruct; + OptimizerStruct _optimizerStruct; /** The type of inventory control. */ ControlMode_T _controlMode; Modified: trunk/stdair/stdair/bom/DoWStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/DoWStruct.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/DoWStruct.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -11,14 +11,14 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - DoWStruct_T::DoWStruct_T () { + DoWStruct::DoWStruct () { for (unsigned short i = 0; i < 7; ++i) { _dowList.push_back (false); } } // //////////////////////////////////////////////////////////////////// - DoWStruct_T::DoWStruct_T (const std::string& iDowString) { + DoWStruct::DoWStruct (const std::string& iDowString) { const unsigned short lDowStringSize = iDowString.size(); assert (lDowStringSize == 7); @@ -31,13 +31,13 @@ } // //////////////////////////////////////////////////////////////////// - DoWStruct_T::DoWStruct_T (const DoWStruct_T& iDowStruct) : + DoWStruct::DoWStruct (const DoWStruct& iDowStruct) : _dowList (iDowStruct._dowList) { } // //////////////////////////////////////////////////////////////////// - const std::string DoWStruct_T::describeShort() const { + const std::string DoWStruct::describeShort() const { std::ostringstream ostr; short i = 0; for (BooleanList_T::const_iterator itDoW = _dowList.begin(); @@ -49,7 +49,7 @@ } // //////////////////////////////////////////////////////////////////// - const std::string DoWStruct_T::describe() const { + const std::string DoWStruct::describe() const { std::ostringstream ostr; short i = 0; for (BooleanList_T::const_iterator itDoW = _dowList.begin(); @@ -63,12 +63,12 @@ } // //////////////////////////////////////////////////////////////////// - bool DoWStruct_T::getDayOfWeek (const unsigned short i) const { + bool DoWStruct::getDayOfWeek (const unsigned short i) const { return _dowList.at (i); } // //////////////////////////////////////////////////////////////////// - bool DoWStruct_T::getStandardDayOfWeek (const unsigned short i) const { + bool DoWStruct::getStandardDayOfWeek (const unsigned short i) const { unsigned short iStd = i; if (iStd == 0) { iStd = 6; @@ -79,14 +79,14 @@ } // //////////////////////////////////////////////////////////////////// - void DoWStruct_T::setDayOfWeek (const unsigned short i, const bool iBool) { + void DoWStruct::setDayOfWeek (const unsigned short i, const bool iBool) { assert (i < 7); _dowList.at (i) = iBool; } // //////////////////////////////////////////////////////////////////// - DoWStruct_T DoWStruct_T::shift (const long& iNbOfDays) const { - DoWStruct_T oDoW (DEFAULT_DOW_STRING); + DoWStruct DoWStruct::shift (const long& iNbOfDays) const { + DoWStruct oDoW (DEFAULT_DOW_STRING); for (short i = 0; i < 7; ++i) { const bool lDoWBool = _dowList.at (i); @@ -101,8 +101,8 @@ } // //////////////////////////////////////////////////////////////////// - DoWStruct_T DoWStruct_T::intersection (const DoWStruct_T& iDoW) const { - DoWStruct_T oDoW (DEFAULT_DOW_STRING); + DoWStruct DoWStruct::intersection (const DoWStruct& iDoW) const { + DoWStruct oDoW (DEFAULT_DOW_STRING); for (unsigned short i = 0; i < 7; ++i) { if (getDayOfWeek(i) && iDoW.getDayOfWeek(i)) { oDoW.setDayOfWeek (i, true); @@ -114,7 +114,7 @@ } // //////////////////////////////////////////////////////////////////// - const bool DoWStruct_T::isValid () const { + const bool DoWStruct::isValid () const { for (unsigned short i = 0; i < 7; ++i) { if (getDayOfWeek(i)) { return true; Modified: trunk/stdair/stdair/bom/DoWStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/DoWStruct.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/DoWStruct.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -15,7 +15,7 @@ /** 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 { + struct DoWStruct : public StructAbstract { public: /** Define the bit set representing the DoW. */ typedef std::vector<bool> BooleanList_T; @@ -44,10 +44,10 @@ public: // ///////////////// Business Methods //////////////// /** Build a new DoW struct by shifting the current DoW by a given number. */ - DoWStruct_T shift (const long&) const; + DoWStruct shift (const long&) const; /** Build a new DoW struct by intersecting two DoW structs. */ - DoWStruct_T intersection (const DoWStruct_T&) const; + DoWStruct intersection (const DoWStruct&) const; /** Return if the DoW struct is valid (i.e., has at least one "true"). */ const bool isValid () const; @@ -55,12 +55,12 @@ public: /** Constructor from a given bit set (e.g., "0000011" for the week-ends). */ - DoWStruct_T (const std::string& iDowString); + DoWStruct (const std::string& iDowString); /** Default constructors. */ - DoWStruct_T (); - DoWStruct_T (const DoWStruct_T&); + DoWStruct (); + DoWStruct (const DoWStruct&); /** Default destructor. */ - ~DoWStruct_T () { } + ~DoWStruct () { } private: /** Attributes. */ Modified: trunk/stdair/stdair/bom/FlightPeriod.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -35,7 +35,7 @@ } /** Get the departure period (part of the key). */ - const PeriodStruct_T& getPeriod () const { return _key.getPeriod(); } + const PeriodStruct& getPeriod () const { return _key.getPeriod(); } /** Get the map of children holders. */ const HolderMap_T& getHolderMap() const { return _holderMap; } Modified: trunk/stdair/stdair/bom/FlightPeriodKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightPeriodKey.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/FlightPeriodKey.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -8,7 +8,7 @@ // //////////////////////////////////////////////////////////////////// FlightPeriodKey::FlightPeriodKey (const FlightNumber_T& iFlightNumber, - const PeriodStruct_T& iPeriod) + const PeriodStruct& iPeriod) : _flightNumber (iFlightNumber), _period (iPeriod) { } Modified: trunk/stdair/stdair/bom/FlightPeriodKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightPeriodKey.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/FlightPeriodKey.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -18,7 +18,7 @@ public: // /////////// Construction /////////// /** Constructors. */ - FlightPeriodKey (const FlightNumber_T&, const PeriodStruct_T&); + FlightPeriodKey (const FlightNumber_T&, const PeriodStruct&); FlightPeriodKey (const FlightPeriodKey&); /** Destructor. */ ~FlightPeriodKey (); @@ -30,7 +30,7 @@ } /** Get the active days-of-week. */ - const PeriodStruct_T& getPeriod () const { + const PeriodStruct& getPeriod () const { return _period; } @@ -56,7 +56,7 @@ FlightNumber_T _flightNumber; /** Period during the departure period. */ - PeriodStruct_T _period; + PeriodStruct _period; }; Modified: trunk/stdair/stdair/bom/OptimizerStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -11,11 +11,11 @@ namespace stdair { // /////////////////////////////////////////////////////////////////// - OptimizerStruct_T::OptimizerStruct_T () { + OptimizerStruct::OptimizerStruct () { } // /////////////////////////////////////////////////////////////////// - OptimizerStruct_T::OptimizerStruct_T + OptimizerStruct::OptimizerStruct (const OptimizerMode_T& iOptimizerMode, const SellupFlagForOptimizer_T& iSellupFlagForOptimizer, const SellupProbabilityVector_T& iSellupProbabilityVectorForOptimizer) @@ -25,19 +25,19 @@ } // /////////////////////////////////////////////////////////////////// - OptimizerStruct_T::OptimizerStruct_T - (const OptimizerStruct_T& iOptimizerStruct) + OptimizerStruct::OptimizerStruct + (const OptimizerStruct& iOptimizerStruct) : _optimizerMode(iOptimizerStruct._optimizerMode), _sellupFlagForOptimizer(iOptimizerStruct._sellupFlagForOptimizer), _sellupProbabilityVectorForOptimizer(iOptimizerStruct._sellupProbabilityVectorForOptimizer) { } // //////////////////////////////////////////////////////////////////// - OptimizerStruct_T::~OptimizerStruct_T () { + OptimizerStruct::~OptimizerStruct () { } // //////////////////////////////////////////////////////////////////// - void OptimizerStruct_T:: + void OptimizerStruct:: init (const OptimizerMode_T& iOptimizerMode, const SellupFlagForOptimizer_T& iSellupFlagForOptimizer, const SellupProbabilityVector_T& iSellupProbabilityVectorForOptimizer) { @@ -47,7 +47,7 @@ } // //////////////////////////////////////////////////////////////////// - const std::string OptimizerStruct_T::describe() const { + const std::string OptimizerStruct::describe() const { std::ostringstream ostr; ostr << _optimizerMode << "," << _sellupFlagForOptimizer @@ -56,7 +56,7 @@ } // ////////////////////////////////////////////////////////////////////// - const std::string OptimizerStruct_T::describeSellupProbabilityVector() const { + const std::string OptimizerStruct::describeSellupProbabilityVector() const { std::ostringstream ostr; for (SellupProbabilityVector_T::const_iterator itValue = _sellupProbabilityVectorForOptimizer.begin(); Modified: trunk/stdair/stdair/bom/OptimizerStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -10,7 +10,7 @@ namespace stdair { /** Utility structure for parsing optimizer setting. */ - struct OptimizerStruct_T { + struct OptimizerStruct { public: // /////////// Getters //////////////// /** Get the optimizer mode. */ @@ -43,16 +43,16 @@ public: /** Default constructor. */ - OptimizerStruct_T (); + OptimizerStruct (); /** Constructor. */ - OptimizerStruct_T (const OptimizerMode_T&, + OptimizerStruct (const OptimizerMode_T&, const SellupFlagForOptimizer_T&, const SellupProbabilityVector_T&); /** Default copy constructor. */ - OptimizerStruct_T (const OptimizerStruct_T&); + OptimizerStruct (const OptimizerStruct&); /** Defaut destructor. */ - ~OptimizerStruct_T (); + ~OptimizerStruct (); private: // /////////////// Attributes ////////// Modified: trunk/stdair/stdair/bom/PeriodStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/PeriodStruct.cpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/PeriodStruct.cpp 2010-10-14 16:40:17 UTC (rev 348) @@ -10,38 +10,38 @@ namespace stdair { // //////////////////////////////////////////////////////////////////// - PeriodStruct_T::PeriodStruct_T () + PeriodStruct::PeriodStruct () : _dateRange (BOOST_DEFAULT_DATE_PERIOD), _dow () { } // //////////////////////////////////////////////////////////////////// - PeriodStruct_T::PeriodStruct_T (const DatePeriod_T& iDateRange, - const DoWStruct_T& iDoW) + PeriodStruct::PeriodStruct (const DatePeriod_T& iDateRange, + const DoWStruct& iDoW) : _dateRange (iDateRange), _dow (iDoW) { } // //////////////////////////////////////////////////////////////////// - PeriodStruct_T::PeriodStruct_T (const PeriodStruct_T& iPeriodStruct) + PeriodStruct::PeriodStruct (const PeriodStruct& iPeriodStruct) : _dateRange (iPeriodStruct._dateRange), _dow (iPeriodStruct._dow) { } // //////////////////////////////////////////////////////////////////// - const std::string PeriodStruct_T::describeShort() const { + const std::string PeriodStruct::describeShort() const { std::ostringstream ostr; ostr << _dateRange << ", " << _dow.describeShort (); return ostr.str(); } // //////////////////////////////////////////////////////////////////// - const std::string PeriodStruct_T::describe() const { + const std::string PeriodStruct::describe() const { std::ostringstream ostr; ostr << _dateRange << ", " << _dow.describe (); return ostr.str(); } // //////////////////////////////////////////////////////////////////// - PeriodStruct_T PeriodStruct_T:: + PeriodStruct PeriodStruct:: addDateOffset (const DateOffset_T& iDateOffset) const { // Create a new date range by shifting the date range of this object with // iDateOffset. @@ -51,24 +51,24 @@ // Create a new DoWStruct by shifting the DoWStruct of this object with // iDateOffset. const long lNbOfDaysOffset = iDateOffset.days(); - const DoWStruct_T& lDoW = getDoW(); - const DoWStruct_T lNewDoW = lDoW.shift (lNbOfDaysOffset); + const DoWStruct& lDoW = getDoW(); + const DoWStruct lNewDoW = lDoW.shift (lNbOfDaysOffset); - return PeriodStruct_T (lNewDateRange, lNewDoW); + return PeriodStruct (lNewDateRange, lNewDoW); } // //////////////////////////////////////////////////////////////////// - PeriodStruct_T PeriodStruct_T:: - intersection (const PeriodStruct_T& iPeriodStruct) const { + PeriodStruct PeriodStruct:: + intersection (const PeriodStruct& iPeriodStruct) const { const DatePeriod_T lNewDateRange = _dateRange.intersection (iPeriodStruct._dateRange); - const DoWStruct_T lNewDoW = _dow.intersection (iPeriodStruct._dow); + const DoWStruct lNewDoW = _dow.intersection (iPeriodStruct._dow); - return PeriodStruct_T (lNewDateRange, lNewDoW); + return PeriodStruct (lNewDateRange, lNewDoW); } // //////////////////////////////////////////////////////////////////// - const bool PeriodStruct_T::isValid () const { + const bool PeriodStruct::isValid () const { if (_dateRange.is_null() == false && _dow.isValid()) { return true; } Modified: trunk/stdair/stdair/bom/PeriodStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/PeriodStruct.hpp 2010-10-14 13:37:06 UTC (rev 347) +++ trunk/stdair/stdair/bom/PeriodStruct.hpp 2010-10-14 16:40:17 UTC (rev 348) @@ -15,14 +15,14 @@ /** Define a departure period <br> A period is defined by a date range and a day-of-week struct. */ - struct PeriodStruct_T : public StructAbstract { + struct PeriodStruct : public StructAbstract { public: // ////////// Getters ///////////// /** Retrieve the attributes. */ const DatePeriod_T& getDateRange () const { return _dateRange; } - const DoWStruct_T& getDoW () const { + const DoWStruct& getDoW () const { return _dow; } @@ -32,7 +32,7 @@ void setDateRange (const DatePeriod_T& iDateRange) { _dateRange = iDateRange; } - void setDoW (const DoWStruct_T& iDoW) { _dow = iDoW; } + void setDoW (const DoWStruct& iDoW) { _dow = iDoW; } public: /** Display explicitly (e.g., "Mon.Tue.Wed.Thu.Fri."). */ @@ -44,28 +44,28 @@ public: // /////////// Business Methods ///////////// /** Build a period struct from this period struct by adding a date offset. */ - PeriodStruct_T addDateOffset (const DateOffset_T&) const; + PeriodStruct addDateOffset (const DateOffset_T&) const; /** Build a new period struct which is the intersection of two period structs. */ - PeriodStruct_T intersection (const PeriodStruct_T&) const; + PeriodStruct intersection (const PeriodStruct&) const; /** Return if the period is valid (i.e., valid date range and valid DoW). */ const bool isValid () const; public: /** Constructor. */ - PeriodStruct_T (const DatePeriod_T&, const DoWStruct_T&); + PeriodStruct (const DatePeriod_T&, const DoWStruct&); /** Default constructors. */ - PeriodStruct_T (); - PeriodStruct_T (const PeriodStruct_T&); + PeriodStruct (); + PeriodStruct (const PeriodStruct&); /** Default destructor. */ - ~PeriodStruct_T () { } + ~PeriodStruct () { } private: // Attributes DatePeriod_T _dateRange; - DoWStruct_T _dow; + DoWStruct _dow; }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2010-11-04 17:31:01
|
Revision: 359 http://stdair.svn.sourceforge.net/stdair/?rev=359&view=rev Author: quannaus Date: 2010-11-04 17:30:55 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Removed the seed generator for trademgen in BomRoot. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-11-04 17:30:55 UTC (rev 359) @@ -11,6 +11,8 @@ #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> @@ -426,6 +428,10 @@ /** 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 */ Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-11-04 17:30:55 UTC (rev 359) @@ -11,8 +11,7 @@ // //////////////////////////////////////////////////////////////////// BomRoot::BomRoot (const Key_T& iKey) - : _key (iKey), _seed (DEFAULT_RANDOM_SEED), _generator (_seed), - _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) { + : _key (iKey) { } // //////////////////////////////////////////////////////////////////// @@ -26,11 +25,4 @@ return oStr.str(); } - // //////////////////////////////////////////////////////////////////// - RandomSeed_T BomRoot::generateSeed () { - RealNumber_T lVariateUnif = _uniformGenerator() * 1e9; - RandomSeed_T oSeed = static_cast<RandomSeed_T> (lVariateUnif); - return oSeed; - } - } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-11-04 17:30:55 UTC (rev 359) @@ -54,14 +54,6 @@ // Attributes Key_T _key; HolderMap_T _holderMap; - - // TEST - stdair::RandomSeed_T _seed; - stdair::BaseGenerator_T _generator; - boost::variate_generator<stdair::BaseGenerator_T&, - boost::uniform_real<> > _uniformGenerator; - public: - RandomSeed_T generateSeed (); }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-12-03 14:27:51
|
Revision: 380 http://stdair.svn.sourceforge.net/stdair/?rev=380&view=rev Author: denis_arnaud Date: 2010-12-03 14:27:44 +0000 (Fri, 03 Dec 2010) Log Message: ----------- [API] Fixed a few compilation errors with the new API. Modified Paths: -------------- trunk/stdair/stdair/bom/BookingClass.cpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassKey.cpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDateKey.cpp trunk/stdair/stdair/bom/FlightDateKey.hpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegCabinKey.cpp trunk/stdair/stdair/bom/LegCabinKey.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateKey.cpp trunk/stdair/stdair/bom/LegDateKey.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentCabinKey.cpp trunk/stdair/stdair/bom/SegmentCabinKey.hpp trunk/stdair/stdair/bom/SegmentDateKey.cpp trunk/stdair/stdair/bom/SegmentDateKey.hpp trunk/stdair/stdair/stdair_basic_types.hpp trunk/stdair/stdair/stdair_demand_types.hpp trunk/stdair/stdair/stdair_inventory_types.hpp Modified: trunk/stdair/stdair/bom/BookingClass.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/BookingClass.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -3,6 +3,7 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> +#include <sstream> // STDAIR #include <stdair/basic/BasConst_BookingClass.hpp> #include <stdair/basic/BasConst_Yield.hpp> Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// StdAir +#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/BomAbstract.hpp> #include <stdair/bom/BookingClassKey.hpp> #include <stdair/bom/BookingClassTypes.hpp> Modified: trunk/stdair/stdair/bom/BookingClassKey.cpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/BookingClassKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/BookingClassKey.hpp> Modified: trunk/stdair/stdair/bom/BookingClassKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // StdAir -#include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_basic_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -3,6 +3,7 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> +#include <sstream> // StdAir #include <stdair/bom/FlightDate.hpp> Modified: trunk/stdair/stdair/bom/FlightDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/FlightDateKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/FlightDateKey.hpp> Modified: trunk/stdair/stdair/bom/FlightDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/FlightDateKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -5,7 +5,8 @@ // Import section // ////////////////////////////////////////////////////////////////////// // StdAir -#include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_basic_types.hpp> +#include <stdair/stdair_date_time_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/LegCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// StdAir +#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/BomAbstract.hpp> #include <stdair/bom/LegCabinKey.hpp> #include <stdair/bom/LegCabinTypes.hpp> Modified: trunk/stdair/stdair/bom/LegCabinKey.cpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegCabinKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/LegCabinKey.hpp> Modified: trunk/stdair/stdair/bom/LegCabinKey.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegCabinKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // StdAir -#include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_basic_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegDate.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// StdAir +#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/BomAbstract.hpp> #include <stdair/bom/LegDateKey.hpp> #include <stdair/bom/LegDateTypes.hpp> Modified: trunk/stdair/stdair/bom/LegDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegDateKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/LegDateKey.hpp> Modified: trunk/stdair/stdair/bom/LegDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/LegDateKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -6,7 +6,6 @@ // ////////////////////////////////////////////////////////////////////// // StdAir #include <stdair/stdair_basic_types.hpp> -#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -3,7 +3,8 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> -// STDAIR +#include <sstream> +// StdAir #include <stdair/basic/BasConst_BookingClass.hpp> #include <stdair/basic/BasConst_Inventory.hpp> #include <stdair/bom/SegmentCabin.hpp> Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// StdAir +#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/BomAbstract.hpp> #include <stdair/bom/SegmentCabinKey.hpp> #include <stdair/bom/SegmentCabinTypes.hpp> Modified: trunk/stdair/stdair/bom/SegmentCabinKey.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentCabinKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/SegmentCabinKey.hpp> Modified: trunk/stdair/stdair/bom/SegmentCabinKey.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentCabinKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // StdAir -#include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_basic_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/SegmentDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.cpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentDateKey.cpp 2010-12-03 14:27:44 UTC (rev 380) @@ -1,6 +1,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// +// STL +#include <sstream> // StdAir #include <stdair/bom/SegmentDateKey.hpp> Modified: trunk/stdair/stdair/bom/SegmentDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/bom/SegmentDateKey.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -6,7 +6,6 @@ // ////////////////////////////////////////////////////////////////////// // StdAir #include <stdair/stdair_basic_types.hpp> -#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/stdair_basic_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -14,9 +14,6 @@ /** Event type */ typedef std::string EventType_T; - /** Count */ - typedef int Count_T; - /** Location code (3-letter-code, e.g., LON). */ typedef std::string LocationCode_T; @@ -29,6 +26,23 @@ /** City code */ typedef LocationCode_T CityCode_T; + /** Define the Airline Code type (2-letter-code, e.g., BA). */ + typedef std::string AirlineCode_T; + + /** Define the type for flight numbers. */ + typedef unsigned short FlightNumber_T; + + /** Define the cabin code (class of service, e.g., first, business, + economy). */ + typedef std::string CabinCode_T; + + /** Define the code of the fare family (e.g., 1, 2, 3, etc.). */ + typedef std::string FamilyCode_T; + + /** Define the booking class code (product segment class, e.g., H, + B, K, etc.). */ + typedef std::string ClassCode_T; + /** Define a identity number. */ typedef unsigned long Identity_T; @@ -66,6 +80,22 @@ /** Define the number of seats required by a demand. */ // typedef unsigned short NbOfSeats_T; + /** Count */ + typedef int Count_T; + + /** Number of passengers (in a group) for a booking. */ + typedef unsigned short PartySize_T; + + /** Define a number of requests. */ + typedef double NbOfRequests_T; + + /** Define a number of bookings. */ + typedef NbOfRequests_T NbOfBookings_T; + + /** Define a number of travel solutions + (in a travel solution block). */ + typedef unsigned short NbOfTravelSolutions_T; + // ///////////// Technical //////////////// /** File or directory name. <br>It may contain paths, relative or absolute (e.g., /foo/bar Modified: trunk/stdair/stdair/stdair_demand_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_demand_types.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/stdair_demand_types.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -69,25 +69,12 @@ /** 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; - - /** Define a number of requests. */ - typedef double NbOfRequests_T; - - /** Define a number of bookings. */ - typedef NbOfRequests_T NbOfBookings_T; - /** Define a number of cancellations (travellers). */ typedef NbOfRequests_T NbOfCancellations_T; /** Define a number of no-shows. */ typedef NbOfRequests_T NbOfNoShows_T; - /** Define a number of travel solutions - (in a travel solution block). */ - typedef unsigned short NbOfTravelSolutions_T; - /** Define a indicator of demand to class matching. */ typedef double MatchingIndicator_T; Modified: trunk/stdair/stdair/stdair_inventory_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 14:26:43 UTC (rev 379) +++ trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 14:27:44 UTC (rev 380) @@ -18,27 +18,10 @@ /** 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; - - /** Define a list of airline code. */ + /** Define a list of airline code. */ typedef std::vector<AirlineCode_T> AirlineCodeList_T; - /** Define the type for flight numbers. */ - typedef unsigned short FlightNumber_T; - - /** Define the cabin code (class of service, e.g., first, business, - economy). */ - typedef std::string CabinCode_T; - - /** Define the code of the fare family (e.g., 1, 2, 3, etc.). */ - typedef std::string FamilyCode_T; - - /** Define the booking class code (product segment class, e.g., H, - B, K, etc.). */ - typedef std::string ClassCode_T; - - /** Define a list of class code. */ + /** Define a list of class code. */ typedef std::vector<ClassCode_T> ClassCodeList_T; /** Define the sub-class code (e.g., 0, 1, 2, etc.). The subclass is This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-12-03 14:51:53
|
Revision: 382 http://stdair.svn.sourceforge.net/stdair/?rev=382&view=rev Author: denis_arnaud Date: 2010-12-03 14:51:47 +0000 (Fri, 03 Dec 2010) Log Message: ----------- [API] Fixed a few compilation errors with the new API. Modified Paths: -------------- trunk/stdair/stdair/bom/Bucket.cpp trunk/stdair/stdair/bom/Bucket.hpp trunk/stdair/stdair/bom/BucketKey.hpp trunk/stdair/stdair/bom/OptimizerStruct.cpp trunk/stdair/stdair/bom/OptimizerStruct.hpp trunk/stdair/stdair/bom/TravelSolutionStruct.cpp trunk/stdair/stdair/bom/TravelSolutionStruct.hpp trunk/stdair/stdair/stdair_rm_types.hpp Modified: trunk/stdair/stdair/bom/Bucket.cpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.cpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/Bucket.cpp 2010-12-03 14:51:47 UTC (rev 382) @@ -3,6 +3,7 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> +#include <sstream> // StdAir #include <stdair/bom/Bucket.hpp> Modified: trunk/stdair/stdair/bom/Bucket.hpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.hpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/Bucket.hpp 2010-12-03 14:51:47 UTC (rev 382) @@ -4,8 +4,11 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/stdair_types.hpp> +// STL +#include <string> +#include <iosfwd> +// StdAir +#include <stdair/stdair_inventory_types.hpp> #include <stdair/bom/BomAbstract.hpp> #include <stdair/bom/BucketKey.hpp> #include <stdair/bom/BucketTypes.hpp> Modified: trunk/stdair/stdair/bom/BucketKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BucketKey.hpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/BucketKey.hpp 2010-12-03 14:51:47 UTC (rev 382) @@ -4,7 +4,10 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// STL +#include <string> +#include <iosfwd> +// StdAir #include <stdair/bom/KeyAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/OptimizerStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-12-03 14:51:47 UTC (rev 382) @@ -2,11 +2,10 @@ // Import section // ////////////////////////////////////////////////////////////////////// // STL -#include <string> +#include <cassert> #include <sstream> #include <vector> -// STDAIR -#include <stdair/stdair_types.hpp> +// StdAir #include <stdair/bom/OptimizerStruct.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/OptimizerStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-12-03 14:51:47 UTC (rev 382) @@ -6,6 +6,8 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <string> +// StdAir +#include <stdair/stdair_rm_types.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.cpp 2010-12-03 14:51:47 UTC (rev 382) @@ -3,11 +3,8 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> -#include <istream> -#include <ostream> #include <sstream> // StdAir -#include <stdair/stdair_types.hpp> #include <stdair/basic/BasConst_BookingClass.hpp> #include <stdair/bom/TravelSolutionStruct.hpp> Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-12-03 14:51:47 UTC (rev 382) @@ -9,10 +9,12 @@ #include <string> #include <vector> // StdAir +#include <stdair/stdair_basic_types.hpp> #include <stdair/basic/StructAbstract.hpp> #include <stdair/bom/BookingClassTypes.hpp> namespace stdair { + /** Structure holding the elements of a travel solution. */ struct TravelSolutionStruct : public StructAbstract { public: Modified: trunk/stdair/stdair/stdair_rm_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_rm_types.hpp 2010-12-03 14:51:21 UTC (rev 381) +++ trunk/stdair/stdair/stdair_rm_types.hpp 2010-12-03 14:51:47 UTC (rev 382) @@ -7,6 +7,8 @@ // STL #include <string> #include <vector> +// StdAir +#include <stdair/stdair_basic_types.hpp> namespace stdair { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-12-03 15:09:57
|
Revision: 384 http://stdair.svn.sourceforge.net/stdair/?rev=384&view=rev Author: denis_arnaud Date: 2010-12-03 15:09:51 +0000 (Fri, 03 Dec 2010) Log Message: ----------- [API] Fixed a few compilation errors with the new API. Modified Paths: -------------- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp trunk/stdair/stdair/stdair_basic_types.hpp trunk/stdair/stdair/stdair_fare_types.hpp trunk/stdair/stdair/stdair_inventory_types.hpp Modified: trunk/stdair/stdair/bom/TravelSolutionStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-12-03 15:09:36 UTC (rev 383) +++ trunk/stdair/stdair/bom/TravelSolutionStruct.hpp 2010-12-03 15:09:51 UTC (rev 384) @@ -19,27 +19,38 @@ struct TravelSolutionStruct : public StructAbstract { public: // /////////// Getters /////////////// + /** Get the fare/price. */ + const Fare_T getFare() const { + return _fare; + } + /** Get the availability. */ + const Availability_T getAvailability() const { + return _availability; + } + /** Get the list of segment-date keys. */ const KeyList_T& getSegmentDateKeyList () const { return _segmentDateKeyList; } + /** Get the list of booking-class keys. */ const ClassList_String_T& getBookingClassKeyList () const { return _bookingClassKeyList; } - const Fare_T getFare() const { return _fare; } - const Availability_T getAvailability() const { return _availability; } public: // /////////// Setters /////////////// - /** Setter for some attributes. */ + /** Set the fare/price. */ void setFare (const Fare_T& iFare) { _fare = iFare; } + /** Set the availability. */ void setAvailability (const Availability_T& iAvail) { _availability=iAvail; } + /** Add a segment-date key to the dedicated list. */ void addSegmentDateKey (const std::string& iKey) { _segmentDateKeyList.push_back (iKey); } + /** Add a booking-class key to the dedicated list. */ void addBookingClassKey (const char iKey) { _bookingClassKeyList.push_back (iKey); } Modified: trunk/stdair/stdair/stdair_basic_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 15:09:36 UTC (rev 383) +++ trunk/stdair/stdair/stdair_basic_types.hpp 2010-12-03 15:09:51 UTC (rev 384) @@ -96,6 +96,21 @@ (in a travel solution block). */ typedef unsigned short NbOfTravelSolutions_T; + /** Define the list of class codes as a string. */ + typedef std::string ClassList_String_T; + + /** Define a number of segment-dates (in a path). */ + typedef unsigned short NbOfSegments_T; + + /** Define a number of airlines (in a path). */ + typedef unsigned short NbOfAirlines_T; + + /** Define an availability. */ + typedef double Availability_T; + + /** Define the price of a travel solution. */ + typedef double Fare_T; + // ///////////// Technical //////////////// /** File or directory name. <br>It may contain paths, relative or absolute (e.g., /foo/bar Modified: trunk/stdair/stdair/stdair_fare_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_fare_types.hpp 2010-12-03 15:09:36 UTC (rev 383) +++ trunk/stdair/stdair/stdair_fare_types.hpp 2010-12-03 15:09:51 UTC (rev 384) @@ -11,8 +11,5 @@ /** Define a number of fare rules. */ typedef double NbOfFareRules_T; - /** Define the fare of a travel solution. */ - typedef double Fare_T; - } #endif // __STDAIR_STDAIR_FARE_TYPES_HPP Modified: trunk/stdair/stdair/stdair_inventory_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 15:09:36 UTC (rev 383) +++ trunk/stdair/stdair/stdair_inventory_types.hpp 2010-12-03 15:09:51 UTC (rev 384) @@ -32,15 +32,6 @@ /** Define the flight path code (code made by a suite of flight numbers). */ typedef std::string FlightPathCode_T; - /** Define the list of class codes as a string. */ - typedef std::string ClassList_String_T; - - /** Define a number of segment-dates (in a path). */ - typedef unsigned short NbOfSegments_T; - - /** Define a number of airlines (in a path). */ - typedef unsigned short NbOfAirlines_T; - /** Map between the cabin codes and the booking class codes within each cabin. */ typedef std::map<CabinCode_T, ClassList_String_T> CabinBookingClassMap_T; @@ -70,10 +61,7 @@ /** Define the number of seat which could not be used for the booking. */ typedef double BlockSpace_T; - /** Define an availability. */ - typedef double Availability_T; - - /** Define an availability. */ + /** Define an availability status (AVS). */ typedef bool AvailabilityStatus_T; /** Define a list of availabilities. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2010-12-03 15:36:17
|
Revision: 388 http://stdair.svn.sourceforge.net/stdair/?rev=388&view=rev Author: denis_arnaud Date: 2010-12-03 15:36:11 +0000 (Fri, 03 Dec 2010) Log Message: ----------- [API] Fixed a few compilation errors with the new API. Modified Paths: -------------- trunk/stdair/stdair/command/DBManagerForAirlines.cpp trunk/stdair/stdair/command/DBManagerForAirlines.hpp trunk/stdair/stdair/sources.mk trunk/stdair/stdair/stdair_date_time_types.hpp trunk/stdair/stdair/stdair_types.hpp Added Paths: ----------- trunk/stdair/stdair/stdair_service_types.hpp Removed Paths: ------------- trunk/stdair/stdair/stdair_service.hpp Modified: trunk/stdair/stdair/command/DBManagerForAirlines.cpp =================================================================== --- trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/command/DBManagerForAirlines.cpp 2010-12-03 15:36:11 UTC (rev 388) @@ -12,7 +12,8 @@ #include <mysql/soci-mysql.h> #endif // SOCI_HEADERS_BURIED // StdAir -#include <stdair/stdair_inventory_types.hpp> +#include <stdair/stdair_basic_types.hpp> +#include <stdair/stdair_exceptions.hpp> #include <stdair/bom/AirlineStruct.hpp> #include <stdair/dbadaptor/DbaAirline.hpp> #include <stdair/command/DBManagerForAirlines.hpp> Modified: trunk/stdair/stdair/command/DBManagerForAirlines.hpp =================================================================== --- trunk/stdair/stdair/command/DBManagerForAirlines.hpp 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/command/DBManagerForAirlines.hpp 2010-12-03 15:36:11 UTC (rev 388) @@ -5,6 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // StdAir +#include <stdair/stdair_db.hpp> #include <stdair/command/CmdAbstract.hpp> namespace stdair { Modified: trunk/stdair/stdair/sources.mk =================================================================== --- trunk/stdair/stdair/sources.mk 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/sources.mk 2010-12-03 15:36:11 UTC (rev 388) @@ -9,8 +9,8 @@ $(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_service_types.hpp \ $(top_srcdir)/stdair/stdair_types.hpp \ - $(top_srcdir)/stdair/stdair_service.hpp \ $(top_srcdir)/stdair/STDAIR_Service.hpp stdair_service_cc_sources = Modified: trunk/stdair/stdair/stdair_date_time_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_date_time_types.hpp 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/stdair_date_time_types.hpp 2010-12-03 15:36:11 UTC (rev 388) @@ -6,22 +6,9 @@ // ////////////////////////////////////////////////////////////////////// // 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_inventory_types.hpp> -#include <stdair/stdair_service.hpp> namespace stdair { Deleted: trunk/stdair/stdair/stdair_service.hpp =================================================================== --- trunk/stdair/stdair/stdair_service.hpp 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/stdair_service.hpp 2010-12-03 15:36:11 UTC (rev 388) @@ -1,19 +0,0 @@ -#ifndef __STDAIR_STDAIR_SERVICE_HPP -#define __STDAIR_STDAIR_SERVICE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// Boost (Extended STL) -#include <boost/shared_ptr.hpp> - -namespace stdair { - - // Forward declarations - class STDAIR_Service; - - /** Pointer on the STDAIR Service handler. */ - typedef boost::shared_ptr<STDAIR_Service> STDAIR_ServicePtr_T; - -} -#endif // __STDAIR_STDAIR_SERVICE_HPP Copied: trunk/stdair/stdair/stdair_service_types.hpp (from rev 378, trunk/stdair/stdair/stdair_service.hpp) =================================================================== --- trunk/stdair/stdair/stdair_service_types.hpp (rev 0) +++ trunk/stdair/stdair/stdair_service_types.hpp 2010-12-03 15:36:11 UTC (rev 388) @@ -0,0 +1,19 @@ +#ifndef __STDAIR_STDAIR_SERVICE_HPP +#define __STDAIR_STDAIR_SERVICE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// Boost (Extended STL) +#include <boost/shared_ptr.hpp> + +namespace stdair { + + // Forward declarations + class STDAIR_Service; + + /** Pointer on the STDAIR Service handler. */ + typedef boost::shared_ptr<STDAIR_Service> STDAIR_ServicePtr_T; + +} +#endif // __STDAIR_STDAIR_SERVICE_HPP Modified: trunk/stdair/stdair/stdair_types.hpp =================================================================== --- trunk/stdair/stdair/stdair_types.hpp 2010-12-03 15:33:52 UTC (rev 387) +++ trunk/stdair/stdair/stdair_types.hpp 2010-12-03 15:36:11 UTC (rev 388) @@ -15,6 +15,6 @@ #include <stdair/stdair_inventory_types.hpp> #include <stdair/stdair_rm_types.hpp> #include <stdair/stdair_date_time_types.hpp> -#include <stdair/stdair_service.hpp> +#include <stdair/stdair_service_types.hpp> #endif // __STDAIR_STDAIR_TYPES_HPP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |