You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(3) |
Feb
(2) |
Mar
(27) |
Apr
(8) |
May
(22) |
Jun
(10) |
Jul
(4) |
Aug
(3) |
Sep
(25) |
Oct
(12) |
Nov
|
Dec
(6) |
2010 |
Jan
(13) |
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(14) |
Sep
(14) |
Oct
(4) |
Nov
(1) |
Dec
(2) |
From: <den...@us...> - 2009-04-24 10:20:02
|
Revision: 200 http://rmol.svn.sourceforge.net/rmol/?rev=200&view=rev Author: denis_arnaud Date: 2009-04-24 10:19:45 +0000 (Fri, 24 Apr 2009) Log Message: ----------- [Build] Added missing BOOST_CFLAGS flags. Modified Paths: -------------- trunk/rmol/rmol/command/Makefile.am Modified: trunk/rmol/rmol/command/Makefile.am =================================================================== --- trunk/rmol/rmol/command/Makefile.am 2009-04-24 10:18:46 UTC (rev 199) +++ trunk/rmol/rmol/command/Makefile.am 2009-04-24 10:19:45 UTC (rev 200) @@ -7,10 +7,10 @@ noinst_LTLIBRARIES += libcmd_debug.la endif libcmd_la_SOURCES= $(cmd_h_sources) $(cmd_cc_sources) -libcmd_la_CXXFLAGS = $(CXXFLAGS_OPT) +libcmd_la_CXXFLAGS = $(CXXFLAGS_OPT) $(BOOST_CFLAGS) libcmd_debug_la_SOURCES = $(cmd_h_sources) $(cmd_cc_sources) -libcmd_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) +libcmd_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) $(BOOST_CFLAGS) #pkgincludedir = $(includedir)/@PACKAGE@/command #pkginclude_HEADERS = $(cmd_h_sources) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-04-24 10:18:57
|
Revision: 199 http://rmol.svn.sourceforge.net/rmol/?rev=199&view=rev Author: denis_arnaud Date: 2009-04-24 10:18:46 +0000 (Fri, 24 Apr 2009) Log Message: ----------- [Build] Added missing BOOST_CFLAGS flags. Modified Paths: -------------- trunk/rmol/rmol/basic/Makefile.am Modified: trunk/rmol/rmol/basic/Makefile.am =================================================================== --- trunk/rmol/rmol/basic/Makefile.am 2009-04-24 09:04:08 UTC (rev 198) +++ trunk/rmol/rmol/basic/Makefile.am 2009-04-24 10:18:46 UTC (rev 199) @@ -7,10 +7,10 @@ noinst_LTLIBRARIES += libbas_debug.la endif libbas_la_SOURCES= $(bas_h_sources) $(bas_cc_sources) -libbas_la_CXXFLAGS = $(CXXFLAGS_OPT) +libbas_la_CXXFLAGS = $(CXXFLAGS_OPT) $(BOOST_CFLAGS) libbas_debug_la_SOURCES = $(bas_h_sources) $(bas_cc_sources) -libbas_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) +libbas_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) $(BOOST_CFLAGS) #pkgincludedir = $(includedir)/@PACKAGE@/basic #pkginclude_HEADERS = $(bas_h_sources) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-04-24 09:04:15
|
Revision: 198 http://rmol.svn.sourceforge.net/rmol/?rev=198&view=rev Author: quannaus Date: 2009-04-24 09:04:08 +0000 (Fri, 24 Apr 2009) Log Message: ----------- A small change. Modified Paths: -------------- trunk/rmol/rmol/bom/MCOptimiser.cpp Modified: trunk/rmol/rmol/bom/MCOptimiser.cpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-24 08:25:09 UTC (rev 197) +++ trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-24 09:04:08 UTC (rev 198) @@ -258,7 +258,7 @@ // Retrieve the BucketHolder // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); - BasChronometer lWithdrawBasChronometer; + BasChronometer lDrawBasChronometer; BasChronometer lSortBasChronometer; BasChronometer lBVPCalculationBasChronometer; @@ -323,7 +323,7 @@ PartialSumHolder& currentPartialSumList = ioPSHolderHolder.getCurrentPartialSumHolder(); currentPartialSumList.initSize (Kj); - lWithdrawBasChronometer.start(); + lDrawBasChronometer.start(); for (int k=1; k <= Kj; k++) { const double djk = gaussianDemandGenerator.generateVariate(); aVariateList.push_back (djk); @@ -349,8 +349,8 @@ */ } - const double lWithdrawTimeValue = lWithdrawBasChronometer.elapsed(); - ioStudyStatManager.addMeasure ("WithdrawTime", lWithdrawTimeValue); + const double lDrawTimeValue = lDrawBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("DrawTime", lDrawTimeValue); // STEP 2. /** @@ -459,7 +459,7 @@ ioPSHolderHolder.getCurrentPartialSumHolder(); currentPartialSumList.initSize (Kj); - lWithdrawBasChronometer.start(); + lDrawBasChronometer.start(); for (int k = 1; k <= Kj; ++k) { const double djk = gaussianDemandGenerator.generateVariate(); aVariateList.push_back (djk); @@ -470,8 +470,8 @@ currentPartialSumList.addPartialSum (sjk); } - const double lWithdrawTimeValue = lWithdrawBasChronometer.elapsed(); - ioStudyStatManager.addMeasure ("WithdrawTime", lWithdrawTimeValue); + const double lDrawTimeValue = lDrawBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("DrawTime", lDrawTimeValue); // STEP 2. lSortBasChronometer.start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-04-24 08:25:10
|
Revision: 197 http://rmol.svn.sourceforge.net/rmol/?rev=197&view=rev Author: quannaus Date: 2009-04-24 08:25:09 +0000 (Fri, 24 Apr 2009) Log Message: ----------- Improved EMSR algorithm running time. Modified Paths: -------------- trunk/rmol/rmol/RMOL_Types.hpp trunk/rmol/rmol/bom/Emsr.cpp trunk/rmol/rmol/bom/EmsrUtils.hpp trunk/rmol/rmol/command/Optimiser.cpp trunk/rmol/rmol/command/Optimiser.hpp trunk/rmol/rmol/service/RMOL_Service.cpp Modified: trunk/rmol/rmol/RMOL_Types.hpp =================================================================== --- trunk/rmol/rmol/RMOL_Types.hpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/RMOL_Types.hpp 2009-04-24 08:25:09 UTC (rev 197) @@ -57,8 +57,8 @@ <br> It is a vector of double. */ typedef std::vector<double> BidPriceVector_T; - /** Define the list of EMSR values for the EMSR algorith. */ - typedef std::list<double> EmsrValueList_T; + /** Define the list of EMSR values for the EMSR algorithm. */ + typedef std::vector<double> EmsrValueList_T; /** Define the vector of booking limits. <br> It is a vector of double. */ Modified: trunk/rmol/rmol/bom/Emsr.cpp =================================================================== --- trunk/rmol/rmol/bom/Emsr.cpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/bom/Emsr.cpp 2009-04-24 08:25:09 UTC (rev 197) @@ -7,6 +7,7 @@ #include <iostream> #include <cmath> #include <list> +#include <algorithm> // RMOL #include <rmol/bom/VariateList.hpp> #include <rmol/bom/Gaussian.hpp> @@ -46,15 +47,14 @@ } // Sort the EMSR values from high to low. - lEmsrValueList.sort(); - lEmsrValueList.reverse(); + std::sort(lEmsrValueList.rbegin(), lEmsrValueList.rend()); // Sanity check const int lEmsrValueListSize = lEmsrValueList.size(); assert (lEmsrValueListSize >= lCabinCapacity); // Copy the EMSR sorted values to the BPV. - EmsrValueList_T::iterator currentValue = lEmsrValueList.begin(); + EmsrValueList_T::const_iterator currentValue = lEmsrValueList.begin(); for (int j = 0; j < lCabinCapacity; ++j, ++currentValue) { const double bidPrice = *currentValue; ioBidPriceVector.push_back(bidPrice); @@ -119,35 +119,6 @@ // Set the booking limit for class/bucket j+1. nextBucket.setCumulatedBookingLimit (lBookingLimit); } - - /* - // Number of classes/buckets: n - const short nbOfClasses = ioBucketHolder.getSize(); - for (int s = 1; s <= iCabinCapacity; s++){ - double maxEmsrValue = 0.0; - int highestBucket = 1; - - for(ioBucketHolder.begin(); - ioBucketHolder.hasNotReachedEnd(); - ioBucketHolder.iterate()){ - Bucket& currentBucket = ioBucketHolder.getCurrentBucket(); - - // Compute EMSR value of the seat #s for class j - double emsrForsj=0; - // Evaluate if this class j has the highest EMSR value for - // seat #s. If so, maxEMSRValue is the EMSR value of j, and - // j becomes temporarily the highest class. - - if(emsrForsj >= maxEmsrValue){ - maxEmsrValue = emsrForsj; - ioBucketHolder.tag(); - } - } - - Bucket& theHighestBucket = ioBucketHolder.getTaggedBucket(); - theHighestBucket._protection += 1.0; - } - */ } // ////////////////////////////////////////////////////////////////// Modified: trunk/rmol/rmol/bom/EmsrUtils.hpp =================================================================== --- trunk/rmol/rmol/bom/EmsrUtils.hpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/bom/EmsrUtils.hpp 2009-04-24 08:25:09 UTC (rev 197) @@ -24,4 +24,4 @@ static const double computeEmsrValue (double, Bucket&); }; } -#endif +#endif //__RMOL_EMSRUTILS_HPP Modified: trunk/rmol/rmol/command/Optimiser.cpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.cpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/command/Optimiser.cpp 2009-04-24 08:25:09 UTC (rev 197) @@ -8,6 +8,8 @@ #include <cmath> #include <iomanip> // RMOL +#include <rmol/basic/BasChronometer.hpp> +#include <rmol/bom/StudyStatManager.hpp> #include <rmol/bom/BucketHolder.hpp> //#include <rmol/bom/Resource.hpp> #include <rmol/bom/MCOptimiser.hpp> @@ -67,6 +69,8 @@ BucketHolder& ioBucketHolder, BidPriceVector_T& ioBidPriceVector, StudyStatManager& ioStudyStatManager) { + BasChronometer lMCIntegrationBasChrono; + lMCIntegrationBasChrono.start(); // Retrieve the BucketHolder // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); @@ -97,6 +101,9 @@ aPartialSumHolderHolder, ioBidPriceVector, ioStudyStatManager); + const double lMCIntegrationTime = lMCIntegrationBasChrono.elapsed(); + ioStudyStatManager.addMeasure ("MCIntegrationRunningTime", + lMCIntegrationTime); } // ////////////////////////////////////////////////////////////////////// @@ -129,6 +136,21 @@ // ////////////////////////////////////////////////////////////////////// void Optimiser:: + heuristicOptimisationByEmsr (const ResourceCapacity_T iCabinCapacity, + BucketHolder& ioBucketHolder, + BidPriceVector_T& ioBidPriceVector, + StudyStatManager& ioStudyStatManager) { + BasChronometer lEMRSBasChrono; + lEMRSBasChrono.start(); + Emsr::heuristicOptimisationByEmsr (iCabinCapacity, + ioBucketHolder, + ioBidPriceVector); + const double lEMRSTime = lEMRSBasChrono.elapsed(); + ioStudyStatManager.addMeasure ("EMSRRunningTime", lEMRSTime); + } + + // ////////////////////////////////////////////////////////////////////// + void Optimiser:: heuristicOptimisationByEmsrA (const ResourceCapacity_T iCabinCapacity, BucketHolder& ioBucketHolder) { Emsr::heuristicOptimisationByEmsrA (iCabinCapacity, ioBucketHolder); Modified: trunk/rmol/rmol/command/Optimiser.hpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.hpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/command/Optimiser.hpp 2009-04-24 08:25:09 UTC (rev 197) @@ -54,7 +54,7 @@ BucketHolder&); /** - EMRS-a algorithm. + EMRS algorithm. <br>The cabin capacity is used to a double to allow for some overbooking. */ @@ -63,13 +63,20 @@ BidPriceVector_T&); /** + EMRS algorithm with StudyStatManager. + */ + static void heuristicOptimisationByEmsr (const ResourceCapacity_T, + BucketHolder&, BidPriceVector_T&, + StudyStatManager&); + + /** EMRS-a algorithm. <br>The cabin capacity is used to a double to allow for some overbooking. */ static void heuristicOptimisationByEmsrA (const ResourceCapacity_T, BucketHolder&); - + /** EMRS-b algorithm. <br>The cabin capacity is used to a double to allow for some Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-23 17:25:20 UTC (rev 196) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-24 08:25:09 UTC (rev 197) @@ -180,21 +180,34 @@ BucketHolder* ioBucketHolder_ptr = _rmolServiceContext->getBucketHolder(); assert (ioBucketHolder_ptr != NULL); BidPriceVector_T lBidPriceVector; - - Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, - lBidPriceVector); - + + StudyStatManager* lStudyStatManager_ptr = + _rmolServiceContext->getStudyStatManager(); + + if (lStudyStatManager_ptr == NULL) { + Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, + lBidPriceVector); + } else { + Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, + lBidPriceVector, + *lStudyStatManager_ptr); + } + // DEBUG RMOL_LOG_DEBUG (ioBucketHolder_ptr->display()); + std::ostringstream logStream; + logStream << "Bid-Price Vector (BPV): "; + unsigned int size = lBidPriceVector.size(); - // std::cout << "Bid-Price Vector (BPV): "; - // unsigned int size = lBidPriceVector.size(); + for (unsigned int i = 0; i < size; ++i) { + const double bidPrice = lBidPriceVector.at(i); + logStream << std::fixed << std::setprecision (2) << bidPrice << " "; + } + RMOL_LOG_DEBUG (logStream.str()); - // for (unsigned int i = 0; i < size; ++i) { - // const double bidPrice = lBidPriceVector.at(i); - // std::cout << std::fixed << std::setprecision (2) << bidPrice << " "; - // } - // std::cout << std::endl; + if (lStudyStatManager_ptr != NULL) { + RMOL_LOG_DEBUG (lStudyStatManager_ptr->describe()); + } } // ////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-04-23 17:25:51
|
Revision: 196 http://rmol.svn.sourceforge.net/rmol/?rev=196&view=rev Author: quannaus Date: 2009-04-23 17:25:20 +0000 (Thu, 23 Apr 2009) Log Message: ----------- Added the BasChoronoter service. Modified Paths: -------------- trunk/rmol/rmol/RMOL_Service.hpp trunk/rmol/rmol/basic/sources.mk trunk/rmol/rmol/bom/MCOptimiser.cpp trunk/rmol/rmol/bom/MCOptimiser.hpp trunk/rmol/rmol/bom/Makefile.am trunk/rmol/rmol/bom/PartialSumHolder.cpp trunk/rmol/rmol/bom/PartialSumHolder.hpp trunk/rmol/rmol/bom/sources.mk trunk/rmol/rmol/command/Optimiser.cpp trunk/rmol/rmol/command/Optimiser.hpp trunk/rmol/rmol/factory/sources.mk trunk/rmol/rmol/rmol.cpp trunk/rmol/rmol/service/RMOL_Service.cpp trunk/rmol/rmol/service/RMOL_ServiceContext.cpp trunk/rmol/rmol/service/RMOL_ServiceContext.hpp trunk/rmol/test/samples/sample4.csv Added Paths: ----------- trunk/rmol/rmol/basic/BasChronometer.cpp trunk/rmol/rmol/basic/BasChronometer.hpp trunk/rmol/rmol/bom/StatAggregatorStruct.cpp trunk/rmol/rmol/bom/StatAggregatorStruct.hpp trunk/rmol/rmol/bom/StatAggregatorStructList.hpp trunk/rmol/rmol/bom/StudyStatManager.cpp trunk/rmol/rmol/bom/StudyStatManager.hpp trunk/rmol/rmol/factory/FacStudyStatManager.cpp trunk/rmol/rmol/factory/FacStudyStatManager.hpp Modified: trunk/rmol/rmol/RMOL_Service.hpp =================================================================== --- trunk/rmol/rmol/RMOL_Service.hpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/RMOL_Service.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -23,6 +23,9 @@ /** Destructor. */ ~RMOL_Service(); + /** Set up the StudyStatManager. */ + void setUpStudyStatManager (); + /** Add a bucket to the context. */ void addBucket (const double iYieldRange, const double iDemandMean, const double iDemandStandardDev); Added: trunk/rmol/rmol/basic/BasChronometer.cpp =================================================================== --- trunk/rmol/rmol/basic/BasChronometer.cpp (rev 0) +++ trunk/rmol/rmol/basic/BasChronometer.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,50 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// Rmol +#include <rmol/basic/BasChronometer.hpp> +#include <rmol/service/Logger.hpp> + +namespace RMOL { + + // ////////////////////////////////////////////////////////////////////// + BasChronometer::BasChronometer () : _startTimeLaunched (false) { + } + + // ////////////////////////////////////////////////////////////////////// + void BasChronometer::start () { + // Get the time-stamp of now, and store it for later use + _startTime = boost::posix_time::microsec_clock::local_time(); + + // Update the boolean which states whether the chronometer + // is launched + _startTimeLaunched = true; + } + + // ////////////////////////////////////////////////////////////////////// + double BasChronometer::elapsed () const { + assert (_startTimeLaunched == true); + + // Get the time-stamp of now + const boost::posix_time::ptime lStopTime = + boost::posix_time::microsec_clock::local_time(); + + // Calculate the time elapsed since the last time-stamp + const boost::posix_time::time_duration lElapsedTime = + lStopTime - _startTime; + + // Derived the corresponding number of milliseconds + const double lElapsedTimeInMicroSeconds = + static_cast<const double> (lElapsedTime.total_microseconds()); + + /*RMOL_LOG_DEBUG ("Elapsed: " << lElapsedTime + << "; (micros): " + << lElapsedTimeInMicroSeconds / 1e6);*/ + + // The elapsed time given in return is expressed in seconds + return (lElapsedTimeInMicroSeconds / 1e6); + } + +} Added: trunk/rmol/rmol/basic/BasChronometer.hpp =================================================================== --- trunk/rmol/rmol/basic/BasChronometer.hpp (rev 0) +++ trunk/rmol/rmol/basic/BasChronometer.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,40 @@ +#ifndef __RMOL_COM_BAS_BASCHRONOMETER_HPP +#define __RMOL_COM_BAS_BASCHRONOMETER_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// Boost Date-Time (http://boost.org/doc/html/date_time/posix_time.html) +#include <boost/date_time/posix_time/posix_time.hpp> + +namespace RMOL { + + /** Structure allowing measuring the time elapsed between two events. */ + struct BasChronometer { + /** Constructor. */ + BasChronometer(); + + /** Start the chronometer from the local time + <br>The elapsed time given is the one elapsed since the start + is launched. */ + void start (); + + /** Get the start time. */ + std::string getStart () const { + return boost::posix_time::to_simple_string (_startTime); + } + + /** Return the time elapsed since the structure has been instanciated. + <br>That elapsed time is expressed in seconds. */ + double elapsed () const; + + private: + /** Start time. */ + boost::posix_time::ptime _startTime; + + /** Boolean which states whether the chronometer is started or not.*/ + bool _startTimeLaunched; + }; + +} +#endif // __RMOL_COM_BAS_BASCHRONOMETER_HPP Modified: trunk/rmol/rmol/basic/sources.mk =================================================================== --- trunk/rmol/rmol/basic/sources.mk 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/basic/sources.mk 2009-04-23 17:25:20 UTC (rev 196) @@ -1,4 +1,6 @@ bas_h_sources = $(top_srcdir)/rmol/basic/BasConst_General.hpp \ $(top_srcdir)/rmol/basic/BasConst_Overbooking.hpp \ - $(top_srcdir)/rmol/basic/BasConst_RMOL_Service.hpp -bas_cc_sources = $(top_srcdir)/rmol/basic/BasConst.cpp + $(top_srcdir)/rmol/basic/BasConst_RMOL_Service.hpp \ + $(top_srcdir)/rmol/basic/BasChronometer.hpp +bas_cc_sources = $(top_srcdir)/rmol/basic/BasConst.cpp \ + $(top_srcdir)/rmol/basic/BasChronometer.cpp Modified: trunk/rmol/rmol/bom/MCOptimiser.cpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -4,9 +4,13 @@ // C #include <assert.h> // STL +#include <string> +#include <fstream> #include <iostream> #include <cmath> // RMOL +#include <rmol/basic/BasChronometer.hpp> +#include <rmol/bom/StudyStatManager.hpp> #include <rmol/bom/VariateList.hpp> #include <rmol/bom/Gaussian.hpp> #include <rmol/bom/Bucket.hpp> @@ -163,27 +167,18 @@ /** Compute the Bid-Price (Opportunity Cost) at index x (capacity) for x between y(j-1) et y(j). This OC can be proven to be equal to p(j)*Proba(D1+...+Dk>=x | D1 > y1, - D1+D2 > y2, ..., D1+...+D(k-1) > y(k-1)). */ + D1+D2 > y2, ..., D1+...+D(k-1) > y(k-1)). + */ // Get the previous cumulated protection y(j-1). const double yjm1 = ioBucketHolder.getPreviousCumulatedProtection (); const int yjm1int = static_cast<int> (yjm1); const int yjint = static_cast<int> (yj); int currentIndex = 0; - double currentPartialSum = - currentPartialSumList.getPartialSum (currentIndex); - int x = 0; - - for (x = yjm1int + 1; x <= yjint && x <= cabinCapacityInt; ++x) { - while (currentPartialSum < x) { - ++currentIndex; - if (currentIndex < Kj) { - currentPartialSum = - currentPartialSumList.getPartialSum (currentIndex); - } else { - currentPartialSum = x; - } - } + + for (int x = yjm1int + 1; + x <= yjint && x <= cabinCapacityInt; ++x) { + currentIndex = currentPartialSumList.getLowerBound (x); const double bidPriceAtX = pj * (Kj - currentIndex) / Kj; ioBidPriceVector.push_back (bidPriceAtX); } @@ -238,18 +233,8 @@ const int ynm1int = static_cast<int> (ynm1); const double pn = currentBucket.getAverageYield(); int currentIndex = 0; - double currentPartialSum = - currentPartialSumList.getPartialSum (currentIndex); for (int x = ynm1int + 1; x <= cabinCapacityInt; ++x) { - while (currentPartialSum < x) { - ++currentIndex; - if (currentIndex < Kj) { - currentPartialSum = - currentPartialSumList.getPartialSum (currentIndex); - } else { - currentPartialSum = x; - } - } + currentIndex = currentPartialSumList.getLowerBound (x); const double bidPriceAtX = pn * (Kj - currentIndex) / Kj; ioBidPriceVector.push_back (bidPriceAtX); } @@ -262,4 +247,259 @@ ioBucketHolder.recalculate (); } + // ////////////////////////////////////////////////////////////////////// + void MCOptimiser:: + optimalOptimisationByMCIntegration(const int K, + const ResourceCapacity_T iCabinCapacity, + BucketHolder& ioBucketHolder, + PartialSumHolderHolder& ioPSHolderHolder, + BidPriceVector_T& ioBidPriceVector, + StudyStatManager& ioStudyStatManager){ + // Retrieve the BucketHolder + // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); + + BasChronometer lWithdrawBasChronometer; + BasChronometer lSortBasChronometer; + BasChronometer lBVPCalculationBasChronometer; + + // Number of classes/buckets: n + const short nbOfClasses = ioBucketHolder.getSize(); + + /** + Initialise the partial sum vector representing the last step within + the algorithm below. + <br>At the beginning of the algorithm, the partial sums need to be + null. Then, the generated demand (variates) will be added + incrementally. + */ + ioPSHolderHolder.begin(); + PartialSumHolder& firstPartialSumHolder = + ioPSHolderHolder.getCurrentPartialSumHolder(); + firstPartialSumHolder.initSize (K); + + for (int k=1 ; k <= K; k++) { + firstPartialSumHolder.addPartialSum (0.0); + } + + /** + Iterate on the classes/buckets, from 1 to n-1. + Note that n-1 corresponds to the size of the parameter list, + i.e., n corresponds to the number of classes/buckets. + */ + ioBucketHolder.begin(); + ioPSHolderHolder.iterate(); + int Kj = K; + int lj = 0; + const int cabinCapacityInt = static_cast<int> (iCabinCapacity); + for (short j = 1 ; j <= nbOfClasses - 1; + ++j, ioBucketHolder.iterate(), ioPSHolderHolder.iterate()) { + /** Retrieve Bucket(j) (current) and Bucket(j+1) (next). */ + Bucket& currentBucket = ioBucketHolder.getCurrentBucket(); + Bucket& nextBucket = ioBucketHolder.getNextBucket(); + + // STEP 1. + /** + Initialise the random generator with the distribution parameters of + the demand for the current class/bucket, j. + */ + const FldDistributionParameters& aDistribParams = + currentBucket.getDistributionParameters(); + const Gaussian gaussianDemandGenerator (aDistribParams); + + /** DEBUG + std::cout << "[" << j << "]: " << Kj << " values with N ( " + << aDistribParams.getMean() << ", " + << aDistribParams.getStandardDeviation() << ")." << std::endl; + */ + + /** + Iterate on the random draws: generate random variates, d(j,k) + for the current class/bucket demand, j, and for k=1 to Kj. + */ + VariateList_T aVariateList; + + PartialSumHolder& previousPartialSumList = + ioPSHolderHolder.getPreviousPartialSumHolder(); + PartialSumHolder& currentPartialSumList = + ioPSHolderHolder.getCurrentPartialSumHolder(); + currentPartialSumList.initSize (Kj); + lWithdrawBasChronometer.start(); + for (int k=1; k <= Kj; k++) { + const double djk = gaussianDemandGenerator.generateVariate(); + aVariateList.push_back (djk); + + /** + Calculate the partial sums: + <br> + S(j,k)= d(1,k) + d(2,k) + ... + d(j,k),for a given k and j=1 to n-1 + Note that n-1 corresponds to the size of the parameter list, + i.e., n corresponds to the number of classes/buckets. + <br> + Hence: S(j,k) = S'(j-1, l+k) + d(j,k). + */ + const double spjm1lpk = + previousPartialSumList.getPartialSum (lj + k - 1); + const double sjk = spjm1lpk + djk; + currentPartialSumList.addPartialSum (sjk); + + /* DEBUG + std::cout << "d(" << j << ", " << k << "); " << djk + << "; S'(" << j-1 << ", " << lj+k << "); " << spjm1lpk + << "; S(" << j << ", " << k << "); " << sjk << std::endl; + */ + } + + const double lWithdrawTimeValue = lWithdrawBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("WithdrawTime", lWithdrawTimeValue); + + // STEP 2. + /** + Sort the partial sum vectors S(j,k) on k, for the current j. + */ + lSortBasChronometer.start(); + currentPartialSumList.sort (); + const double lSortTimeValue = lSortBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("SortTime", lSortTimeValue); + + /** Retrieve the prices for Bucket(j) and Bucket(j+1). */ + const double pj = currentBucket.getAverageYield(); + const double pj1 = nextBucket.getAverageYield(); + + /** Consistency check: the yield/price of a higher class/bucket + (with the j index lower) must be higher. */ + assert (pj > pj1); + + /** + The optimal index is defined as: + lj = floor {[p(j)-p(j+1)]/p(j) . K} + */ + const double ljdouble = std::floor (Kj * (pj - pj1) / pj); + lj = static_cast<int> (ljdouble); + + /** DEBUG + std::cout << "p(j+1)/p(j) = " << pj1 / pj << ", lj = " << lj + << ", Kj = " << Kj << " => " << Kj - lj << " points above y(j)" + << std::endl; + */ + + /** Consistency check. */ + assert (lj >= 1 && lj < Kj); + + /** + The optimal protection is defined as: + y(j) = 1/2 [S(j,lj) + S(j, lj+1)] + */ + const double sjl = currentPartialSumList.getPartialSum (lj - 1); + const double sjlp1 = currentPartialSumList.getPartialSum (lj + 1 - 1); + const double yj = (sjl + sjlp1) / 2; + + /** DEBUG + std::cout << "S(j,l) = " << sjl << ", S(j,l+1) = " << sjlp1 + << ", y(j) = " << yj << std::endl; + */ + + // Set the cumulated protection for Bucket(j) (j ranging from 1 to n-1) + currentBucket.setCumulatedProtection (yj); + + /** Compute the Bid-Price (Opportunity Cost) at index x + (capacity) for x between y(j-1) et y(j). This OC can be + proven to be equal to p(j)*Proba(D1+...+Dk>=x | D1 > y1, + D1+D2 > y2, ..., D1+...+D(k-1) > y(k-1)). + */ + + // Get the previous cumulated protection y(j-1). + const double yjm1 = ioBucketHolder.getPreviousCumulatedProtection (); + const int yjm1int = static_cast<int> (yjm1); + const int yjint = static_cast<int> (yj); + int currentIndex = 0; + + lBVPCalculationBasChronometer.start(); + for (int x = yjm1int + 1; + x <= yjint && x <= cabinCapacityInt; ++x) { + currentIndex = currentPartialSumList.getLowerBound (x); + const double bidPriceAtX = pj * (Kj - currentIndex) / Kj; + ioBidPriceVector.push_back (bidPriceAtX); + } + const double lBVPCalculationTimeValue = + lBVPCalculationBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("BVPCalculationTime", + lBVPCalculationTimeValue); + + /** Update Kj for the next loop. */ + Kj = Kj - lj; + + /** S'(j,k) = S(j,k). + <br>The previousPartialSumList (S') now becomes equal to the + currentPartialSumList (S) (by iteration on ioPSHolderHolder). */ + } + + // Set the protection of Bucket(n) to be equal to the capacity + Bucket& currentBucket = ioBucketHolder.getCurrentBucket(); + currentBucket.setCumulatedProtection (iCabinCapacity); + + /** Compute the Bid-Price (Opportunity Cost) at index x + (capacity) for x between y(n-1) et cabin capacity. This OC can be + proven to be equal to p(n)*Proba(D1+...+Dn>=x | D1 > y1, + D1+D2 > y2, ..., D1+...+D(n-1) > y(n-1)). */ + + // Get the previous cumulated protection y(n-1). + const double ynm1 = ioBucketHolder.getPreviousCumulatedProtection (); + + if (ynm1 < iCabinCapacity) { + // STEP 1. + const FldDistributionParameters& aDistribParams = + currentBucket.getDistributionParameters(); + const Gaussian gaussianDemandGenerator (aDistribParams); + + VariateList_T aVariateList; + + PartialSumHolder& previousPartialSumList = + ioPSHolderHolder.getPreviousPartialSumHolder(); + PartialSumHolder& currentPartialSumList = + ioPSHolderHolder.getCurrentPartialSumHolder(); + currentPartialSumList.initSize (Kj); + + lWithdrawBasChronometer.start(); + for (int k = 1; k <= Kj; ++k) { + const double djk = gaussianDemandGenerator.generateVariate(); + aVariateList.push_back (djk); + + const double spjm1lpk = + previousPartialSumList.getPartialSum (lj + k - 1); + const double sjk = spjm1lpk + djk; + currentPartialSumList.addPartialSum (sjk); + } + + const double lWithdrawTimeValue = lWithdrawBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("WithdrawTime", lWithdrawTimeValue); + + // STEP 2. + lSortBasChronometer.start(); + currentPartialSumList.sort (); + const double lSortTimeValue = lSortBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("SortTime", lSortTimeValue); + + const int ynm1int = static_cast<int> (ynm1); + const double pn = currentBucket.getAverageYield(); + int currentIndex = 0; + + lBVPCalculationBasChronometer.start(); + for (int x = ynm1int + 1; x <= cabinCapacityInt; ++x) { + currentIndex = currentPartialSumList.getLowerBound (x); + const double bidPriceAtX = pn * (Kj - currentIndex) / Kj; + ioBidPriceVector.push_back (bidPriceAtX); + } + const double lBVPCalculationTimeValue = + lBVPCalculationBasChronometer.elapsed(); + ioStudyStatManager.addMeasure ("BVPCalculationTime", + lBVPCalculationTimeValue); + } + + /** + Re-calculate the values (protections, bkg limits and cumulated + booking limits, the optimal revenue. + */ + ioBucketHolder.recalculate (); + } + } Modified: trunk/rmol/rmol/bom/MCOptimiser.hpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -13,7 +13,8 @@ //class Resource; class BucketHolder; class PartialSumHolderHolder; - + class StudyStatManager; + /** Utility methods for the Monte-Carlo algorithms. */ class MCOptimiser { public: @@ -35,6 +36,15 @@ BucketHolder&, PartialSumHolderHolder&, BidPriceVector_T&); + /** + Monte Carlo algorithm with StudyStatManager. + */ + static void optimalOptimisationByMCIntegration (const int K, + const ResourceCapacity_T, + BucketHolder&, + PartialSumHolderHolder&, + BidPriceVector_T&, + StudyStatManager&); }; } #endif // __RMOL_BOM_MCUTILS_HPP Modified: trunk/rmol/rmol/bom/Makefile.am =================================================================== --- trunk/rmol/rmol/bom/Makefile.am 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/Makefile.am 2009-04-23 17:25:20 UTC (rev 196) @@ -7,11 +7,11 @@ noinst_LTLIBRARIES += libbom_debug.la endif libbom_la_SOURCES= $(bom_h_sources) $(bom_cc_sources) -libbom_la_CXXFLAGS = $(CXXFLAGS_OPT) $(GSL_CFLAGS) +libbom_la_CXXFLAGS = $(CXXFLAGS_OPT) $(GSL_CFLAGS) $(BOOST_CFLAGS) libbom_la_LIBADD = $(GSL_LIBS) libbom_debug_la_SOURCES = $(bom_h_sources) $(bom_cc_sources) -libbom_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) $(GSL_CFLAGS) +libbom_debug_la_CXXFLAGS = $(CXXFLAGS_DEBUG) $(GSL_CFLAGS) $(BOOST_CFLAGS) libbom_debug_la_LIBADD = $(GSL_LIBS) #pkgincludedir = $(includedir)/@PACKAGE@/bom Modified: trunk/rmol/rmol/bom/PartialSumHolder.cpp =================================================================== --- trunk/rmol/rmol/bom/PartialSumHolder.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/PartialSumHolder.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -94,4 +94,12 @@ std::sort (_partialSumList.begin(), _partialSumList.end()); } + // ////////////////////////////////////////////////////////////////////// + const int PartialSumHolder::getLowerBound (const double& value) const { + PartialSumList_T::const_iterator itLowerBound = + std::lower_bound (_partialSumList.begin(), _partialSumList.end() , value); + const int position = itLowerBound - _partialSumList.begin(); + return position; + } + } Modified: trunk/rmol/rmol/bom/PartialSumHolder.hpp =================================================================== --- trunk/rmol/rmol/bom/PartialSumHolder.hpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/PartialSumHolder.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -25,6 +25,10 @@ /** Get the k-th element (partial sum). */ const double getPartialSum (const int k) const; + /** Get the position of the first element that is equal or greater + than the given value. */ + const int getLowerBound (const double& value) const; + /** Reserve the space for K elements (partial sums). */ void initSize (const int K); Added: trunk/rmol/rmol/bom/StatAggregatorStruct.cpp =================================================================== --- trunk/rmol/rmol/bom/StatAggregatorStruct.cpp (rev 0) +++ trunk/rmol/rmol/bom/StatAggregatorStruct.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,89 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STL +#include <limits> +#include <stdexcept> +// RMOL +#include <rmol/service/Logger.hpp> +#include <rmol/bom/StatAggregatorStruct.hpp> + +namespace RMOL { + + // ////////////////////////////////////////////////////////////////////// + StatAggregatorStruct_T:: + StatAggregatorStruct_T (const StudyStatManager& iStudyStatMgr, + const std::string& iKey) : + _studyStatMgr (iStudyStatMgr), _key (iKey), + _nbOfEvents (0), + _minimal (std::numeric_limits<int>::max()), + _maximal (std::numeric_limits<int>::min()), + _average (0.0), + _totalTime (0.0){ + } + + // ////////////////////////////////////////////////////////////////////// + StatAggregatorStruct_T::StatAggregatorStruct_T + (const StatAggregatorStruct_T& iStatAggregatorStruct) + : _studyStatMgr (iStatAggregatorStruct.getStudyStatMgr()), + _key (iStatAggregatorStruct.getPrimaryKey()), + _nbOfEvents (iStatAggregatorStruct.getNumberOfEvents()), + _minimal (iStatAggregatorStruct.getMinimum()), + _maximal (iStatAggregatorStruct.getMaximum()), + _average (iStatAggregatorStruct.getAverage()), + _totalTime (iStatAggregatorStruct.getTotalTime()){ + } + + // ////////////////////////////////////////////////////////////////////// + const std::string StatAggregatorStruct_T::describeCurrentSimu() const { + std::ostringstream ostr; + ostr << describeKey() << " - nb of events: " << _nbOfEvents << ", min: " + << _minimal << ", max: " << _maximal << ", average :" << _average + << ", total time: " << _totalTime; + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string StatAggregatorStruct_T::describe() const { + std::ostringstream ostr; + ostr << describeKey() << " - nb of events: " << _nbOfEvents << ", min: " + << _minimal << ", max: " << _maximal << ", average :" << _average + << ", average total time: " << _totalTime; + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string StatAggregatorStruct_T::describeKey() const { + return _key; + } + + // ////////////////////////////////////////////////////////////////////// + void StatAggregatorStruct_T::display() const { + std::cout << describe() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void StatAggregatorStruct_T::addMeasure(const double iMeasure) { + // Set a new minimal value if the measure is lower than the minimum + if (iMeasure < _minimal) { + _minimal = iMeasure; + } + + // Set a new maximal value if the measure is greater than the maximum + if (iMeasure > _maximal) { + _maximal = iMeasure; + } + + // adding up the new measure to the average + _average = (_average * _nbOfEvents + iMeasure ) / (_nbOfEvents+1); + + // Increment the total time spent + _totalTime += iMeasure; + + // increment the number of event + _nbOfEvents++; + } + +} Added: trunk/rmol/rmol/bom/StatAggregatorStruct.hpp =================================================================== --- trunk/rmol/rmol/bom/StatAggregatorStruct.hpp (rev 0) +++ trunk/rmol/rmol/bom/StatAggregatorStruct.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,110 @@ +#ifndef __RMOL_BOM_STATAGGREGATORSTRUCT_HPP +#define __RMOL_BOM_STATAGGREGATORSTRUCT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iostream> +#include <string> + +namespace RMOL { + + // Forward declarations + class StudyStatManager; + + /** Utility Structure for the aggregator of statistic values. */ + struct StatAggregatorStruct_T { + /** Constructors. */ + StatAggregatorStruct_T (const StudyStatManager&, + const std::string&); + + StatAggregatorStruct_T (const StatAggregatorStruct_T&); + + // /////////// Getters ////////////// + /** Get the parent class. */ + const StudyStatManager& getParent() const { + return getStudyStatMgr(); + } + + /** Get the StudyStatManager (parent class). */ + const StudyStatManager& getStudyStatMgr() const { + return _studyStatMgr; + } + + /** Get the primary key. */ + const std::string getPrimaryKey() const { + return getStatAggregatorStructKey(); + } + + /** Get the StatAggregatorStruct key. */ + const std::string getStatAggregatorStructKey() const { + return _key; + } + + /** Get the number of events. */ + const unsigned int getNumberOfEvents() const { + return _nbOfEvents; + } + + /** Get the minimal value. */ + const double getMinimum() const { + return _minimal; + } + + /** Get the maximal value. */ + const double getMaximum() const { + return _maximal; + } + + /** Get the average value. */ + const double getAverage() const { + return _average; + } + + /** Get the total time value (in seconds). */ + const double getTotalTime() const { + return _totalTime; + } + + // ///////// Setters ////////// + + // ///////// Display Methods ////////// + /** Give a description of the structure for the current simulation. */ + const std::string describeCurrentSimu() const; + + /** Give a description of the structure (which is a resume of statistics + from all simulation runs). */ + const std::string describe() const; + + /** Get a string describing the key. */ + const std::string describeKey() const; + + /** Display the StatAggregatorStruct context. */ + void display() const; + + // ///////// Business Methods ////////// + /** add meassure. */ + void addMeasure (const double); + + private: + // /////////////// Attributes ////////// + // Parent + /** Parent class: StudyStatManager. */ + const StudyStatManager& _studyStatMgr; + + // Primary Key + /** StatAggregatorStruct Key is composed of a dedicated string. */ + std::string _key; + + // Attributes + unsigned int _nbOfEvents; + double _minimal; + double _maximal; + double _average; + double _totalTime; + + }; + +} +#endif // __RMOL_BOM_STATAGGREGATORSTRUCT_HPP Added: trunk/rmol/rmol/bom/StatAggregatorStructList.hpp =================================================================== --- trunk/rmol/rmol/bom/StatAggregatorStructList.hpp (rev 0) +++ trunk/rmol/rmol/bom/StatAggregatorStructList.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,19 @@ +#ifndef __RMOL_BOM_STATAGGREGATORSTRUCTLIST_HPP +#define __RMOL_BOM_STATAGGREGATORSTRUCTLIST_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <string> +#include <map> + +namespace RMOL { + + /** Forward declarations. */ + struct StatAggregatorStruct_T; + + /** Define list of statistic aggregators. */ + typedef std::map<std::string, StatAggregatorStruct_T> StatAggregatorStructList_T; +} +#endif // __RMOL_BOM_STATAGGREGATORSTRUCTLIST_HPP Added: trunk/rmol/rmol/bom/StudyStatManager.cpp =================================================================== --- trunk/rmol/rmol/bom/StudyStatManager.cpp (rev 0) +++ trunk/rmol/rmol/bom/StudyStatManager.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,119 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STL +#include <limits> +// RMOL Common +#include <rmol/service/Logger.hpp> +#include <rmol/bom/StatAggregatorStruct.hpp> +#include <rmol/bom/StudyStatManager.hpp> + +namespace RMOL { + + // ////////////////////////////////////////////////////////////////////// + StudyStatManager::StudyStatManager () { + } + + // ////////////////////////////////////////////////////////////////////// + StudyStatManager::~StudyStatManager () { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string StudyStatManager::describe() const { + std::ostringstream ostr; + + for (StatAggregatorStructList_T::const_iterator itStatAggregatorStruct = + _statAggregatorStructList.begin(); + itStatAggregatorStruct != _statAggregatorStructList.end(); + ++itStatAggregatorStruct) { + const StatAggregatorStruct_T& lStatAggregatorStruct = + itStatAggregatorStruct->second; + + ostr << lStatAggregatorStruct.describeCurrentSimu() << std::endl; + } + + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + void StudyStatManager::display() const { + + // Store current formatting flags of std::cout + std::ios::fmtflags oldFlags = std::cout.flags(); + + for (StatAggregatorStructList_T::const_iterator itStatAggregatorStruct = + _statAggregatorStructList.begin(); + itStatAggregatorStruct != _statAggregatorStructList.end(); + ++itStatAggregatorStruct) { + const StatAggregatorStruct_T& lStatAggregatorStruct = + itStatAggregatorStruct->second; + + std::cout << lStatAggregatorStruct.describeCurrentSimu() << std::endl; + } + + // Reset formatting flags of std::cout + std::cout.flags (oldFlags); + } + + // ////////////////////////////////////////////////////////////////////// + StatAggregatorStruct_T& StudyStatManager:: + getStatAggregator(const std::string& iStatAggregatorName) { + StatAggregatorStructList_T::iterator itAggregatorStruct = + _statAggregatorStructList.find (iStatAggregatorName); + + // If the StatAggregatorStruct does not exist, it is created + if (itAggregatorStruct == _statAggregatorStructList.end()) { + StatAggregatorStruct_T lStatAggregatorStruct (*this, iStatAggregatorName); + _statAggregatorStructList. + insert (StatAggregatorStructList_T:: + value_type (lStatAggregatorStruct.describeKey(), + lStatAggregatorStruct)); + itAggregatorStruct = + _statAggregatorStructList.find (iStatAggregatorName); + } + + return itAggregatorStruct->second; + } + + // ////////////////////////////////////////////////////////////////////// + void StudyStatManager::addMeasure (const std::string iStatAggregatorName, + const double iMeasureValue) { + // retrieve the corresponding statAggregator or create it + StatAggregatorStruct_T& lStatAggregator = + getStatAggregator(iStatAggregatorName); + + // add new measure + lStatAggregator.addMeasure(iMeasureValue); + } + + + // ////////////////////////////////////////////////////////////////////// + const std::string StudyStatManager::describeShortKey() const { + std::ostringstream oStr; + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string StudyStatManager::describeKey() const { + return describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + std::string StudyStatManager::toString() const { + std::ostringstream oStr; + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + void StudyStatManager::toStream (std::ostream& ioOut) const { + ioOut << toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void StudyStatManager::fromStream (std::istream& ioIn) { + } + + +} Added: trunk/rmol/rmol/bom/StudyStatManager.hpp =================================================================== --- trunk/rmol/rmol/bom/StudyStatManager.hpp (rev 0) +++ trunk/rmol/rmol/bom/StudyStatManager.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,77 @@ +#ifndef __RMOL_BOM_STUDYSTATMANAGER_HPP +#define __RMOL_BOM_STUDYSTATMANAGER_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// RMOL +#include <rmol/bom/BomAbstract.hpp> +#include <rmol/bom/StatAggregatorStructList.hpp> + +namespace RMOL { + + /** Class managing all the statistics in the process. */ + class StudyStatManager : public BomAbstract { + friend class FacStudyStatManager; + public: + // /////////// Getters ////////////// + /** Function which returns the statAggregatorStruct corresponding + to the string given in parameter. + If it does not exist, it is created.*/ + StatAggregatorStruct_T& getStatAggregator(const std::string&); + + // ///////// Busines methods ////////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream&) const; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream&); + + /** Get the serialised version of the Place object. */ + std::string toString() const; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + /** Setting up a measure. */ + void addMeasure (const std::string, const double); + + // ///////// Display Methods ////////// + /** Give a description of the statistics (for display purposes). */ + const std::string describe() const; + + /** Display the full StudyStatManager context. */ + void display() const; + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + StudyStatManager (); + StudyStatManager (const StudyStatManager&); + + /** Destructor. */ + virtual ~StudyStatManager(); + + /** Get the list of stat aggregators for the current simulation. */ + StatAggregatorStructList_T& getStatAggregatorStructList() { + return _statAggregatorStructList; + } + + private: + + /** StatAggregatorStructList_T which is a STL map linking + StatAggregatorStruct Keys and StatAggregatorStruct for the + current simulation. */ + StatAggregatorStructList_T _statAggregatorStructList; + }; + +} +#endif // __RMOL_BOM_STUDYSTATMANAGER_HPP Modified: trunk/rmol/rmol/bom/sources.mk =================================================================== --- trunk/rmol/rmol/bom/sources.mk 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/bom/sources.mk 2009-04-23 17:25:20 UTC (rev 196) @@ -15,7 +15,10 @@ $(top_srcdir)/rmol/bom/Overbooking.hpp \ $(top_srcdir)/rmol/bom/MCOptimiser.hpp \ $(top_srcdir)/rmol/bom/DPOptimiser.hpp \ - $(top_srcdir)/rmol/bom/MAForecast.hpp + $(top_srcdir)/rmol/bom/MAForecast.hpp \ + $(top_srcdir)/rmol/bom/StatAggregatorStruct.hpp \ + $(top_srcdir)/rmol/bom/StatAggregatorStructList.hpp \ + $(top_srcdir)/rmol/bom/StudyStatManager.hpp bom_cc_sources = $(top_srcdir)/rmol/bom/BomAbstract.cpp \ $(top_srcdir)/rmol/bom/Bucket.cpp \ $(top_srcdir)/rmol/bom/BucketHolder.cpp \ @@ -28,5 +31,7 @@ $(top_srcdir)/rmol/bom/Overbooking.cpp \ $(top_srcdir)/rmol/bom/MCOptimiser.cpp \ $(top_srcdir)/rmol/bom/DPOptimiser.cpp \ - $(top_srcdir)/rmol/bom/MAForecast.cpp + $(top_srcdir)/rmol/bom/MAForecast.cpp \ + $(top_srcdir)/rmol/bom/StatAggregatorStruct.cpp \ + $(top_srcdir)/rmol/bom/StudyStatManager.cpp Modified: trunk/rmol/rmol/command/Optimiser.cpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/command/Optimiser.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -62,6 +62,45 @@ // ////////////////////////////////////////////////////////////////////// void Optimiser:: + optimalOptimisationByMCIntegration (const int K, + const ResourceCapacity_T iCabinCapacity, + BucketHolder& ioBucketHolder, + BidPriceVector_T& ioBidPriceVector, + StudyStatManager& ioStudyStatManager) { + // Retrieve the BucketHolder + // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); + + // Number of classes/buckets: n + const short nbOfClasses = ioBucketHolder.getSize(); + + // Create a holder for the list of Partial Sum Lists + PartialSumHolderHolder& aPartialSumHolderHolder = + FacPartialSumHolderHolder::instance().create(); + + /** + Instanciate the list of PartialSumHolder objects. + Iterate on the classes/buckets, from 1 to n-1. + Note that n-1 corresponds to the size of the parameter list, + i.e., n corresponds to the number of classes/buckets. + */ + for (short j = 0 ; j <= nbOfClasses; ++j) { + PartialSumHolder& aPartialSumList = + FacPartialSumHolder::instance().create (); + + FacPartialSumHolderHolder::instance(). + addPartialSumHolder (aPartialSumHolderHolder, aPartialSumList); + } + + // Call the class performing the actual algorithm + MCOptimiser::optimalOptimisationByMCIntegration (K, iCabinCapacity, + ioBucketHolder, + aPartialSumHolderHolder, + ioBidPriceVector, + ioStudyStatManager); + } + + // ////////////////////////////////////////////////////////////////////// + void Optimiser:: optimalOptimisationByDP (const ResourceCapacity_T iCabinCapacity, BucketHolder& ioBucketHolder) { BidPriceVector_T lBidPriceVector; Modified: trunk/rmol/rmol/command/Optimiser.hpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.hpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/command/Optimiser.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -12,6 +12,7 @@ /** Forward declarations. */ //class Resource; class BucketHolder; + class StudyStatManager; /** Class wrapping the optimisation algorithms. */ class Optimiser { @@ -34,6 +35,15 @@ const ResourceCapacity_T, BucketHolder&, BidPriceVector_T&); + + /** + Monte Carlo Integartion algorithm with StudyStatManager. + */ + static void optimalOptimisationByMCIntegration (const int K, + const ResourceCapacity_T, + BucketHolder&, + BidPriceVector_T&, + StudyStatManager&); /** Dynamic Programming. Added: trunk/rmol/rmol/factory/FacStudyStatManager.cpp =================================================================== --- trunk/rmol/rmol/factory/FacStudyStatManager.cpp (rev 0) +++ trunk/rmol/rmol/factory/FacStudyStatManager.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,45 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// RMOL +#include <rmol/bom/StudyStatManager.hpp> +#include <rmol/factory/FacSupervisor.hpp> +#include <rmol/factory/FacStudyStatManager.hpp> +#include <rmol/service/Logger.hpp> + +namespace RMOL { + + FacStudyStatManager* FacStudyStatManager::_instance = NULL; + + // ////////////////////////////////////////////////////////////////////// + FacStudyStatManager::~FacStudyStatManager () { + _instance = NULL; + } + + // ////////////////////////////////////////////////////////////////////// + FacStudyStatManager& FacStudyStatManager::instance () { + + if (_instance == NULL) { + _instance = new FacStudyStatManager(); + assert (_instance != NULL); + + FacSupervisor::instance().registerBomFactory (_instance); + } + return *_instance; + } + + // ////////////////////////////////////////////////////////////////////// + StudyStatManager& FacStudyStatManager::create () { + StudyStatManager* aStudyStatManager_ptr = NULL; + aStudyStatManager_ptr = new StudyStatManager (); + assert (aStudyStatManager_ptr != NULL); + + // The new object is added to the Bom pool + _pool.push_back (aStudyStatManager_ptr); + + return *aStudyStatManager_ptr; + } + +} Added: trunk/rmol/rmol/factory/FacStudyStatManager.hpp =================================================================== --- trunk/rmol/rmol/factory/FacStudyStatManager.hpp (rev 0) +++ trunk/rmol/rmol/factory/FacStudyStatManager.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -0,0 +1,42 @@ +#ifndef __RMOL_FAC_FACSTUDYSTATMANAGER_HPP +#define __RMOL_FAC_FACSTUDYSTATMANAGER_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// RMOL +#include <rmol/factory/FacBomAbstract.hpp> + +namespace RMOL { + + /** Factory for StudyStatManager objects. */ + class FacStudyStatManager : public FacBomAbstract { + public: + /** Provide the unique instance. + <br>The singleton is instantiated when first used + @return FacStudyStatManager& */ + static FacStudyStatManager& instance(); + + /** Destructor. + <br>The Destruction put the _instance to NULL + in order to be clean for the next FacStudyStatManager::instance() */ + virtual ~FacStudyStatManager(); + + /** Create a new FacStudyStatManager object. + <br>This new object is added to the list of instantiated objects. + @return StudyStatManager& The newly created object. */ + StudyStatManager& create (); + + protected: + /** Default Constructor. + <br>This constructor is protected in order to ensure the singleton + pattern.*/ + FacStudyStatManager () {} + + private: + /** The unique instance.*/ + static FacStudyStatManager* _instance; + }; + +} +#endif // __RMOL_FAC_FACSTUDYSTATMANAGER_HPP Modified: trunk/rmol/rmol/factory/sources.mk =================================================================== --- trunk/rmol/rmol/factory/sources.mk 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/factory/sources.mk 2009-04-23 17:25:20 UTC (rev 196) @@ -7,7 +7,8 @@ $(top_srcdir)/rmol/factory/FacBucketHolder.hpp \ $(top_srcdir)/rmol/factory/FacOverbooking.hpp \ $(top_srcdir)/rmol/factory/FacPartialSumHolderHolder.hpp \ - $(top_srcdir)/rmol/factory/FacPartialSumHolder.hpp + $(top_srcdir)/rmol/factory/FacPartialSumHolder.hpp \ + $(top_srcdir)/rmol/factory/FacStudyStatManager.hpp fac_cc_sources = $(top_srcdir)/rmol/factory/FacSupervisor.cpp \ $(top_srcdir)/rmol/factory/FacBomAbstract.cpp \ $(top_srcdir)/rmol/factory/FacServiceAbstract.cpp \ @@ -17,4 +18,5 @@ $(top_srcdir)/rmol/factory/FacBucketHolder.cpp \ $(top_srcdir)/rmol/factory/FacOverbooking.cpp \ $(top_srcdir)/rmol/factory/FacPartialSumHolderHolder.cpp \ - $(top_srcdir)/rmol/factory/FacPartialSumHolder.cpp + $(top_srcdir)/rmol/factory/FacPartialSumHolder.cpp \ + $(top_srcdir)/rmol/factory/FacStudyStatManager.cpp Modified: trunk/rmol/rmol/rmol.cpp =================================================================== --- trunk/rmol/rmol/rmol.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/rmol.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -61,6 +61,7 @@ // Initialise the list of classes/buckets RMOL::RMOL_Service rmolService (logOutputFile, cabinCapacity); + rmolService.setUpStudyStatManager(); if (hasInputFile) { // Read the input file Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -5,6 +5,8 @@ #include <assert.h> // STL #include <iomanip> +#include <sstream> +#include <iostream> // RMOL #include <rmol/basic/BasConst_RMOL_Service.hpp> #include <rmol/field/FldYieldRange.hpp> @@ -12,6 +14,7 @@ #include <rmol/bom/Demand.hpp> #include <rmol/bom/Bucket.hpp> #include <rmol/bom/BucketHolder.hpp> +#include <rmol/bom/StudyStatManager.hpp> #include <rmol/factory/FacRmolServiceContext.hpp> #include <rmol/command/Optimiser.hpp> #include <rmol/service/RMOL_ServiceContext.hpp> @@ -60,6 +63,12 @@ } // ////////////////////////////////////////////////////////////////////// + void RMOL_Service::setUpStudyStatManager () { + assert (_rmolServiceContext != NULL); + _rmolServiceContext->setUpStudyStatManager (); + } + + // ////////////////////////////////////////////////////////////////////// void RMOL_Service::addBucket (const double iYieldRange, const double iDemandMean, const double iDemandStandardDev) { @@ -84,22 +93,35 @@ assert (ioBucketHolder_ptr != NULL); BidPriceVector_T lBidPriceVector; - Optimiser::optimalOptimisationByMCIntegration (K, iCapacity, - *ioBucketHolder_ptr, - lBidPriceVector); + StudyStatManager* lStudyStatManager_ptr = + _rmolServiceContext->getStudyStatManager(); + if (lStudyStatManager_ptr == NULL) { + Optimiser::optimalOptimisationByMCIntegration (K, iCapacity, + *ioBucketHolder_ptr, + lBidPriceVector); + } else { + Optimiser::optimalOptimisationByMCIntegration (K, iCapacity, + *ioBucketHolder_ptr, + lBidPriceVector, + *lStudyStatManager_ptr); + } // DEBUG RMOL_LOG_DEBUG (ioBucketHolder_ptr->display()); - /* - std::cout << "Bid-Price Vector (BPV): "; + + std::ostringstream logStream; + logStream << "Bid-Price Vector (BPV): "; unsigned int size = lBidPriceVector.size(); for (unsigned int i = 0; i < size; ++i) { const double bidPrice = lBidPriceVector.at(i); - std::cout << std::fixed << std::setprecision (2) << bidPrice << " "; + logStream << std::fixed << std::setprecision (2) << bidPrice << " "; } - std::cout << std::endl; - */ + RMOL_LOG_DEBUG (logStream.str()); + + if (lStudyStatManager_ptr != NULL) { + RMOL_LOG_DEBUG (lStudyStatManager_ptr->describe()); + } } // ////////////////////////////////////////////////////////////////////// Modified: trunk/rmol/rmol/service/RMOL_ServiceContext.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_ServiceContext.cpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/service/RMOL_ServiceContext.cpp 2009-04-23 17:25:20 UTC (rev 196) @@ -10,10 +10,12 @@ #include <rmol/bom/Demand.hpp> #include <rmol/bom/Bucket.hpp> #include <rmol/bom/BucketHolder.hpp> +#include <rmol/bom/StudyStatManager.hpp> #include <rmol/factory/FacSupervisor.hpp> #include <rmol/factory/FacDemand.hpp> #include <rmol/factory/FacBucket.hpp> #include <rmol/factory/FacBucketHolder.hpp> +#include <rmol/factory/FacStudyStatManager.hpp> #include <rmol/command/FileMgr.hpp> #include <rmol/service/RMOL_ServiceContext.hpp> @@ -22,19 +24,22 @@ // ////////////////////////////////////////////////////////////////////// RMOL_ServiceContext:: RMOL_ServiceContext (const ResourceCapacity_T iResourceCapacity) : - _bucketHolder (NULL), _capacity (iResourceCapacity) { + _bucketHolder (NULL), _capacity (iResourceCapacity), + _studyStatManager (NULL) { init (iResourceCapacity); } // ////////////////////////////////////////////////////////////////////// RMOL_ServiceContext::RMOL_ServiceContext () : - _bucketHolder (NULL), _capacity (DEFAULT_RMOL_SERVICE_CAPACITY) { + _bucketHolder (NULL), _capacity (DEFAULT_RMOL_SERVICE_CAPACITY), + _studyStatManager (NULL) { init (DEFAULT_RMOL_SERVICE_CAPACITY); } // ////////////////////////////////////////////////////////////////////// RMOL_ServiceContext::RMOL_ServiceContext (const RMOL_ServiceContext&) : - _bucketHolder (NULL), _capacity (DEFAULT_RMOL_SERVICE_CAPACITY) { + _bucketHolder (NULL), _capacity (DEFAULT_RMOL_SERVICE_CAPACITY), + _studyStatManager (NULL) { init (DEFAULT_RMOL_SERVICE_CAPACITY); } @@ -48,6 +53,11 @@ } // ////////////////////////////////////////////////////////////////////// + void RMOL_ServiceContext::setUpStudyStatManager () { + _studyStatManager = &FacStudyStatManager::instance().create(); + } + + // ////////////////////////////////////////////////////////////////////// void RMOL_ServiceContext::addBucket (const double iYieldRange, const double iDemandMean, const double iDemandStandardDev) { Modified: trunk/rmol/rmol/service/RMOL_ServiceContext.hpp =================================================================== --- trunk/rmol/rmol/service/RMOL_ServiceContext.hpp 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/rmol/service/RMOL_ServiceContext.hpp 2009-04-23 17:25:20 UTC (rev 196) @@ -14,6 +14,7 @@ /** Forward declaration. */ class BucketHolder; + class StudyStatManager; /** Inner class holding the context for the RMOL Service object. */ class RMOL_ServiceContext : public ServiceAbstract { @@ -29,6 +30,8 @@ RMOL_ServiceContext (const RMOL_ServiceContext&); RMOL_ServiceContext (const ResourceCapacity_T iResourceCapacity); void init (const ResourceCapacity_T iResourceCapacity); + /** Initialise the StudyStatManager. */ + void initStudyStatManager (); /** Destructor. */ ~RMOL_ServiceContext(); @@ -49,17 +52,29 @@ return _bucketHolder; } + /** Get the StudyStatManager. */ + StudyStatManager* getStudyStatManager () const { + return _studyStatManager; + } + /** Get the capacity. */ ResourceCapacity_T getCapacity() const { return _capacity; } + public: + /** Set up the StudyStatManager. */ + void setUpStudyStatManager (); + private: /** Internal pointer on BucketHolder. */ BucketHolder* _bucketHolder; /** Resource Capacity. */ ResourceCapacity_T _capacity; + + /** Statistic Manager. */ + StudyStatManager* _studyStatManager; }; } Modified: trunk/rmol/test/samples/sample4.csv =================================================================== --- trunk/rmol/test/samples/sample4.csv 2009-04-20 08:51:11 UTC (rev 195) +++ trunk/rmol/test/samples/sample4.csv 2009-04-23 17:25:20 UTC (rev 196) @@ -1,4 +1,17 @@ price; mean; standard deviation; -1295; 0; 1; -1250; 8; 2.82843; -1205; 4; 2.82843; +2000; 7.3; 2.8; +1850; 15.1; 5.0; +1800; 19.6; 5.2; +1623; 24.0; 6.3; +1511; 27.3; 5.8; +1430; 25.1; 7.0; +1290; 29.6; 7.2; +1100; 24.0; 6.3; +1050; 17.3; 5.8; +950; 25.1; 5.0; +799; 29.6; 10.2; +750; 24.0; 11.3; +700; 27.3; 5.8; +655; 25.1; 7.0; +599; 39.6; 13.2; +520; 44.0; 15.3; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-04-20 08:51:15
|
Revision: 195 http://rmol.svn.sourceforge.net/rmol/?rev=195&view=rev Author: quannaus Date: 2009-04-20 08:51:11 +0000 (Mon, 20 Apr 2009) Log Message: ----------- Changed the version number in configure.ac Modified Paths: -------------- trunk/rmol/configure.ac Modified: trunk/rmol/configure.ac =================================================================== --- trunk/rmol/configure.ac 2009-04-20 08:41:24 UTC (rev 194) +++ trunk/rmol/configure.ac 2009-04-20 08:51:11 UTC (rev 195) @@ -2,7 +2,7 @@ #------------------------------------------------------------------- AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (C) 2007-2009 Denis Arnaud <den...@us...>]) -AC_INIT([RMOL],[0.19.0],[den...@us...],[rmol]) +AC_INIT([RMOL],[0.20.0],[den...@us...],[rmol]) AC_CONFIG_HEADER([rmol/config.h]) AC_CONFIG_SRCDIR([rmol/basic/BasConst.cpp]) AC_CONFIG_AUX_DIR([config]) @@ -15,7 +15,7 @@ AC_SUBST(RPM_RELEASE) # Shared library versioning -GENERIC_LIBRARY_VERSION="0:19:0" +GENERIC_LIBRARY_VERSION="0:20:0" # | | | # +------+ | +---+ # | | | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-04-20 08:41:28
|
Revision: 194 http://rmol.svn.sourceforge.net/rmol/?rev=194&view=rev Author: quannaus Date: 2009-04-20 08:41:24 +0000 (Mon, 20 Apr 2009) Log Message: ----------- Implemented the optimal bid-price vector computation within the Monte-Carlo algorithm. Modified Paths: -------------- trunk/rmol/rmol/RMOL_Service.hpp trunk/rmol/rmol/bom/BucketHolder.cpp trunk/rmol/rmol/bom/BucketHolder.hpp trunk/rmol/rmol/bom/MCOptimiser.cpp trunk/rmol/rmol/bom/MCOptimiser.hpp trunk/rmol/rmol/command/Optimiser.cpp trunk/rmol/rmol/command/Optimiser.hpp trunk/rmol/rmol/service/RMOL_Service.cpp trunk/rmol/test/OptimiseTestSuite.cpp Added Paths: ----------- trunk/rmol/test/samples/ trunk/rmol/test/samples/sample1.csv trunk/rmol/test/samples/sample2.csv trunk/rmol/test/samples/sample3.csv trunk/rmol/test/samples/sample4.csv Removed Paths: ------------- trunk/rmol/test/sample1.csv trunk/rmol/test/sample2.csv trunk/rmol/test/sample3.csv trunk/rmol/test/sample4.csv Property Changed: ---------------- trunk/rmol/ trunk/rmol/config/ Property changes on: trunk/rmol ___________________________________________________________________ Modified: svn:ignore - autom4te.cache INSTALL Makefile Makefile.in aclocal.m4 config.log config.status configure libtool rmol-config rmol-html-doc-0.*.0.tar.bz2 rmol-html-doc-0.*.0.tar.gz rmol.pc rmol.m4 rmol.spec config.guess config.h config.h.in config.sub configure.log rmol-0.*.0.tar.bz2 rmol-0.*.0.tar.gz stamp-h1 + autom4te.cache INSTALL Makefile Makefile.in aclocal.m4 config.log config.status configure libtool rmol-config rmol-html-doc-0.*.0.tar.bz2 rmol-html-doc-0.*.0.tar.gz rmol.pc rmol.m4 rmol.spec config.guess config.h config.h.in config.sub configure.log rmol-0.*.0.tar.bz2 rmol-0.*.0.tar.gz stamp-h1 mytest Property changes on: trunk/rmol/config ___________________________________________________________________ Modified: svn:ignore - config.guess config.sub depcomp install-sh ltmain.sh mdate-sh missing texinfo.tex codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 mkinstalldirs nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 + config.guess config.sub depcomp install-sh ltmain.sh mdate-sh missing texinfo.tex codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 mkinstalldirs nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 libtool.m4 lt~obsolete.m4 ltsugar.m4 ltversion.m4 ltoptions.m4 Modified: trunk/rmol/rmol/RMOL_Service.hpp =================================================================== --- trunk/rmol/rmol/RMOL_Service.hpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/RMOL_Service.hpp 2009-04-20 08:41:24 UTC (rev 194) @@ -36,6 +36,7 @@ /** Single resource optimization that uses Monte-Carlo algorithm and returns a vector of cumulated booking limits. */ void optimalOptimisationByMCIntegration (const int K, + BidPriceVector_T&, BookingLimitVector_T&); /** Single resource optimization using dynamic programming. */ @@ -57,14 +58,14 @@ /** Single resource optimization that uses EMSR-a heuristic and returns a vector of cumulated booking limits. */ - void heuristicOptimisationByEmsrA (BookingLimitVector_T&); + void heuristicOptimisationByEmsrA (BidPriceVector_T&, BookingLimitVector_T&); /** Single resource optimization using EMSR-b heuristic. */ void heuristicOptimisationByEmsrB (); /** Single resource optimization that uses EMSR-b heuristic and returns a vector of cumulated booking limits. */ - void heuristicOptimisationByEmsrB (BookingLimitVector_T&); + void heuristicOptimisationByEmsrB (BidPriceVector_T&, BookingLimitVector_T&); private: /** Default Constructors. */ Modified: trunk/rmol/rmol/bom/BucketHolder.cpp =================================================================== --- trunk/rmol/rmol/bom/BucketHolder.cpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/bom/BucketHolder.cpp 2009-04-20 08:41:24 UTC (rev 194) @@ -151,6 +151,22 @@ } // ////////////////////////////////////////////////////////////////////// + const double BucketHolder::getPreviousCumulatedProtection () const { + // Get the cumulated protection of the previous bucket. If the + // current bucket is the first one, the function returns 0.0 + if (_itCurrentBucket == _bucketList.begin()) { + return 0.0; + } else { + BucketList_T::iterator itPreviousBucket = _itCurrentBucket; + --itPreviousBucket; + Bucket* lPreviousBucket_ptr = *itPreviousBucket; + const double oPreviousCumulatedProtection = + lPreviousBucket_ptr->getCumulatedProtection(); + return oPreviousCumulatedProtection; + } + } + + // ////////////////////////////////////////////////////////////////////// void BucketHolder::calculateMeanDemandAndOptimalRevenue () { _totalMeanDemand = 0.0; _optimalRevenue = 0.0; Modified: trunk/rmol/rmol/bom/BucketHolder.hpp =================================================================== --- trunk/rmol/rmol/bom/BucketHolder.hpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/bom/BucketHolder.hpp 2009-04-20 08:41:24 UTC (rev 194) @@ -43,6 +43,10 @@ /** Get the size of list of buckets/classes. */ const short getSize () const; + /** Get the cumulated protection of the previous bucket. If the + current bucket is the first one, the function returns 0.0. */ + const double getPreviousCumulatedProtection () const; + /** Fill up the vector of cumulated booking limits. */ void fillup (BookingLimitVector_T&) const; Modified: trunk/rmol/rmol/bom/MCOptimiser.cpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/bom/MCOptimiser.cpp 2009-04-20 08:41:24 UTC (rev 194) @@ -21,9 +21,10 @@ // ////////////////////////////////////////////////////////////////////// void MCOptimiser:: optimalOptimisationByMCIntegration(const int K, - const ResourceCapacity_T iCabinCapacity, - BucketHolder& ioBucketHolder, - PartialSumHolderHolder& ioPSHolderHolder){ + const ResourceCapacity_T iCabinCapacity, + BucketHolder& ioBucketHolder, + PartialSumHolderHolder& ioPSHolderHolder, + BidPriceVector_T& ioBidPriceVector){ // Retrieve the BucketHolder // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); @@ -55,8 +56,9 @@ ioPSHolderHolder.iterate(); int Kj = K; int lj = 0; - for (short j=1 ; j <= nbOfClasses - 1; - j++, ioBucketHolder.iterate(), ioPSHolderHolder.iterate()) { + const int cabinCapacityInt = static_cast<int> (iCabinCapacity); + for (short j = 1 ; j <= nbOfClasses - 1; + ++j, ioBucketHolder.iterate(), ioPSHolderHolder.iterate()) { /** Retrieve Bucket(j) (current) and Bucket(j+1) (next). */ Bucket& currentBucket = ioBucketHolder.getCurrentBucket(); Bucket& nextBucket = ioBucketHolder.getNextBucket(); @@ -83,9 +85,9 @@ VariateList_T aVariateList; PartialSumHolder& previousPartialSumList = - ioPSHolderHolder.getPreviousPartialSumHolder(); + ioPSHolderHolder.getPreviousPartialSumHolder(); PartialSumHolder& currentPartialSumList = - ioPSHolderHolder.getCurrentPartialSumHolder(); + ioPSHolderHolder.getCurrentPartialSumHolder(); currentPartialSumList.initSize (Kj); for (int k=1; k <= Kj; k++) { const double djk = gaussianDemandGenerator.generateVariate(); @@ -142,9 +144,6 @@ /** Consistency check. */ assert (lj >= 1 && lj < Kj); - /** Update Kj for the next loop. */ - Kj = Kj - lj; - /** The optimal protection is defined as: y(j) = 1/2 [S(j,lj) + S(j, lj+1)] @@ -161,6 +160,37 @@ // Set the cumulated protection for Bucket(j) (j ranging from 1 to n-1) currentBucket.setCumulatedProtection (yj); + /** Compute the Bid-Price (Opportunity Cost) at index x + (capacity) for x between y(j-1) et y(j). This OC can be + proven to be equal to p(j)*Proba(D1+...+Dk>=x | D1 > y1, + D1+D2 > y2, ..., D1+...+D(k-1) > y(k-1)). */ + + // Get the previous cumulated protection y(j-1). + const double yjm1 = ioBucketHolder.getPreviousCumulatedProtection (); + const int yjm1int = static_cast<int> (yjm1); + const int yjint = static_cast<int> (yj); + int currentIndex = 0; + double currentPartialSum = + currentPartialSumList.getPartialSum (currentIndex); + int x = 0; + + for (x = yjm1int + 1; x <= yjint && x <= cabinCapacityInt; ++x) { + while (currentPartialSum < x) { + ++currentIndex; + if (currentIndex < Kj) { + currentPartialSum = + currentPartialSumList.getPartialSum (currentIndex); + } else { + currentPartialSum = x; + } + } + const double bidPriceAtX = pj * (Kj - currentIndex) / Kj; + ioBidPriceVector.push_back (bidPriceAtX); + } + + /** Update Kj for the next loop. */ + Kj = Kj - lj; + /** S'(j,k) = S(j,k). <br>The previousPartialSumList (S') now becomes equal to the currentPartialSumList (S) (by iteration on ioPSHolderHolder). */ @@ -170,6 +200,61 @@ Bucket& currentBucket = ioBucketHolder.getCurrentBucket(); currentBucket.setCumulatedProtection (iCabinCapacity); + /** Compute the Bid-Price (Opportunity Cost) at index x + (capacity) for x between y(n-1) et cabin capacity. This OC can be + proven to be equal to p(n)*Proba(D1+...+Dn>=x | D1 > y1, + D1+D2 > y2, ..., D1+...+D(n-1) > y(n-1)). */ + + // Get the previous cumulated protection y(n-1). + const double ynm1 = ioBucketHolder.getPreviousCumulatedProtection (); + + if (ynm1 < iCabinCapacity) { + // STEP 1. + const FldDistributionParameters& aDistribParams = + currentBucket.getDistributionParameters(); + const Gaussian gaussianDemandGenerator (aDistribParams); + + VariateList_T aVariateList; + + PartialSumHolder& previousPartialSumList = + ioPSHolderHolder.getPreviousPartialSumHolder(); + PartialSumHolder& currentPartialSumList = + ioPSHolderHolder.getCurrentPartialSumHolder(); + currentPartialSumList.initSize (Kj); + + for (int k = 1; k <= Kj; ++k) { + const double djk = gaussianDemandGenerator.generateVariate(); + aVariateList.push_back (djk); + + const double spjm1lpk = + previousPartialSumList.getPartialSum (lj + k - 1); + const double sjk = spjm1lpk + djk; + currentPartialSumList.addPartialSum (sjk); + } + + // STEP 2. + currentPartialSumList.sort (); + + const int ynm1int = static_cast<int> (ynm1); + const double pn = currentBucket.getAverageYield(); + int currentIndex = 0; + double currentPartialSum = + currentPartialSumList.getPartialSum (currentIndex); + for (int x = ynm1int + 1; x <= cabinCapacityInt; ++x) { + while (currentPartialSum < x) { + ++currentIndex; + if (currentIndex < Kj) { + currentPartialSum = + currentPartialSumList.getPartialSum (currentIndex); + } else { + currentPartialSum = x; + } + } + const double bidPriceAtX = pn * (Kj - currentIndex) / Kj; + ioBidPriceVector.push_back (bidPriceAtX); + } + } + /** Re-calculate the values (protections, bkg limits and cumulated booking limits, the optimal revenue. Modified: trunk/rmol/rmol/bom/MCOptimiser.hpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-04-20 08:41:24 UTC (rev 194) @@ -31,9 +31,10 @@ overbooking. */ static void optimalOptimisationByMCIntegration (const int K, - const ResourceCapacity_T, - BucketHolder&, - PartialSumHolderHolder&); + const ResourceCapacity_T, + BucketHolder&, + PartialSumHolderHolder&, + BidPriceVector_T&); }; } #endif // __RMOL_BOM_MCUTILS_HPP Modified: trunk/rmol/rmol/command/Optimiser.cpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.cpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/command/Optimiser.cpp 2009-04-20 08:41:24 UTC (rev 194) @@ -26,8 +26,9 @@ // ////////////////////////////////////////////////////////////////////// void Optimiser:: optimalOptimisationByMCIntegration (const int K, - const ResourceCapacity_T iCabinCapacity, - BucketHolder& ioBucketHolder) { + const ResourceCapacity_T iCabinCapacity, + BucketHolder& ioBucketHolder, + BidPriceVector_T& ioBidPriceVector) { // Retrieve the BucketHolder // BucketHolder& ioBucketHolder = ioResource.getBucketHolder(); @@ -44,7 +45,7 @@ Note that n-1 corresponds to the size of the parameter list, i.e., n corresponds to the number of classes/buckets. */ - for (short j=0 ; j <= nbOfClasses - 1; j++) { + for (short j = 0 ; j <= nbOfClasses; ++j) { PartialSumHolder& aPartialSumList = FacPartialSumHolder::instance().create (); @@ -54,8 +55,9 @@ // Call the class performing the actual algorithm MCOptimiser::optimalOptimisationByMCIntegration (K, iCabinCapacity, - ioBucketHolder, - aPartialSumHolderHolder); + ioBucketHolder, + aPartialSumHolderHolder, + ioBidPriceVector); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/rmol/rmol/command/Optimiser.hpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.hpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/command/Optimiser.hpp 2009-04-20 08:41:24 UTC (rev 194) @@ -31,8 +31,9 @@ overbooking. */ static void optimalOptimisationByMCIntegration (const int K, - const ResourceCapacity_T, - BucketHolder&); + const ResourceCapacity_T, + BucketHolder&, + BidPriceVector_T&); /** Dynamic Programming. Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-04-20 08:41:24 UTC (rev 194) @@ -82,17 +82,30 @@ const double iCapacity = _rmolServiceContext->getCapacity(); BucketHolder* ioBucketHolder_ptr = _rmolServiceContext->getBucketHolder(); assert (ioBucketHolder_ptr != NULL); + BidPriceVector_T lBidPriceVector; Optimiser::optimalOptimisationByMCIntegration (K, iCapacity, - *ioBucketHolder_ptr); + *ioBucketHolder_ptr, + lBidPriceVector); // DEBUG RMOL_LOG_DEBUG (ioBucketHolder_ptr->display()); + /* + std::cout << "Bid-Price Vector (BPV): "; + unsigned int size = lBidPriceVector.size(); + + for (unsigned int i = 0; i < size; ++i) { + const double bidPrice = lBidPriceVector.at(i); + std::cout << std::fixed << std::setprecision (2) << bidPrice << " "; + } + std::cout << std::endl; + */ } // ////////////////////////////////////////////////////////////////////// void RMOL_Service:: optimalOptimisationByMCIntegration(const int K, + BidPriceVector_T& ioBidPriceVector, BookingLimitVector_T& ioBookingLimitVector){ assert (_rmolServiceContext != NULL); @@ -101,7 +114,8 @@ assert (ioBucketHolder_ptr != NULL); Optimiser::optimalOptimisationByMCIntegration (K, iCapacity, - *ioBucketHolder_ptr); + *ioBucketHolder_ptr, + ioBidPriceVector); // Fill up booking vector ioBucketHolder_ptr->fillup (ioBookingLimitVector); @@ -152,7 +166,7 @@ RMOL_LOG_DEBUG (ioBucketHolder_ptr->display()); // std::cout << "Bid-Price Vector (BPV): "; - unsigned int size = lBidPriceVector.size(); + // unsigned int size = lBidPriceVector.size(); // for (unsigned int i = 0; i < size; ++i) { // const double bidPrice = lBidPriceVector.at(i); @@ -198,7 +212,8 @@ // ////////////////////////////////////////////////////////////////////// void RMOL_Service:: - heuristicOptimisationByEmsrA (BookingLimitVector_T& ioBookingLimitVector) { + heuristicOptimisationByEmsrA (BidPriceVector_T& ioBidPriceVector, + BookingLimitVector_T& ioBookingLimitVector) { assert (_rmolServiceContext != NULL); const double iCapacity = _rmolServiceContext->getCapacity(); BucketHolder* ioBucketHolder_ptr = _rmolServiceContext->getBucketHolder(); @@ -225,7 +240,8 @@ // ////////////////////////////////////////////////////////////////////// void RMOL_Service:: - heuristicOptimisationByEmsrB (BookingLimitVector_T& ioBookingLimitVector) { + heuristicOptimisationByEmsrB (BidPriceVector_T& ioBidPriceVector, + BookingLimitVector_T& ioBookingLimitVector) { assert (_rmolServiceContext != NULL); const double iCapacity = _rmolServiceContext->getCapacity(); BucketHolder* ioBucketHolder_ptr = _rmolServiceContext->getBucketHolder(); Modified: trunk/rmol/test/OptimiseTestSuite.cpp =================================================================== --- trunk/rmol/test/OptimiseTestSuite.cpp 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/test/OptimiseTestSuite.cpp 2009-04-20 08:41:24 UTC (rev 194) @@ -24,11 +24,11 @@ const short METHOD_FLAG = 0; // Cabin Capacity (it must be greater then 100 here) - const double cabinCapacity = 500.0; + const double cabinCapacity = 100.0; // Input file name - const std::string inputFileName ("class.csv"); - const bool hasInputFile = false; + const std::string inputFileName ("samples/sample2.csv"); + const bool hasInputFile = true; // Set the log parameters std::ofstream logOutputFile; Deleted: trunk/rmol/test/sample1.csv =================================================================== --- trunk/rmol/test/sample1.csv 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/test/sample1.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -1,4 +0,0 @@ -price; mean; standard deviation; -100; 20; 9; -70; 45; 12; -42; 80; 16; Deleted: trunk/rmol/test/sample2.csv =================================================================== --- trunk/rmol/test/sample2.csv 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/test/sample2.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -1,6 +0,0 @@ -../../rmol/service/RMOL_Service.cpp:90: 500Class; Price; Mean; Std Dev; Protection; Cum. Protection; Cum. Bkg Limit; -1; 100([2.22507e-308, 100]), upper yield = 100.00; , mean = 20.00; , std_dev = 9.00; , protection = 15.23; , cumulative protection = 15.23; , booking limit = 0.00, cumulative booking limit = 500.00 -2; 70([2.22507e-308, 70]), upper yield = 70.00; , mean = 45.00; , std_dev = 12.00; , protection = 50.57; , cumulative protection = 65.80; , booking limit = 0.00, cumulative booking limit = 484.77 -3; 42([2.22507e-308, 42]), upper yield = 42.00; , mean = 0.00; , std_dev = 0.00; , protection = 434.20; , cumulative protection = 500.00; , booking limit = 0.00, cumulative booking limit = 434.20 -Cabin Capacity = 500; Total Mean Demand = 65; Demand Factor = 0.13; Optimal Revenue = 23299.5 - Deleted: trunk/rmol/test/sample3.csv =================================================================== --- trunk/rmol/test/sample3.csv 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/test/sample3.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -1,5 +0,0 @@ -price; mean; standard deviation; -1050; 17.3; 5.8; -950; 45.1; 15.0; -699; 39.6; 13.2; -520; 34.0; 11.3; Deleted: trunk/rmol/test/sample4.csv =================================================================== --- trunk/rmol/test/sample4.csv 2009-04-02 18:55:23 UTC (rev 193) +++ trunk/rmol/test/sample4.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -1,4 +0,0 @@ -price; mean; standard deviation; -1295; 0; 1; -1250; 8; 2.82843; -1205; 4; 2.82843; Copied: trunk/rmol/test/samples/sample1.csv (from rev 193, trunk/rmol/test/sample1.csv) =================================================================== --- trunk/rmol/test/samples/sample1.csv (rev 0) +++ trunk/rmol/test/samples/sample1.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -0,0 +1,4 @@ +price; mean; standard deviation; +100; 20; 9; +70; 45; 12; +42; 80; 16; Copied: trunk/rmol/test/samples/sample2.csv (from rev 193, trunk/rmol/test/sample2.csv) =================================================================== --- trunk/rmol/test/samples/sample2.csv (rev 0) +++ trunk/rmol/test/samples/sample2.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -0,0 +1,5 @@ +price; mean; standard deviation; +1050; 17.3; 5.8; +567; 45.1; 15.0; +534; 39.6; 13.2; +520; 34.0; 11.3; Copied: trunk/rmol/test/samples/sample3.csv (from rev 193, trunk/rmol/test/sample3.csv) =================================================================== --- trunk/rmol/test/samples/sample3.csv (rev 0) +++ trunk/rmol/test/samples/sample3.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -0,0 +1,5 @@ +price; mean; standard deviation; +1050; 17.3; 5.8; +950; 45.1; 15.0; +699; 39.6; 13.2; +520; 34.0; 11.3; Copied: trunk/rmol/test/samples/sample4.csv (from rev 193, trunk/rmol/test/sample4.csv) =================================================================== --- trunk/rmol/test/samples/sample4.csv (rev 0) +++ trunk/rmol/test/samples/sample4.csv 2009-04-20 08:41:24 UTC (rev 194) @@ -0,0 +1,4 @@ +price; mean; standard deviation; +1295; 0; 1; +1250; 8; 2.82843; +1205; 4; 2.82843; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-04-02 18:55:33
|
Revision: 193 http://rmol.svn.sourceforge.net/rmol/?rev=193&view=rev Author: denis_arnaud Date: 2009-04-02 18:55:23 +0000 (Thu, 02 Apr 2009) Log Message: ----------- [Doc] Improved the generated documentation. Modified Paths: -------------- trunk/rmol/COPYING trunk/rmol/doc/local/authors.doc trunk/rmol/doc/local/copyright.doc trunk/rmol/doc/local/features.doc trunk/rmol/doc/local/help_wanted.doc trunk/rmol/doc/local/index.doc.in trunk/rmol/doc/local/installation.doc trunk/rmol/doc/local/linking.doc trunk/rmol/doc/local/verification.doc Modified: trunk/rmol/COPYING =================================================================== --- trunk/rmol/COPYING 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/COPYING 2009-04-02 18:55:23 UTC (rev 193) @@ -55,7 +55,7 @@ that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -111,7 +111,7 @@ "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -158,7 +158,7 @@ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -329,7 +329,7 @@ accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -370,7 +370,7 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -456,7 +456,7 @@ DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest Modified: trunk/rmol/doc/local/authors.doc =================================================================== --- trunk/rmol/doc/local/authors.doc 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/authors.doc 2009-04-02 18:55:23 UTC (rev 193) @@ -10,23 +10,23 @@ \section developers Developers -- Karim Duval <duv...@us...> (\ref N) -- Ngoc-Thach Hoang <hoa...@us...> (\ref N) +- Anh Quan Nguyen <qua...@us...> (\ref N) +- Benoit Lardeux <ben...@us...> (\ref N) \section retired Retired Developers -- Fabrice Bellard +- Karim Duval <duv...@us...> (\ref N) \section contributors Contributors -- Simon Martin (\ref N) +- Ngoc-Thach Hoang <hoa...@us...> (\ref N) \section distributors Distribution Maintainers -- Christopher Gragsone <mae...@us...> +- Denis Arnaud <den...@us...> (\ref N) \note \anchor N Modified: trunk/rmol/doc/local/copyright.doc =================================================================== --- trunk/rmol/doc/local/copyright.doc 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/copyright.doc 2009-04-02 18:55:23 UTC (rev 193) @@ -2,16 +2,20 @@ \page copyright Copyright and License -\section gnugpl GNU GENERAL PUBLIC LICENSE +\section gnugpl GNU LESSER GENERAL PUBLIC LICENSE -\subsection version Version 2, June 1991 +\subsection version Version 2.1, February 1999 \verbatim -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts +as the successor of the GNU Library Public License, version 2, hence +the version number 2.1.] \endverbatim @@ -19,212 +23,383 @@ The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + The precise terms and conditions for copying, distribution and -modification follow. +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. - \section terms TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". -Activities other than copying, distribution and modification are not + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - a) You must cause the modified files to carry prominent notices + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, +identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of +on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. +entire whole, and thus to each and every part regardless of who wrote +it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or -collective works based on the Program. +collective works based on the Library. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not compelled to copy the source along with the object code. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. - 5. You are not required to accept this License, since you have not + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are +distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. +the Library or works based on it. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to +You are not responsible for enforcing compliance by third parties with this License. - 7. If, as a consequence of a court judgment or allegation of patent + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +refrain entirely from distribution of the Library. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is +integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that @@ -235,122 +410,109 @@ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - 8. If the distribution and/or use of the Program is restricted in + 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. \subsection nowarranty NO WARRANTY - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. \subsection endofterms END OF TERMS AND CONDITIONS \section howtoapply How to Apply These Terms to Your New Programs - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. \verbatim - <one line to give the program's name and a brief idea of what it does.> + <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA \endverbatim Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - -\verbatim - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. -\endverbatim - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if +school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: \verbatim - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. - <signature of Ty Coon>, 1 April 1989 + <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice \endverbatim -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - +That's all there is to it! + +<a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">Source</a> + */ Modified: trunk/rmol/doc/local/features.doc =================================================================== --- trunk/rmol/doc/local/features.doc 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/features.doc 2009-04-02 18:55:23 UTC (rev 193) @@ -1,75 +1,33 @@ /*! -\page features Main features of IT++ +\page features Main features of RMOL -A short list of the main features of IT++ is given below sorted in different -categories. Many more features and functions exist and for these we refer to +A short list of the main features of RMOL is given below sorted in different +categories. Some more features and functions exist and for these we refer to the reference documentation. -\section prog_features Programming features -- templated array and stack container classes -- input and file argument parser -- timing functions and classes +\section rmo_features Optimisation features +- Dynamic Programming (DP) +- EMSRa and EMSRb +- Network optimisation with Linear Programming (LP) -\section math_features Basic mathematical features -- templated vector and matrix classes -- sparse vectors and matrix classes -- elementary functions on vectors and matrices -- statistics classes and functions -- matrix decompositions such as eigenvalue, Cholesky, LU, Schur, SVD, and QR -- solving linear system of equations (including over and underdetermined) -- random number generation (Mersenne Twister generator) -- binary and Galois types (both scalar and vector and matrices) -- integration of 1-dimensional functions -- unconditional nonlinear optimization (Quasi-Newton search) +\section rmf_features Forecasting features +- Exponential Smoothing +- Moving Average -\section sigproc_features Signal processing -- filter functions and classes -- frequency domain filtering -- FFT, DFT, DCT, and Hadamard transforms -- time and frequency domain windows -- evaluating and finding roots of polynomials (and inverse operations) -- filter design functions -- fast independent component analysis (fast ICA) +\section rmc_features Overbooking features +- Cancellations and No-Shows +- Cost-based optimisation +- Service-based optimisation -\section comm_features Communications -- modulators (BPSK, PSK, PAM, QAM) -- vector modulators (e.g. for OFDM and MIMO) -- OFDM and CDMA modulators -- pulse shaping filters (including RC and RRC) -- binary symmetric (BSC) and additive white Gaussian Noise (AWGN) channels -- multipath fading channels (both frequency-flat and frequency-selective) -- COST 207, COST 257, and ITU channel models -- Hamming, extended Golay, and CRC codes -- BCH and Reed-Solomon codes -- convolutional and punctured convolutional codes -- recursive convolutional codes -- turbo codes -- interleavers +\section rmu_features Unconstraining +- Inventory censorflag and guillotine +- E-M (Expectation Maximisation) -\section protocol_features Protocol simulation -- event-based simulation classes -- signal and slots for simplified syntax -- TCP clients and servers -- selective repeat ARQ -- queue classes -- packet generators - - -\section srccode_features Source coding -- Scalar Quantizer (SQ) and Vector Quantizer (VQ) classes and functions for - training of these -- LPC, LSF, and cepstrum parameter calculation for speech processing -- Gaussian Mixture Modeling -- reading and saving several different audiofile formats -- reading and saving images in PNM format - - \section other_features Other features -- binary file format for most built in and IT++ types -- fixed-point scalar, vector and matrix types +- CSV input file parsing */ Modified: trunk/rmol/doc/local/help_wanted.doc =================================================================== --- trunk/rmol/doc/local/help_wanted.doc 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/help_wanted.doc 2009-04-02 18:55:23 UTC (rev 193) @@ -1,29 +1,29 @@ /*! \page help_wanted Make a Difference -<b>Do not ask what IT++ can do for you. Ask what you can do for IT++.</b> +<b>Do not ask what RMOL can do for you. Ask what you can do for RMOL.</b> -You can help us to develop the IT++ library. There are always a lot of things +You can help us to develop the RMOL library. There are always a lot of things you can do: -- Start using IT++ -- Tell your friends about IT++ and help them to get started using it +- Start using RMOL +- Tell your friends about RMOL and help them to get started using it - If you find a bug, report it to us. Without your help we can never hope to produce a bug free code. - Help us to improve the documentation by providing information about documentation bugs -- Answer support requests in the IT++ discussion forums on SourceForge. If -you know the answer to a question, help others to overcome their IT++ +- Answer support requests in the RMOL discussion forums on SourceForge. If +you know the answer to a question, help others to overcome their RMOL problems. - Help us to improve our algorithms. If you know of a better way (e.g. that is faster or requires less memory) to implement some of our algorithms, then let us know. -- Help us to port IT++ to new platforms. If you manage to compile IT++ on a +- Help us to port RMOL to new platforms. If you manage to compile RMOL on a new platform, then tell us how you did it. -- Send us your code. If you have a good IT++ compatible code, which you can -release under the GPL, and you think it should be included in IT++, then +- Send us your code. If you have a good RMOL compatible code, which you can +release under the LGPL, and you think it should be included in RMOL, then send it to us. -- Become an IT++ developer. Send us an e-mail and tell what you can do for -IT++. +- Become an RMOL developer. Send us an e-mail and tell what you can do for +RMOL. */ Modified: trunk/rmol/doc/local/index.doc.in =================================================================== --- trunk/rmol/doc/local/index.doc.in 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/index.doc.in 2009-04-02 18:55:23 UTC (rev 193) @@ -45,6 +45,7 @@ <b>External Libraries:</b> <ul> <li><a href="http://www.gnu.org/software/gsl">GSL</a></li> +<li><a href="http://www.boost.org">Boost</a></li> </ul> </div> @@ -59,7 +60,8 @@ RMOL makes an extensive use of existing open-source libraries for increased functionality, speed and accuracy. In particular <a href="http://www.gnu.org/software/gsl">GSL</a> (<em>GNU Scientific -Library</em>) library is used. +Library</em>) and <a href="http://www.boost.org">Boost</a> (<em>C++ +Standard Extensions</em>) libraries are used. The RMOL library originates from the department of Operational Research and Innovation at <a Modified: trunk/rmol/doc/local/installation.doc =================================================================== --- trunk/rmol/doc/local/installation.doc 2009-03-25 23:26:57 UTC (rev 192) +++ trunk/rmol/doc/local/installation.doc 2009-04-02 18:55:23 UTC (rev 193) @@ -1,24 +1,29 @@ /*! -\page installation IT++ Installation +\page installation RMOL Installation \section toc Table of Contents - \ref requirements - \ref download - \ref compilation - \ref macosx -- \ref localinst - \ref msvc -\section requirements IT++ Requirements +\section requirements RMOL Requirements -IT++ should compile without errors or warnings on most GNU/Linux systems, -on UNIX systems like Solaris SunOS, and on POSIX based environments for -Microsoft Windows like Cygwin or MinGW with MSYS. It can be also built on -Microsoft Windows NT/2000/XP using Microsoft's Visual C++ .NET, but our -support for this compiler is limited. For GNU/Linux, SunOS, Cygwin and MinGW -we assume that you have at least the following GNU software installed on -your computer: +If you have a RPM-based Linux distribution, note that RPM packages are +provided for the latest versions of Fedora (e.g., 10) on the <a +href="http://sourceforge.net/project/showfiles.php?group_id=177703">RMOL +project</a> download site. In that case, you do not have to bother +with the installation from source code. + +Otherwise, RMOL should compile without errors or warnings on most +GNU/Linux systems, on UNIX systems like Solaris SunOS, and on POSIX +based environments for Microsoft Windows like Cygwin or MinGW with +MSYS. It can be also built on Microsoft Windows NT/2000/XP using +Microsoft's Visual C++ .NET, but our support for this compiler is +limited. For GNU/Linux, SunOS, Cygwin and MinGW we assume that you +have at least the following GNU software installed on your computer: - <a href="http://www.gnu.org/software/make/">GNU make</a>, version 3.72.1 or later (check version with <tt>`make --version'</tt>) - <a href="http://gcc.gnu.org/">GCC</a> - GNU Compilers Collection (gcc, g++ @@ -36,65 +41,46 @@ We strongly recommend that you use recent stable releases of the GCC, if possible. We do not actively work on supporting older versions of the GCC, and they may therefore (without prior notice) become unsupported in future -releases of IT++. +releases of RMOL. -In order to use all functionality provided by the IT++ library, it is +In order to use all functionality provided by the RMOL library, it is recommended that you have some external libraries compiled and installed in -your computer. The basic set of them is: -<a href="http://www.netlib.org/blas/">BLAS</a>, -<a href="http://www.netlib.org/lapack/">LAPACK</a> and -<a href="http://www.fftw.org/">FFTW</a> (version 3.0.0 or later). To improve -some vector based operations a C interface of BLAS, namely -<a href="http://www.netlib.org/blas/">CBLAS</a>, is also recommended. +your computer, namely: +<a href="http://www.gnu.org/software/gsl">GSL</a> and +<a href="http://www.boost.org">Boost</a>. -Instead of NetLib's reference BLAS, CBLAS and LAPACK implementations, some -optimized platform-specific libraries can be used as well, i.e.: -- <a href="http://math-atlas.sourceforge.net/">ATLAS</a> (<em>Automatically - Tuned Linear Algebra Software</em>) - includes optimised BLAS, CBLAS and a - limited set of LAPACK routines (version 3.6.0 or later) -- <a href="http://www.intel.com/cd/software/products/asmo-na/eng/perflib/mkl/">MKL</a> - (<em>Intel Math Kernel Library</em>) - includes all required BLAS, CBLAS, - LAPACK and FFT routines (version 8.0.0 or later; FFTW not required) -- <a href="http://developer.amd.com/acml.aspx">ACML</a> (<em>AMD Core Math - Library</em>) - includes BLAS, CBLAS, LAPACK and FFT routines (version - 2.5.3 or later; FFTW not required) -It is possible to compile and use IT++ without these libraries, but the -functionality will be reduced. We therefore recommend that you take some -time and effort to provide these external libraries in your system. Please -note, that some of them (FFTW, BLAS and LAPACK) are usually included in -most modern Linux distributions. +\section download Obtaining the RMOL Source Codes - -\section download Obtaining the IT++ Source Codes - -IT++ is released under the GNU General Public License (GPL) and hence the -source code of the IT++ library is available for free download. To obtain -the IT++ source code, visit the project pages on SourceForge: -- <a href="http://itpp.sourceforge.net/">http://itpp.sourceforge.net/</a> +RMOL is released under the Lesser GNU General Public License (LGPL) +and hence the source code of the RMOL library is available for free +download. To obtain the RMOL source code, visit the project pages on +SourceForge: +- <a + href="http://sourceforge.net/projects/rmol">http://sourceforge.net/projects/rmol</a> . -and download the file named \c itpp-\<VERSION\>.tar.gz or -\c itpp-\<VERSION\>.tar.bz2, where \c \<VERSION\> is the latest release -number, e.g. 3.9.0. +and download the file named \c rmol-\<VERSION\>.tar.gz or +\c rmol-\<VERSION\>.tar.bz2, where \c \<VERSION\> is the latest release +number, e.g. 0.19.0. -\section compilation General IT++ Configuration, Compilation and Installation Instructions +\section compilation General RMOL Configuration, Compilation and Installation Instructions -Assuming that you have already downloaded the latest IT++ sources, untar +Assuming that you have already downloaded the latest RMOL sources, untar and unpack the sources, and enter the unpacked directory. Depending on the package type you have downloaded, use the following commands: \verbatim -% gzip -cd itpp-<VERSION>.tar.gz | tar xf - -% cd itpp-<VERSION> +% gzip -cd rmol-<VERSION>.tar.gz | tar xf - +% cd rmol-<VERSION> \endverbatim \verbatim -% bzip2 -cd itpp-<VERSION>.tar.bz2 | tar xf - -% cd itpp-<VERSION> +% bzip2 -cd rmol-<VERSION>.tar.bz2 | tar xf - +% cd rmol-<VERSION> \endverbatim -Since version 3.9.0, the IT++ library uses autoconf, automake and libtool +Since version 0.2.0, the RMOL library uses autoconf, automake and libtool for preparing Makefiles and configuration script, so the compilation procedure resembles a standard, well-known GNU method, i.e. @@ -110,7 +96,7 @@ PREFIX value. By default it is set to \c `/usr/local', so <tt>`make install'</tt> will install appropriate files into \c `/usr/local/include', \c `/usr/local/lib`, etc. -- \c `--enable-debug' - build an extra library named \c `libitpp_debug.*' +- \c `--enable-debug' - build an extra library named \c `librmol_debug.*' using special debugging flags for compiler and linker (disabled by default) - \c `--enable-exceptions' - enable exceptions handling of run-time errors instead of aborting the program (disabled by default) @@ -124,79 +110,21 @@ Plese note that each \c `--enable-\<OPTION\>' switch can be ... [truncated message content] |
From: <den...@us...> - 2009-03-25 23:27:08
|
Revision: 192 http://rmol.svn.sourceforge.net/rmol/?rev=192&view=rev Author: denis_arnaud Date: 2009-03-25 23:26:57 +0000 (Wed, 25 Mar 2009) Log Message: ----------- [Packaging] Fixed the RPM specification file according to https://bugzilla.redhat.com/show_bug.cgi?id=489233 Modified Paths: -------------- trunk/rmol/rmol/command/FileMgr.cpp trunk/rmol/rmol/service/RMOL_Service.cpp trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol/command/FileMgr.cpp =================================================================== --- trunk/rmol/rmol/command/FileMgr.cpp 2009-03-25 17:56:05 UTC (rev 191) +++ trunk/rmol/rmol/command/FileMgr.cpp 2009-03-25 23:26:57 UTC (rev 192) @@ -80,8 +80,8 @@ << "\"" << std::endl; } else { if (i == 2) { - const Demand& aDemand = - FacDemand::instance().create (aDistribParams, aYieldRange); + //const Demand& aDemand = + // FacDemand::instance().create (aDistribParams, aYieldRange); Bucket& aBucket = FacBucket::instance().create (aYieldRange); FacBucketHolder::instance().addBucket (ioBucketHolder, aBucket); } Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-25 17:56:05 UTC (rev 191) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-25 23:26:57 UTC (rev 192) @@ -154,10 +154,10 @@ // std::cout << "Bid-Price Vector (BPV): "; unsigned int size = lBidPriceVector.size(); - for (unsigned int i = 0; i < size; ++i) { - const double bidPrice = lBidPriceVector.at(i); + // for (unsigned int i = 0; i < size; ++i) { + // const double bidPrice = lBidPriceVector.at(i); // std::cout << std::fixed << std::setprecision (2) << bidPrice << " "; - } + // } // std::cout << std::endl; } Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-25 17:56:05 UTC (rev 191) +++ trunk/rmol/rmol.spec.in 2009-03-25 23:26:57 UTC (rev 192) @@ -70,7 +70,6 @@ %configure --disable-static make %{?_smp_mflags} - %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT @@ -79,9 +78,9 @@ rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/config.h rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la -chmod 644 doc/html/installdox doc/html/*.png doc/html/*.ico +# chmod 644 doc/html/installdox doc/html/*.png doc/html/*.ico rm -rf %{mydocs} && mkdir -p %{mydocs} -mv $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/* %{mydocs} +mv $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html %{mydocs} %clean rm -rf $RPM_BUILD_ROOT @@ -107,9 +106,7 @@ %files devel %defattr(-,root,root,-) -%dir %{_includedir}/%{name} -%{_includedir}/%{name}/@PACKAGE_NAME@_Service.hpp -%{_includedir}/%{name}/@PACKAGE_NAME@_Types.hpp +%{_includedir}/%{name} %{_bindir}/%{name}-config %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc @@ -119,11 +116,12 @@ %files doc %defattr(-,root,root,-) -%doc %{mydocs}/* -%doc AUTHORS ChangeLog COPYING NEWS README doc/html +%doc %{mydocs}/html +%doc AUTHORS ChangeLog COPYING NEWS README + %changelog -* Sun Mar 8 2009 Denis Arnaud <den...@m4...> 0.19.0-1 +* Sun Mar 25 2009 Denis Arnaud <den...@m4...> 0.19.0-1 - RPM release for Fedora 10 * Wed Mar 4 2009 Denis Arnaud <den...@m4...> 0.18.0-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-25 17:56:10
|
Revision: 191 http://rmol.svn.sourceforge.net/rmol/?rev=191&view=rev Author: denis_arnaud Date: 2009-03-25 17:56:05 +0000 (Wed, 25 Mar 2009) Log Message: ----------- [Packaging] The delivery must be done without static library (removed it from the RPM specification file). Modified Paths: -------------- trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-25 17:31:13 UTC (rev 190) +++ trunk/rmol/rmol.spec.in 2009-03-25 17:56:05 UTC (rev 191) @@ -67,7 +67,7 @@ %build -%configure +%configure --disable-static make %{?_smp_mflags} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-25 17:31:22
|
Revision: 190 http://rmol.svn.sourceforge.net/rmol/?rev=190&view=rev Author: denis_arnaud Date: 2009-03-25 17:31:13 +0000 (Wed, 25 Mar 2009) Log Message: ----------- [Build] Updated the RPM specification file according to: https://bugzilla.redhat.com/show_bug.cgi?id=489233 Modified Paths: -------------- trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-23 18:18:36 UTC (rev 189) +++ trunk/rmol/rmol.spec.in 2009-03-25 17:31:13 UTC (rev 190) @@ -1,4 +1,6 @@ # +%define mydocs __tmp_docdir +# Name: @PACKAGE@ Version: @VERSION@ Release: @RPM_RELEASE@%{?dist} @@ -8,7 +10,7 @@ Group: System Environment/Libraries License: LGPLv2 URL: http://%{name}.sourceforge.net -Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gsl-devel >= 1.8 @@ -65,7 +67,6 @@ %build -#%configure --with-docdir=%{_docdir}/%{name}-%{version} %configure make %{?_smp_mflags} @@ -79,6 +80,8 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la chmod 644 doc/html/installdox doc/html/*.png doc/html/*.ico +rm -rf %{mydocs} && mkdir -p %{mydocs} +mv $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/* %{mydocs} %clean rm -rf $RPM_BUILD_ROOT @@ -100,11 +103,11 @@ %doc AUTHORS ChangeLog COPYING NEWS README %{_bindir}/%{name} %{_libdir}/lib*.so.* -#%{_datadir}/info/dir %{_mandir}/man3/%{name}.3.* %files devel %defattr(-,root,root,-) +%dir %{_includedir}/%{name} %{_includedir}/%{name}/@PACKAGE_NAME@_Service.hpp %{_includedir}/%{name}/@PACKAGE_NAME@_Types.hpp %{_bindir}/%{name}-config @@ -116,6 +119,7 @@ %files doc %defattr(-,root,root,-) +%doc %{mydocs}/* %doc AUTHORS ChangeLog COPYING NEWS README doc/html %changelog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-23 18:18:40
|
Revision: 189 http://rmol.svn.sourceforge.net/rmol/?rev=189&view=rev Author: denis_arnaud Date: 2009-03-23 18:18:36 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Dev] Fixed an inconsistency in the copy constructor. Modified Paths: -------------- trunk/rmol/rmol/service/RMOL_Service.cpp Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-23 17:54:20 UTC (rev 188) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-23 18:18:36 UTC (rev 189) @@ -27,7 +27,7 @@ // ////////////////////////////////////////////////////////////////////// RMOL_Service::RMOL_Service (const RMOL_Service& iService) : - _rmolServiceContext (NULL) { + _rmolServiceContext (iService._rmolServiceContext) { } // ////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-23 17:54:25
|
Revision: 188 http://rmol.svn.sourceforge.net/rmol/?rev=188&view=rev Author: denis_arnaud Date: 2009-03-23 17:54:20 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Conf] Added BOOST_SYSTEM to config/ax_boost.m4. Modified Paths: -------------- trunk/rmol/config/ax_boost.m4 Modified: trunk/rmol/config/ax_boost.m4 =================================================================== --- trunk/rmol/config/ax_boost.m4 2009-03-23 16:42:24 UTC (rev 187) +++ trunk/rmol/config/ax_boost.m4 2009-03-23 17:54:20 UTC (rev 188) @@ -10,6 +10,7 @@ dnl dnl AC_SUBST(BOOST_CFLAGS) / AC_SUBST(BOOST_LIBS) dnl AC_SUBST(BOOST_FILESYSTEM_LIB) +dnl AC_SUBST(BOOST_SYSTEM_LIB) dnl AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) dnl AC_SUBST(BOOST_THREAD_LIB) dnl AC_SUBST(BOOST_IOSTREAMS_LIB) @@ -24,6 +25,7 @@ dnl dnl HAVE_BOOST dnl HAVE_BOOST_FILESYSTEM +dnl HAVE_BOOST_SYSTEM dnl HAVE_BOOST_PROGRAM_OPTIONS dnl HAVE_BOOST_THREAD dnl HAVE_BOOST_IOSTREAMS @@ -57,6 +59,9 @@ [want_boost="yes"]) # AC_CANONICAL_BUILD +BOOST_MDW_VERSION="1-33-1" +BOOSTLIB_MDW_VERSION="1_33_1" + if test "x$want_boost" = "xyes"; then boost_lib_version_req=ifelse([$1], ,1.20.0,$1) boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` @@ -97,9 +102,9 @@ BOOST_CFLAGS="-I$ac_boost_path_tmp/include" break; fi - if test -d "$ac_boost_path_tmp/include/boost-1_33_1/boost" && test -r "$ac_boost_path_tmp/include/boost-1_33_1/boost"; then + if test -d "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost" && test -r "$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION/boost"; then BOOST_LIBS="-L$ac_boost_path_tmp/$BOOST_LIBDIRTYPE" - BOOST_CFLAGS="-I$ac_boost_path_tmp/include/boost-1_33_1" + BOOST_CFLAGS="-I$ac_boost_path_tmp/include/boost-$BOOST_MDW_VERSION" dnl Hack for wrongly installed Boost libraries (AMD64 libraries installed in boost/lib directory) if test -d "$ac_boost_path_tmp/lib" && test -r "$ac_boost_path_tmp/lib" && test ! -d "$ac_boost_path_tmp/lib64"; then @@ -244,8 +249,9 @@ AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::FILESYSTEM library is available]) BN=boost_filesystem for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt $BN-mgw-mt-s \ + $BN-mgw-s $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_FILESYSTEM_LIB="-l$ax_lib" AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes" break], [link_filesystem="no"]) @@ -255,6 +261,32 @@ fi fi + AC_CACHE_CHECK([whether the Boost::System library is available], + ax_cv_boost_system, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]], + [[using namespace boost::system; + error_code myErrorCode(); + return 0;]]), + ax_cv_boost_system=yes, ax_cv_boost_system=no) + AC_LANG_RESTORE + ]) + if test "$ax_cv_boost_system" = "yes"; then + AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::SYSTEM library is available]) + BN=boost_system + for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ + $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + AC_CHECK_LIB($ax_lib, main, + [BOOST_SYSTEM_LIB="-l$ax_lib" AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes" break], + [link_system="no"]) + done + if test "x$link_system" = "xno"; then + AC_MSG_NOTICE(Could not link against $ax_lib !) + fi + fi + AC_CACHE_CHECK([whether the Boost::Program_Options library is available], ax_cv_boost_program_options, [AC_LANG_SAVE @@ -269,8 +301,10 @@ AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) BN=boost_program_options for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION; do AC_CHECK_LIB($ax_lib, main, [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib" AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes" break], [link_program_options="no"]) @@ -313,8 +347,10 @@ AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::THREAD library is available]) BN=boost_thread for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_THREAD_LIB="-l$ax_lib" AC_SUBST(BOOST_THREAD_LIB) link_thread="yes" break], [link_thread="no"]) done @@ -342,8 +378,10 @@ AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available]) BN=boost_iostreams for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_IOSTREAMS_LIB="-l$ax_lib" AC_SUBST(BOOST_IOSTREAMS_LIB) link_thread="yes" break], [link_thread="no"]) done @@ -371,16 +409,20 @@ AC_DEFINE(HAVE_BOOST_SERIALIZATION,,[define if the Boost::Serialization library is available]) BN=boost_serialization for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_SERIALIZATION_LIB="-l$ax_lib" AC_SUBST(BOOST_SERIALIZATION_LIB) link_thread="yes" break], [link_thread="no"]) done BN=boost_wserialization for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_WSERIALIZATION_LIB="-l$ax_lib" AC_SUBST(BOOST_WSERIALIZATION_LIB) link_thread="yes" break], [link_thread="no"]) @@ -406,8 +448,10 @@ AC_DEFINE(HAVE_BOOST_SIGNALS,,[define if the Boost::Signals library is available]) BN=boost_signals for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_SIGNALS_LIB="-l$ax_lib" AC_SUBST(BOOST_SIGNALS_LIB) link_thread="yes" break], [link_thread="no"]) done @@ -432,8 +476,10 @@ AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) BN=boost_date_time for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_thread="yes" break], [link_thread="no"]) done @@ -456,8 +502,10 @@ AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) BN=boost_regex for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt \ + $BN-mgw-mt-s $BN-mgw-s \ + $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do AC_CHECK_LIB($ax_lib, main, [BOOST_REGEX_LIB="-l$ax_lib" AC_SUBST(BOOST_REGEX_LIB) link_thread="yes" break], [link_thread="no"]) done @@ -481,8 +529,9 @@ BN=boost_unit_test_framework saved_ldflags="${LDFLAGS}" for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s \ + lib$BN-$CC-s $BN-mgw $BN-mgw-mt $BN-mgw-mt-s \ + $BN-mgw-s $BN-$CC-mt-$BOOSTLIB_MDW_VERSION ; do LDFLAGS="${LDFLAGS} -l$ax_lib" AC_CACHE_CHECK(the name of the Boost::UnitTestFramework library, ax_cv_boost_unit_test_framework, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-03-23 16:42:30
|
Revision: 187 http://rmol.svn.sourceforge.net/rmol/?rev=187&view=rev Author: quannaus Date: 2009-03-23 16:42:24 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Dev] Fixed the rmol-config(.in) script, so that it works when the prefix is not standard (/usr). Modified Paths: -------------- trunk/rmol/AUTHORS trunk/rmol/rmol-config.in Modified: trunk/rmol/AUTHORS =================================================================== --- trunk/rmol/AUTHORS 2009-03-23 11:15:17 UTC (rev 186) +++ trunk/rmol/AUTHORS 2009-03-23 16:42:24 UTC (rev 187) @@ -1 +1,3 @@ -Denis Arnaud <den...@m4...> +Denis Arnaud <denis dot arnaud_rmol at m4x dot org> +Anh Quan Nguyen <aquannguyen at gmail dot com> +Patrick Grandjean <ptgrd at yahoo dot com> Modified: trunk/rmol/rmol-config.in =================================================================== --- trunk/rmol/rmol-config.in 2009-03-23 11:15:17 UTC (rev 186) +++ trunk/rmol/rmol-config.in 2009-03-23 16:42:24 UTC (rev 187) @@ -1,6 +1,7 @@ #!/bin/sh prefix=@prefix@ +exec_prefix=${prefix} libdir=@libdir@ includedir=@includedir@ @@ -51,11 +52,19 @@ ;; --cflags) - echo -I${includedir} + if [ "${prefix}" != "/usr" ]; then + echo -I${includedir} + else + echo + fi ;; --libs) - echo -l@PACKAGE@ + if [ "${prefix}" != "/usr" ]; then + echo -L${libdir} -l@PACKAGE@ + else + echo -l@PACKAGE@ + fi ;; *) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-23 11:15:22
|
Revision: 186 http://rmol.svn.sourceforge.net/rmol/?rev=186&view=rev Author: denis_arnaud Date: 2009-03-23 11:15:17 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Dev] The documentation RPM package is now generated with noarch dependency. Modified Paths: -------------- trunk/rmol/doc/local/rmol_header.html trunk/rmol/rmol.spec.in Modified: trunk/rmol/doc/local/rmol_header.html =================================================================== --- trunk/rmol/doc/local/rmol_header.html 2009-03-23 02:17:22 UTC (rev 185) +++ trunk/rmol/doc/local/rmol_header.html 2009-03-23 11:15:17 UTC (rev 186) @@ -12,7 +12,8 @@ <div style="width: 100%; height: 40px; background-color: #ffff00; border: 1px solid #b0b0b0; margin: 5px 5px 5px 0; padding: 2px;"> <a href="http://rmol.sourceforge.net"><img width="150" height="40" src="rmol_logo.png" alt="RMOL Logo" style="float: left; border: 0;"></a> - <a href="http://www.sourceforge.net/projects/rmol"><img width="150" - height="40" src="sfx_logo.png" alt="Sourceforge Logo" - style="float: right; border: 0;"></a> + <a href="http://sourceforge.net/projects/rmol"><img + src="http://sflogo.sourceforge.net/sflogo.php?group_id=177703&type=15" + width="150" height="40" border="0" + alt="Get Revenue Management Optimisation Library at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> </div> Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-23 02:17:22 UTC (rev 185) +++ trunk/rmol/rmol.spec.in 2009-03-23 11:15:17 UTC (rev 186) @@ -47,6 +47,7 @@ %package doc Summary: HTML documentation for the @PACKAGE_NAME@ library Group: Documentation +BuildArch: noarch BuildRequires: doxygen, texlive-latex, texlive-dvips, ghostscript %description doc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-23 02:17:25
|
Revision: 185 http://rmol.svn.sourceforge.net/rmol/?rev=185&view=rev Author: denis_arnaud Date: 2009-03-23 02:17:22 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Dev] Improved the generation of the documentation RPM package within rmol.spec(.in). Modified Paths: -------------- trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-23 00:21:22 UTC (rev 184) +++ trunk/rmol/rmol.spec.in 2009-03-23 02:17:22 UTC (rev 185) @@ -77,10 +77,7 @@ rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/config.h rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la -mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} -cp -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} -chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/html/installdox -#cp -r doc/html $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} +chmod 644 doc/html/installdox doc/html/*.png doc/html/*.ico %clean rm -rf $RPM_BUILD_ROOT @@ -118,9 +115,7 @@ %files doc %defattr(-,root,root,-) -#%doc %{_docdir}/%{name}-%{version}/html -%doc AUTHORS ChangeLog COPYING NEWS README -%{_datadir}/%{name}-%{version}/html +%doc AUTHORS ChangeLog COPYING NEWS README doc/html %changelog * Sun Mar 8 2009 Denis Arnaud <den...@m4...> 0.19.0-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-23 00:21:26
|
Revision: 184 http://rmol.svn.sourceforge.net/rmol/?rev=184&view=rev Author: denis_arnaud Date: 2009-03-23 00:21:22 +0000 (Mon, 23 Mar 2009) Log Message: ----------- [Dev] Fixed the documentation issue with RPM building. Modified Paths: -------------- trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-22 22:42:08 UTC (rev 183) +++ trunk/rmol/rmol.spec.in 2009-03-23 00:21:22 UTC (rev 184) @@ -64,7 +64,8 @@ %build -%configure --with-docdir=%{_docdir}/%{name}-%{version} +#%configure --with-docdir=%{_docdir}/%{name}-%{version} +%configure make %{?_smp_mflags} @@ -76,6 +77,10 @@ rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/config.h rm -f $RPM_BUILD_ROOT%{_infodir}/dir rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} +cp -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} +chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/html/installdox +#cp -r doc/html $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} %clean rm -rf $RPM_BUILD_ROOT @@ -97,7 +102,6 @@ %doc AUTHORS ChangeLog COPYING NEWS README %{_bindir}/%{name} %{_libdir}/lib*.so.* -#%{_docdir}/%{name}-%{version}/html #%{_datadir}/info/dir %{_mandir}/man3/%{name}.3.* @@ -114,7 +118,9 @@ %files doc %defattr(-,root,root,-) -%doc %{_docdir}/%{name}-%{version} +#%doc %{_docdir}/%{name}-%{version}/html +%doc AUTHORS ChangeLog COPYING NEWS README +%{_datadir}/%{name}-%{version}/html %changelog * Sun Mar 8 2009 Denis Arnaud <den...@m4...> 0.19.0-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-22 22:42:18
|
Revision: 183 http://rmol.svn.sourceforge.net/rmol/?rev=183&view=rev Author: denis_arnaud Date: 2009-03-22 22:42:08 +0000 (Sun, 22 Mar 2009) Log Message: ----------- [Dev] Updated the RPM specification file and Doxygen configuration file for documentation generation. Modified Paths: -------------- trunk/rmol/doc/doxygen_html.cfg.in trunk/rmol/rmol.spec.in Modified: trunk/rmol/doc/doxygen_html.cfg.in =================================================================== --- trunk/rmol/doc/doxygen_html.cfg.in 2009-03-22 17:10:18 UTC (rev 182) +++ trunk/rmol/doc/doxygen_html.cfg.in 2009-03-22 22:42:08 UTC (rev 183) @@ -1,4 +1,4 @@ -# Doxyfile 1.5.2 +# Doxyfile 1.5.7.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,11 +14,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 @@ -54,10 +54,11 @@ # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, +# Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English @@ -133,11 +134,19 @@ # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. @@ -146,13 +155,6 @@ MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. @@ -187,14 +189,26 @@ OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration @@ -207,6 +221,21 @@ CPP_CLI_SUPPORT = NO +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default @@ -222,6 +251,32 @@ SUBGROUPING = YES +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -256,6 +311,14 @@ EXTRACT_LOCAL_METHODS = NO +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the @@ -331,6 +394,12 @@ SORT_BRIEF_DOCS = NO +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, @@ -392,9 +461,21 @@ SHOW_DIRECTORIES = YES +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + # The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via # popen()) the command <command> <input-file>, where <command> is the value of # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file # provided by doxygen. Whatever the program writes to standard output @@ -402,6 +483,15 @@ FILE_VERSION_FILTER = +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -467,10 +557,11 @@ @top_builddir@/doc/local \ @top_srcdir@/doc/tutorial -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. INPUT_ENCODING = UTF-8 @@ -479,7 +570,7 @@ # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.hpp \ *.cpp \ @@ -513,9 +604,10 @@ EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = @@ -595,13 +687,13 @@ STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) +# If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. @@ -699,9 +791,43 @@ HTML_ALIGN_MEMBERS = YES +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO @@ -726,6 +852,12 @@ GENERATE_CHI = NO +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. @@ -737,6 +869,38 @@ TOC_EXPAND = NO +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>. + +QHP_VIRTUAL_FOLDER = doc + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file . + +QHG_LOCATION = + # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. @@ -748,12 +912,20 @@ ENUM_VALUES_PER_LINE = 4 -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to FRAME, a side panel will be generated +# containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# probably better off using the HTML help feature. Other possible values +# for this tag are: HIERARCHIES, which will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list; +# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which +# disables this behavior completely. For backwards compatibility with previous +# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE +# respectively. GENERATE_TREEVIEW = YES @@ -763,6 +935,14 @@ TREEVIEW_WIDTH = 250 +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- @@ -781,7 +961,7 @@ # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. -LATEX_CMD_NAME = +LATEX_CMD_NAME = # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the @@ -1114,10 +1294,11 @@ CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. MSCGEN_PATH = @@ -1134,6 +1315,29 @@ HAVE_DOT = NO +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the @@ -1178,19 +1382,19 @@ INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. CALL_GRAPH = NO -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a caller dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO @@ -1223,19 +1427,31 @@ DOTFILE_DIRS = -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen will always -# show the root nodes and its direct children regardless of this setting. +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-22 17:10:18 UTC (rev 182) +++ trunk/rmol/rmol.spec.in 2009-03-22 22:42:08 UTC (rev 183) @@ -36,6 +36,8 @@ Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkgconfig +Requires(post): info +Requires(preun): info %description devel This package contains the header files, static libraries and @@ -45,6 +47,7 @@ %package doc Summary: HTML documentation for the @PACKAGE_NAME@ library Group: Documentation +BuildRequires: doxygen, texlive-latex, texlive-dvips, ghostscript %description doc This package contains the documentation in the HTML format of the @PACKAGE_NAME@ @@ -82,11 +85,11 @@ %postun -p /sbin/ldconfig %post devel -/sbin/install-info %{_infodir}/%{name}-ref.info.* %{_infodir}/dir +/sbin/install-info %{_infodir}/%{name}-ref.info.* %{_infodir}/dir || : %preun devel if [ "$1" = 0 ]; then - /sbin/install-info --delete %{_infodir}/%{name}-ref.info.* %{_infodir}/dir + /sbin/install-info --delete %{_infodir}/%{name}-ref.info.* %{_infodir}/dir || : fi %files -f %{name}.lang This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-22 17:10:33
|
Revision: 182 http://rmol.svn.sourceforge.net/rmol/?rev=182&view=rev Author: denis_arnaud Date: 2009-03-22 17:10:18 +0000 (Sun, 22 Mar 2009) Log Message: ----------- [Dev] Updated the po/POTFILES.in to take into account the renaming of RmolTypes.hpp. Modified Paths: -------------- trunk/rmol/po/POTFILES.in Modified: trunk/rmol/po/POTFILES.in =================================================================== --- trunk/rmol/po/POTFILES.in 2009-03-22 17:04:21 UTC (rev 181) +++ trunk/rmol/po/POTFILES.in 2009-03-22 17:10:18 UTC (rev 182) @@ -6,7 +6,7 @@ rmol/service/ServiceAbstract.cpp rmol/service/RMOL_ServiceContext.hpp rmol/service/Logger.hpp -rmol/RmolTypes.hpp +rmol/RMOL_Types.hpp rmol/RMOL_Service.hpp rmol/field/FldYieldRange.hpp rmol/field/FldOverbookingPolicy.hpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-22 17:04:34
|
Revision: 181 http://rmol.svn.sourceforge.net/rmol/?rev=181&view=rev Author: denis_arnaud Date: 2009-03-22 17:04:21 +0000 (Sun, 22 Mar 2009) Log Message: ----------- [Dev] Renamed RmolTypes.hpp into RMOL_Types.hpp, so as to ease standardisation. Modified Paths: -------------- trunk/rmol/Makefile.am trunk/rmol/README trunk/rmol/rmol/RMOL_Service.hpp trunk/rmol/rmol/bom/BucketHolder.hpp trunk/rmol/rmol/bom/DPOptimiser.hpp trunk/rmol/rmol/bom/Emsr.hpp trunk/rmol/rmol/bom/MCOptimiser.hpp trunk/rmol/rmol/command/Optimiser.hpp trunk/rmol/rmol/factory/FacRmolServiceContext.hpp trunk/rmol/rmol/service/Logger.hpp trunk/rmol/rmol/service/RMOL_ServiceContext.hpp trunk/rmol/rmol/sources.mk trunk/rmol/rmol-config.in trunk/rmol/rmol.spec.in Added Paths: ----------- trunk/rmol/rmol/RMOL_Types.hpp Removed Paths: ------------- trunk/rmol/rmol/RmolTypes.hpp Modified: trunk/rmol/Makefile.am =================================================================== --- trunk/rmol/Makefile.am 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/Makefile.am 2009-03-22 17:04:21 UTC (rev 181) @@ -21,7 +21,8 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure \ config-h.in sic/stamp-h.in autogen.sh bootstrap -EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common +#EXTRA_DIST = @PACKAGE@.spec @PACKAGE@.m4 @PACKAGE@.pc Makefile.common +EXTRA_DIST = # Build in these directories: SUBDIRS = rmol win32 po man $(INFO_DOC_DIR) $(HTML_DOC_DIR) $(TEST_DIR) Modified: trunk/rmol/README =================================================================== --- trunk/rmol/README 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/README 2009-03-22 17:04:21 UTC (rev 181) @@ -21,7 +21,7 @@ http://sourceforge.net/project/showfiles.php?group_id=177703 Then, as usual, you can just type the following sequence: -"./configure --prefix=/projects/sim/deliveries/rmol-0.19.0 && make && make check && cd test && ./testLibsh" +"./configure --prefix=/home/latus/dev/deliveries/rmol-0.19.0 && make && make check && cd test && ./testLibsh" Of course, if you want to install the library (librmol*.so*), just type: "make install". Modified: trunk/rmol/rmol/RMOL_Service.hpp =================================================================== --- trunk/rmol/rmol/RMOL_Service.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/RMOL_Service.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -7,7 +7,7 @@ // STL #include <string> // RMOL -#include <rmol/RmolTypes.hpp> +#include <rmol/RMOL_Types.hpp> namespace RMOL { Copied: trunk/rmol/rmol/RMOL_Types.hpp (from rev 179, trunk/rmol/rmol/RmolTypes.hpp) =================================================================== --- trunk/rmol/rmol/RMOL_Types.hpp (rev 0) +++ trunk/rmol/rmol/RMOL_Types.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -0,0 +1,68 @@ +#ifndef __RMOL_RMOL_TYPES_HPP +#define __RMOL_RMOL_TYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <vector> +#include <list> + +namespace RMOL { + + // ///////// Exceptions /////////// + class RootException : public std::exception { + }; + + class FileNotFoundException : public RootException { + }; + + class NonInitialisedServiceException : public RootException { + }; + + class MemoryAllocationException : public RootException { + }; + + class ObjectNotFoundException : public RootException { + }; + + class DocumentNotFoundException : public RootException { + }; + + + // /////////////// Log ///////////// + /** Level of logs. */ + namespace LOG { + typedef enum { + CRITICAL = 0, + ERROR, + NOTIFICATION, + WARNING, + DEBUG, + VERBOSE, + LAST_VALUE + } EN_LogLevel; + } + + // //////// Type definitions ///////// + /** Define the capacity. + <br>It is a double, as it allows for overbooking. */ + typedef double ResourceCapacity_T; + + /** Define the Booking Limit. + <br>It is a double, as it allows for overbooking. */ + typedef double BookingLimit_T; + + /** Define the Bid-Price Vector. + <br> It is a vector of double. */ + typedef std::vector<double> BidPriceVector_T; + + /** Define the list of EMSR values for the EMSR algorith. */ + typedef std::list<double> EmsrValueList_T; + + /** Define the vector of booking limits. + <br> It is a vector of double. */ + typedef std::vector<double> BookingLimitVector_T; + +} +#endif // __RMOL_RMOL_TYPES_HPP Property changes on: trunk/rmol/rmol/RMOL_Types.hpp ___________________________________________________________________ Added: svn:mergeinfo + Deleted: trunk/rmol/rmol/RmolTypes.hpp =================================================================== --- trunk/rmol/rmol/RmolTypes.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/RmolTypes.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -1,68 +0,0 @@ -#ifndef __RMOL_RMOLTYPES_HPP -#define __RMOL_RMOLTYPES_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <vector> -#include <list> - -namespace RMOL { - - // ///////// Exceptions /////////// - class RootException : public std::exception { - }; - - class FileNotFoundException : public RootException { - }; - - class NonInitialisedServiceException : public RootException { - }; - - class MemoryAllocationException : public RootException { - }; - - class ObjectNotFoundException : public RootException { - }; - - class DocumentNotFoundException : public RootException { - }; - - - // /////////////// Log ///////////// - /** Level of logs. */ - namespace LOG { - typedef enum { - CRITICAL = 0, - ERROR, - NOTIFICATION, - WARNING, - DEBUG, - VERBOSE, - LAST_VALUE - } EN_LogLevel; - } - - // //////// Type definitions ///////// - /** Define the capacity. - <br>It is a double, as it allows for overbooking. */ - typedef double ResourceCapacity_T; - - /** Define the Booking Limit. - <br>It is a double, as it allows for overbooking. */ - typedef double BookingLimit_T; - - /** Define the Bid-Price Vector. - <br> It is a vector of double. */ - typedef std::vector<double> BidPriceVector_T; - - /** Define the list of EMSR values for the EMSR algorith. */ - typedef std::list<double> EmsrValueList_T; - - /** Define the vector of booking limits. - <br> It is a vector of double. */ - typedef std::vector<double> BookingLimitVector_T; - -} -#endif // __RMOL_RMOLTYPES_HPP Modified: trunk/rmol/rmol/bom/BucketHolder.hpp =================================================================== --- trunk/rmol/rmol/bom/BucketHolder.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/bom/BucketHolder.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -7,7 +7,7 @@ // STL #include <iostream> // RMOL -#include <rmol/RmolTypes.hpp> +#include <rmol/RMOL_Types.hpp> #include <rmol/bom/BomAbstract.hpp> #include <rmol/bom/BucketList.hpp> Modified: trunk/rmol/rmol/bom/DPOptimiser.hpp =================================================================== --- trunk/rmol/rmol/bom/DPOptimiser.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/bom/DPOptimiser.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -#include <rmol/RmolTypes.hpp> +// RMOL +#include <rmol/RMOL_Types.hpp> namespace RMOL { Modified: trunk/rmol/rmol/bom/Emsr.hpp =================================================================== --- trunk/rmol/rmol/bom/Emsr.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/bom/Emsr.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -#include <rmol/RmolTypes.hpp> +// RMOL +#include <rmol/RMOL_Types.hpp> namespace RMOL { Modified: trunk/rmol/rmol/bom/MCOptimiser.hpp =================================================================== --- trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/bom/MCOptimiser.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -#include <rmol/RmolTypes.hpp> +// RMOL +#include <rmol/RMOL_Types.hpp> namespace RMOL { Modified: trunk/rmol/rmol/command/Optimiser.hpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/command/Optimiser.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -4,7 +4,8 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -#include <rmol/RmolTypes.hpp> +// RMOL +#include <rmol/RMOL_Types.hpp> namespace RMOL { Modified: trunk/rmol/rmol/factory/FacRmolServiceContext.hpp =================================================================== --- trunk/rmol/rmol/factory/FacRmolServiceContext.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/factory/FacRmolServiceContext.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -5,7 +5,7 @@ // Import section // ////////////////////////////////////////////////////////////////////// // RMOL -#include <rmol/RmolTypes.hpp> +#include <rmol/RMOL_Types.hpp> #include <rmol/factory/FacServiceAbstract.hpp> namespace RMOL { Modified: trunk/rmol/rmol/service/Logger.hpp =================================================================== --- trunk/rmol/rmol/service/Logger.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/service/Logger.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -11,7 +11,7 @@ #include <sstream> #include <string> // RMOL -#include <rmol/RmolTypes.hpp> +#include <rmol/RMOL_Types.hpp> // /////////////// LOG MACROS ///////////////// #define RMOL_LOG_CORE(iLevel, iToBeLogged) \ Modified: trunk/rmol/rmol/service/RMOL_ServiceContext.hpp =================================================================== --- trunk/rmol/rmol/service/RMOL_ServiceContext.hpp 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/service/RMOL_ServiceContext.hpp 2009-03-22 17:04:21 UTC (rev 181) @@ -7,7 +7,7 @@ // STL #include <string> // RMOL -#include <rmol/RmolTypes.hpp> +#include <rmol/RMOL_Types.hpp> #include <rmol/service/ServiceAbstract.hpp> namespace RMOL { Modified: trunk/rmol/rmol/sources.mk =================================================================== --- trunk/rmol/rmol/sources.mk 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol/sources.mk 2009-03-22 17:04:21 UTC (rev 181) @@ -1,3 +1,3 @@ -service_h_sources = $(top_srcdir)/rmol/RmolTypes.hpp \ +service_h_sources = $(top_srcdir)/rmol/RMOL_Types.hpp \ $(top_srcdir)/rmol/RMOL_Service.hpp service_cc_sources = $(top_srcdir)/rmol/rmol.cpp Modified: trunk/rmol/rmol-config.in =================================================================== --- trunk/rmol/rmol-config.in 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol-config.in 2009-03-22 17:04:21 UTC (rev 181) @@ -1,26 +1,19 @@ #!/bin/sh prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no libdir=@libdir@ includedir=@includedir@ usage() { cat <<EOF -Usage: reac-config [OPTION] +Usage: @PACKAGE@-config [OPTION] Known values for OPTION are: - --prefix print libitpp installation prefix - --exec-prefix print libitpp installation exec prefix + --prefix print @PACKAGE_NAME@ installation prefix --libs print library linking information - --libs-opt print optimised library linking information - --libs-debug print debug library linking information --cflags print pre-processor and compiler flags - --cflags-opt print optimised pre-processor and compiler flags - --cflags-debug print debug pre-processor and compiler flags --help display this help and exit --version output version information EOF @@ -31,6 +24,9 @@ usage 1 fi +cflags=false +libs=false + while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -40,46 +36,30 @@ case $1 in --prefix=*) prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi ;; + --prefix) echo $prefix ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo $exec_prefix - ;; + --version) echo @VERSION@ ;; + --help) usage 0 ;; + --cflags) - echo @GSL_CFLAGS@ -I${includedir} + echo -I${includedir} ;; - --cflags-opt) - echo @GSL_CFLAGS@ -I${includedir} @CXXFLAGS_OPT@ - ;; - --cflags-debug) - echo @GSL_CFLAGS@ -I${includedir} @CXXFLAGS_DEBUG@ - ;; + --libs) - echo @GSL_LIBS@ -L${libdir} -l@PACKAGE@ @LDFLAGS@ @LIBS@ + echo -l@PACKAGE@ ;; - --libs-opt) - echo @GSL_LIBS@ -L${libdir} -l@PACKAGE@ @LDFLAGS@ @LIBS@ - ;; - --libs-debug) - echo @GSL_LIBS@ -L${libdir} -l@PACKAGE_DEBUG@ @LDFLAGS@ @LIBS@ - ;; + *) - echo "${usage}" 1>&2 + usage exit 1 ;; esac Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-22 16:47:07 UTC (rev 180) +++ trunk/rmol/rmol.spec.in 2009-03-22 17:04:21 UTC (rev 181) @@ -3,7 +3,7 @@ Version: @VERSION@ Release: @RPM_RELEASE@%{?dist} -Summary: @PACKAGE_NAME@ is a C++ library of Revenue Management and Optimisation classes and functions. +Summary: C++ library of Revenue Management and Optimisation classes and functions Group: System Environment/Libraries License: LGPLv2 @@ -11,7 +11,6 @@ Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: automake, autoconf, libtool, gettext BuildRequires: gsl-devel >= 1.8 BuildRequires: boost-devel >= 1.34 BuildRequires: cppunit-devel >= 1.10 @@ -29,33 +28,40 @@ The Theory and practice of Revenue Management, by Kalyan T. Talluri and Garrett J. van Ryzin, Kluwer Academic Publishers, 2004, ISBN 1-4020-7701-7 -Install the @PACKAGE@ package if you need a library for high-level +Install the %{name} package if you need a library for high-level revenue management functionality. %package devel -Summary: Headers and libraries for building apps that use @PACKAGE_NAME@ +Summary: Header files, libraries and development documentation for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} +Requires: pkgconfig %description devel -This package contains headers and libraries required to build applications that -use @PACKAGE_NAME@. +This package contains the header files, static libraries and +development documentation for %{name}. If you would like to develop +programs using %{name}, you will need to install %{name}-devel. -%package html-doc +%package doc Summary: HTML documentation for the @PACKAGE_NAME@ library -Group: System Environment/Libraries +Group: Documentation -%description html-doc +%description doc This package contains the documentation in the HTML format of the @PACKAGE_NAME@ library. The documentation is the same as at the @PACKAGE_NAME@ web page. %prep %setup -q +# find ./doc -type f -perm 755 -exec chmod 644 {} \; +# Fix some permissions and formats +rm -f INSTALL +chmod -x ABOUT-NLS AUTHORS ChangeLog COPYING NEWS README TODO +find . -type f -name '*.[hc]pp' -exec chmod 644 {} \; %build -%configure --enable-static --with-docdir=%{_docdir}/%{name}-%{version} +%configure --with-docdir=%{_docdir}/%{name}-%{version} make %{?_smp_mflags} @@ -64,7 +70,9 @@ make install DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} # remove unpackaged files from the buildroot +rm -f $RPM_BUILD_ROOT%{_includedir}/%{name}/config.h rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_libdir}/lib%{name}.la %clean rm -rf $RPM_BUILD_ROOT @@ -74,41 +82,40 @@ %postun -p /sbin/ldconfig %post devel -/sbin/install-info %{_infodir}/%{name}-ref.info.gz %{_infodir}/dir +/sbin/install-info %{_infodir}/%{name}-ref.info.* %{_infodir}/dir %preun devel if [ "$1" = 0 ]; then - /sbin/install-info --delete %{_infodir}/%{name}-ref.info.gz %{_infodir}/dir + /sbin/install-info --delete %{_infodir}/%{name}-ref.info.* %{_infodir}/dir fi %files -f %{name}.lang %defattr(-,root,root,-) -%doc AUTHORS ChangeLog COPYING INSTALL NEWS README +%doc AUTHORS ChangeLog COPYING NEWS README %{_bindir}/%{name} %{_libdir}/lib*.so.* #%{_docdir}/%{name}-%{version}/html #%{_datadir}/info/dir -%{_datadir}/man/man3/%{name}.3.gz +%{_mandir}/man3/%{name}.3.* %files devel %defattr(-,root,root,-) -%doc -%{_includedir}/%{name} +%{_includedir}/%{name}/@PACKAGE_NAME@_Service.hpp +%{_includedir}/%{name}/@PACKAGE_NAME@_Types.hpp %{_bindir}/%{name}-config -%{_libdir}/lib*.a -%{_libdir}/lib*.la -%{_libdir}/lib*.so +%{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc %{_datadir}/aclocal/%{name}.m4 -%{_datadir}/info/%{name}-ref.info.gz -%{_datadir}/man/man1/%{name}-config.1.gz +%{_infodir}/%{name}-ref.info.* +%{_mandir}/man1/%{name}-config.1.* -%files html-doc +%files doc %defattr(-,root,root,-) %doc %{_docdir}/%{name}-%{version} %changelog -* Sun Mar 8 2009 Denis Arnaud <den...@m4...> @RPM_RELEASE@ +* Sun Mar 8 2009 Denis Arnaud <den...@m4...> 0.19.0-1 - RPM release for Fedora 10 -* Wed Mar 4 2009 Denis Arnaud <den...@m4...> @RPM_RELEASE@ + +* Wed Mar 4 2009 Denis Arnaud <den...@m4...> 0.18.0-1 - Second RPM release This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-22 16:47:24
|
Revision: 180 http://rmol.svn.sourceforge.net/rmol/?rev=180&view=rev Author: denis_arnaud Date: 2009-03-22 16:47:07 +0000 (Sun, 22 Mar 2009) Log Message: ----------- [Dev] Converted DOS-formatted files to Unix-formatted ones. Modified Paths: -------------- trunk/rmol/rmol/basic/BasConst_Overbooking.hpp trunk/rmol/rmol/bom/Overbooking.cpp trunk/rmol/rmol/bom/Overbooking.hpp trunk/rmol/rmol/field/FldOverbookingPolicy.cpp trunk/rmol/rmol/field/FldOverbookingPolicy.hpp Modified: trunk/rmol/rmol/basic/BasConst_Overbooking.hpp =================================================================== --- trunk/rmol/rmol/basic/BasConst_Overbooking.hpp 2009-03-20 17:03:01 UTC (rev 179) +++ trunk/rmol/rmol/basic/BasConst_Overbooking.hpp 2009-03-22 16:47:07 UTC (rev 180) @@ -1,30 +1,30 @@ -#ifndef __RMOL_BAS_BASCONST_OVERBOOKING_HPP -#define __RMOL_BAS_BASCONST_OVERBOOKING_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// - -namespace RMOL { - - /** Default value for the load factor used for overbooking calculation. */ - extern const double DEFAULT_OVERBOOKING_LOAD_FACTOR; - - /** Default value for the capacity used for overbooking calculation. */ - extern const unsigned int DEFAULT_OVERBOOKING_CAPACITY; - - /** Default value for the net bookings used for overbooking calculation. */ - extern const unsigned int DEFAULT_OVERBOOKING_NET_BOOKINGS; - - /** Default value for the overbooking used for overbooking calculation. */ - extern const double DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE; - - /** Default value for the mean used for overbooking calculation. */ - extern const double DEFAULT_OVERBOOKING_MEAN; - - /** Default value for the standard deviation used for overbooking - calculation. */ - extern const double DEFAULT_OVERBOOKING_STANDARD_DEVIATION; - -} -#endif // __RMOL_BAS_BASCONST_OVERBOOKING_HPP +#ifndef __RMOL_BAS_BASCONST_OVERBOOKING_HPP +#define __RMOL_BAS_BASCONST_OVERBOOKING_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace RMOL { + + /** Default value for the load factor used for overbooking calculation. */ + extern const double DEFAULT_OVERBOOKING_LOAD_FACTOR; + + /** Default value for the capacity used for overbooking calculation. */ + extern const unsigned int DEFAULT_OVERBOOKING_CAPACITY; + + /** Default value for the net bookings used for overbooking calculation. */ + extern const unsigned int DEFAULT_OVERBOOKING_NET_BOOKINGS; + + /** Default value for the overbooking used for overbooking calculation. */ + extern const double DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE; + + /** Default value for the mean used for overbooking calculation. */ + extern const double DEFAULT_OVERBOOKING_MEAN; + + /** Default value for the standard deviation used for overbooking + calculation. */ + extern const double DEFAULT_OVERBOOKING_STANDARD_DEVIATION; + +} +#endif // __RMOL_BAS_BASCONST_OVERBOOKING_HPP Modified: trunk/rmol/rmol/bom/Overbooking.cpp =================================================================== --- trunk/rmol/rmol/bom/Overbooking.cpp 2009-03-20 17:03:01 UTC (rev 179) +++ trunk/rmol/rmol/bom/Overbooking.cpp 2009-03-22 16:47:07 UTC (rev 180) @@ -1,464 +1,464 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STL -#include <iostream> -// GSL -#include <gsl/gsl_sys.h> -#include <gsl/gsl_math.h> -#include <gsl/gsl_sf.h> -#include <gsl/gsl_randist.h> -#include <gsl/gsl_cdf.h> -// RMOL -#include <rmol/basic/BasConst_Overbooking.hpp> -#include <rmol/bom/Overbooking.hpp> - -namespace RMOL { - - // ////////////////////////////////////////////////////////////////////// - Overbooking::Overbooking () : - _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), - _capacity (DEFAULT_OVERBOOKING_CAPACITY), - _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), - _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), - _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { - } - - // ////////////////////////////////////////////////////////////////////// - Overbooking::Overbooking (const Overbooking& iOverbooking) : - _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), - _capacity (DEFAULT_OVERBOOKING_CAPACITY), - _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), - _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), - _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { - } - - // ////////////////////////////////////////////////////////////////////// - Overbooking::Overbooking (const FldOverbookingPolicy& iPolicy) : - _policy (iPolicy), - _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), - _capacity (DEFAULT_OVERBOOKING_CAPACITY), - _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), - _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), - _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), - _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, - DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { - } - - // ////////////////////////////////////////////////////////////////////// - Overbooking::~Overbooking() { - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Overbooking::describeShortKey() const { - std::ostringstream oStr; - oStr << _policy; - return oStr.str(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Overbooking::describeKey() const { - return describeShortKey(); - } - - // ////////////////////////////////////////////////////////////////////// - std::string Overbooking::toString() const { - std::ostringstream oStr; - oStr << describeShortKey() - << ", " << _policy << ", " << _overbookingPercentage - << ", " << _capacity << ", " << _netBookings - << ", " << _loadFactor - << ", " << _noShowDistributionParameters - << ", " << _cancellationDistributionParameters - << ", " << _remainingCancellationDistributionParameters - << ", " << _demandDistributionParameters - << std::endl; - - return oStr.str(); - } - - // ////////////////////////////////////////////////////////////////////// - void Overbooking::toStream (std::ostream& ioOut) const { - ioOut << toString(); - } - - // ////////////////////////////////////////////////////////////////////// - void Overbooking::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Overbooking::shortDisplay() const { - std::ostringstream oStr; - oStr << describeKey(); - return oStr.str(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Overbooking::display() const { - std::ostringstream oStr; - oStr << shortDisplay(); - oStr << "Policy = " << _policy - << "; OB% = " << _overbookingPercentage - << "; Capacity = " << _capacity - << "; Net Bookings = " << _netBookings - << "; Load Factor (LF) = " << _loadFactor - << "; No-Show Distrib. Params = " << _noShowDistributionParameters - << "; Cx Distrib. Params = " << _cancellationDistributionParameters - << "; Rem. Cx Distrib. Params = " << _remainingCancellationDistributionParameters - << "; Demand Distrib. Params = " << _demandDistributionParameters - << std::endl; - return oStr.str(); - } - - - // ////////////// TODO: REMOVE THOSE CONSTANTS ////////// - //Parameters given by RMS User , for the prototype we set at - //predefined values - - // = 0.5; to check the influence of this parameter , actually has 1 problem - const double PRICE_OVER_DENIED_COST = 0.5; - - // = 150; - // const unsigned int CAPACITY = 150; - - // = CAPACITY*1.2; - const double MAX_BOOKING_LIMIT = 180; - - // 0.8; // il faut calculer ro dans la requete - // const double SHOW_RATE = 0.9 ; - - // 120; - // const unsigned int NET_BOOKINGS = 120; - // const int OVERBOOKING_METHOD_TYPE = 0; - - - // service level parameters - //pSHOW_RATEbability that we have to deny one or more passengers = 1/10.000 - const double SERVICE_LEVEL1 = 0.0001; - - //the fraction of passengers who will be denied to board = 1 over 10.000 - const double SERVICE_LEVEL2 = 0.0001; - const int SERVICE_LEVEL_TYPE = 2; - - //parameters fSHOW_RATEm Forecaster - //demand average and deviation for a flight date - // const double DEMAND_AVERAGE = 135; - - //100,10 - // const double DEMAND_DEVIATION = 10; - // const double NS_PERCENTAGE = 0.1; - //10,2 - // const double NS_DEVIATION = 0.02; - // const double REMAINING_CANCELLATIONS_PERCENTAGE = 0.2; - //20,5 - const double CANCELLATIONS_DEVIATION = 0.05; - // ////////////// END OF TODO: REMOVE THOSE CONSTANTS ////////// - - // ////////////////////////////////////////////////////////////////////// - FldDistributionParameters Overbooking::getOverbookingCalculation () const { - FldDistributionParameters resultOBPercentage; - - const FldOverbookingPolicy::EN_Policy lPolicy = _policy.getPolicy(); - - switch (lPolicy) { - case FldOverbookingPolicy::HEUR: - resultOBPercentage = calculateHeuristic(); - break; - case FldOverbookingPolicy::RISK: - resultOBPercentage = calculateRiskBased(); - break; - case FldOverbookingPolicy::SL1: - resultOBPercentage = calculateServiceLevel(); - break; - case FldOverbookingPolicy::HYBRID: - resultOBPercentage = calculateHybridPolicy(); - break; - default: - resultOBPercentage = calculateHeuristic(); - break; - } - return resultOBPercentage; - } - - // 0 : Method Heuristic take No show and cancellations infor - //to calculate the Overbooking percentage and deviation - // ////////////////////////////////////////////////////////////////////// - FldDistributionParameters Overbooking::calculateHeuristic() const { - FldDistributionParameters resultOBPercentage; - - const double lCancellationsPercentage = - _remainingCancellationDistributionParameters.getMean() - * _netBookings / _capacity; - - // Overbooking average percentage - const double lNoShow = _noShowDistributionParameters.getMean(); - const double lOBMean = (lNoShow + lCancellationsPercentage) - / (1 - (lNoShow + lCancellationsPercentage)); - resultOBPercentage.setMean (lOBMean); - - // Overbooking deviation (heuristic) - const double lNSStdDev = - _noShowDistributionParameters.getStandardDeviation(); - const double lNSVariance = lNSStdDev * lNSStdDev; - - const double lCxStdDev = - _cancellationDistributionParameters.getStandardDeviation(); - const double lCxVariance = lCxStdDev * lCxStdDev; - - const double lOBStdDev = sqrt (lNSVariance + lCxVariance); - resultOBPercentage.setStandardDeviation (lOBStdDev); - - return resultOBPercentage ; - } - - // 1 : Method Risk based take No show and cancellations infor - //to calculate the Overbooking percentage and deviation - // ////////////////////////////////////////////////////////////////////// - FldDistributionParameters Overbooking::calculateRiskBased() const { - FldDistributionParameters resultOBPercentage; - - // take the Overbooking average and deviation by Heuristic method - // in order to calculate some parameters ? show rate par exemple - resultOBPercentage = calculateHeuristic(); - - //Calculation SHOW_RATE : Shows rate = shows/net booking; - //Calculation booking limit - const double lBookingLimit = calculateBookingLimit (); - - const double lOBMean = lBookingLimit / _capacity - 1.0; - resultOBPercentage.setMean (lOBMean); - - return resultOBPercentage; - } - - // 2 : Service level policy - // ////////////////////////////////////////////////////////////////////// - FldDistributionParameters Overbooking::calculateServiceLevel() const { - FldDistributionParameters resultOBPercentage; - - // No-Show Rate - const double lNoShowMean = _noShowDistributionParameters.getMean(); - - // service level 1 - unsigned int b = _capacity; - switch (SERVICE_LEVEL_TYPE){ - case 1: default: { - double test = serviceLevel1 (lNoShowMean, b, _capacity); - while (test < SERVICE_LEVEL1) { - b++; - test = serviceLevel1 (lNoShowMean, b, _capacity); - } - break; - } - case 2: { - // service level 2 - double test = fractionServiceLevel2 (lNoShowMean, b, _capacity); - while (test < SERVICE_LEVEL2){ - b++; - test = fractionServiceLevel2 (lNoShowMean, b, _capacity); - } - break; - } - } - resultOBPercentage.setMean (static_cast<double>(b) / _capacity - 1.0); - // TODO: To be altered - resultOBPercentage.setStandardDeviation (0); - - return resultOBPercentage; - } - - // 3 : Hybrid policy - // ////////////////////////////////////////////////////////////////////// - FldDistributionParameters Overbooking::calculateHybridPolicy() const { - FldDistributionParameters resultOBPercentage; - - FldDistributionParameters resultOBPercentage_1 = calculateRiskBased(); - FldDistributionParameters resultOBPercentage_2 = calculateServiceLevel(); - - //intermediate step to calculate the OB% - const double lMean1 = resultOBPercentage_1.getMean(); - const double lMean2 = resultOBPercentage_2.getMean(); - const double lSDeviation1 = resultOBPercentage_1.getStandardDeviation(); - const double lSDeviation2 = resultOBPercentage_2.getStandardDeviation(); - - //The hybrid method gets the minimum value - if (lMean1 > lMean2) { - resultOBPercentage.setMean (lMean2); - resultOBPercentage.setStandardDeviation (lSDeviation2); - return resultOBPercentage; - } - assert (lMean1 <= lMean2); - - resultOBPercentage.setMean (lMean1); - resultOBPercentage.setStandardDeviation (lSDeviation1); - - return resultOBPercentage; - } - - //Distribution - //binomial distribution, normal distribution - - // Service level - // in the Service Level policy method we can switch between service - // level 1 and 2 in the Hybrid policy, because they are constraints - // so we can choose one or the other or the two - - - // useful functions - // ////////////////////////////////////////////////////////////////////// - double Overbooking::calculateBookingLimit () const { - double resultBookingLimit = _capacity; - - // Demand Distribution Parameters - const double lDemandMean = _demandDistributionParameters.getMean(); - const double lDemandStdDev = - _demandDistributionParameters.getStandardDeviation(); - - // Algorithm - double pNormal = - gsl_cdf_gaussian_Q (_capacity - lDemandMean, lDemandStdDev); - - // double pNormal = probabilityNormal (CAPACITY, DEMAND_AVERAGE, - // DEMAND_DEVIATION); - - if (PRICE_OVER_DENIED_COST >= 1 - pNormal) { - resultBookingLimit = MAX_BOOKING_LIMIT; - return resultBookingLimit; - } - assert (PRICE_OVER_DENIED_COST < 1 - pNormal); - - pNormal = gsl_cdf_gaussian_Q (_capacity - 1 - lDemandMean, - lDemandStdDev); - - // pNormal = probabilityNormal (CAPACITY-1, DEMAND_AVERAGE, - // DEMAND_DEVIATION); - - const double lNoShowMean = _noShowDistributionParameters.getMean(); - - double lProbability = (1 - pNormal) - * gsl_sf_pow_int (lNoShowMean, _capacity); - - int counter = 1; - while ((lProbability < PRICE_OVER_DENIED_COST) && (counter < 100)) { - counter++; - if (resultBookingLimit >= MAX_BOOKING_LIMIT) { - return resultBookingLimit; - - } else { - resultBookingLimit += 1.0; - } - - const unsigned int b = static_cast<unsigned int> (resultBookingLimit); - - pNormal = gsl_cdf_gaussian_Q (b + 1 - lDemandMean, lDemandStdDev); - - // pNormal = probabilityNormal (b+1, DEMAND_AVERAGE, DEMAND_DEVIATION); - - assert (_capacity > 1); - assert (b - _capacity + 1 > 0); - // assert (b >= 0); (derived from the other two) - - - // The cumulated probability that the number of shows exceeds - // the leg/cabin physical capacity - lProbability += (1+pNormal) - * lNoShowMean * gsl_ran_binomial_pdf (_capacity-1, lNoShowMean, b); - - } - return resultBookingLimit; - } - - - // Private useful functions, some of them are to be replaced by gsl - // library's functions - - // ////////////////////////////////////////////////////////////////////// - //to be deleted, already available in gsl lib - //cumulated binomial probability - double Overbooking::probabilityNormal (const int b, const double average, - const double sdeviation) const { - double resultCdf = 0.0; - - for (int i=0; i < b+1 ; i++) { - resultCdf += 1 /( sqrt(2 * M_PI) ) - * gsl_sf_exp (-1* (gsl_sf_pow_int(i-average, 2)) / (2*sdeviation)); - } - return resultCdf; - } - - // ////////////////////////////////////////////////////////////////////// - - // to be deleted, already available in gsl lib, gsl_ran_binomial_pdf(unsigned int k, double SHOW_RATE, unsigned int b) - double Overbooking::binomialProbability_F_b_s (const double iShowRate, - const int b, - const int k) const { - double Factorials = gsl_sf_fact(b)/gsl_sf_fact(k)/gsl_sf_fact(b-k); - double f = Factorials* - gsl_sf_pow_int(iShowRate, k)*gsl_sf_pow_int(1-iShowRate, b-k) ; - - return f; - } - - // pSHOW_RATEbability to deny one or more services - // ////////////////////////////////////////////////////////////////////// - - - - ////////////// Private functions for Servive level policies///////////// - - // service level 1 : cumulated probability of having no-shows - //the constant SHOW_RATE can be changed in local variable in this function - - // ////////////////////////////////////////////////////////////////////// - double Overbooking::serviceLevel1 (const double iShowRate, - const int b, const int C) const { - double resultProbability = 1.0; - for (int i = 1; i<=C; i++) { - resultProbability -= gsl_ran_binomial_pdf (i, iShowRate, b);} - return resultProbability; - } - - //////////////fraction of customers who will be denied service/////////////// - double Overbooking::fractionServiceLevel2 (const double iShowRate, - const int b, const int C) const { - double resultFraction = serviceLevel1 (iShowRate, b-1, _capacity-1) - - C / b / iShowRate * serviceLevel1 (iShowRate, b, _capacity); - - return resultFraction; - } -} - - - /* where can I move this main function ?*/ - // int main(){ - //tester = a supprimer - // double []test; - // overBookingCalculation tester = new overBookingCalculation("AY", "831"); - // test = tester.getOverbookingCalculation(2); - - // System.out.println("OB % = " + test[0]); - // System.out.println("OB deviation = " + test[1]); - - - +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STL +#include <iostream> +// GSL +#include <gsl/gsl_sys.h> +#include <gsl/gsl_math.h> +#include <gsl/gsl_sf.h> +#include <gsl/gsl_randist.h> +#include <gsl/gsl_cdf.h> +// RMOL +#include <rmol/basic/BasConst_Overbooking.hpp> +#include <rmol/bom/Overbooking.hpp> + +namespace RMOL { + + // ////////////////////////////////////////////////////////////////////// + Overbooking::Overbooking () : + _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), + _capacity (DEFAULT_OVERBOOKING_CAPACITY), + _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), + _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), + _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { + } + + // ////////////////////////////////////////////////////////////////////// + Overbooking::Overbooking (const Overbooking& iOverbooking) : + _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), + _capacity (DEFAULT_OVERBOOKING_CAPACITY), + _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), + _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), + _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { + } + + // ////////////////////////////////////////////////////////////////////// + Overbooking::Overbooking (const FldOverbookingPolicy& iPolicy) : + _policy (iPolicy), + _overbookingPercentage (DEFAULT_OVERBOOKING_OVERBOOKING_PERCENTAGE), + _capacity (DEFAULT_OVERBOOKING_CAPACITY), + _netBookings (DEFAULT_OVERBOOKING_NET_BOOKINGS), + _loadFactor (DEFAULT_OVERBOOKING_LOAD_FACTOR), + _noShowDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _cancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _remainingCancellationDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)), + _demandDistributionParameters (FldDistributionParameters (DEFAULT_OVERBOOKING_MEAN, + DEFAULT_OVERBOOKING_STANDARD_DEVIATION)) { + } + + // ////////////////////////////////////////////////////////////////////// + Overbooking::~Overbooking() { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Overbooking::describeShortKey() const { + std::ostringstream oStr; + oStr << _policy; + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Overbooking::describeKey() const { + return describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + std::string Overbooking::toString() const { + std::ostringstream oStr; + oStr << describeShortKey() + << ", " << _policy << ", " << _overbookingPercentage + << ", " << _capacity << ", " << _netBookings + << ", " << _loadFactor + << ", " << _noShowDistributionParameters + << ", " << _cancellationDistributionParameters + << ", " << _remainingCancellationDistributionParameters + << ", " << _demandDistributionParameters + << std::endl; + + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + void Overbooking::toStream (std::ostream& ioOut) const { + ioOut << toString(); + } + + // ////////////////////////////////////////////////////////////////////// + void Overbooking::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Overbooking::shortDisplay() const { + std::ostringstream oStr; + oStr << describeKey(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Overbooking::display() const { + std::ostringstream oStr; + oStr << shortDisplay(); + oStr << "Policy = " << _policy + << "; OB% = " << _overbookingPercentage + << "; Capacity = " << _capacity + << "; Net Bookings = " << _netBookings + << "; Load Factor (LF) = " << _loadFactor + << "; No-Show Distrib. Params = " << _noShowDistributionParameters + << "; Cx Distrib. Params = " << _cancellationDistributionParameters + << "; Rem. Cx Distrib. Params = " << _remainingCancellationDistributionParameters + << "; Demand Distrib. Params = " << _demandDistributionParameters + << std::endl; + return oStr.str(); + } + + + // ////////////// TODO: REMOVE THOSE CONSTANTS ////////// + //Parameters given by RMS User , for the prototype we set at + //predefined values + + // = 0.5; to check the influence of this parameter , actually has 1 problem + const double PRICE_OVER_DENIED_COST = 0.5; + + // = 150; + // const unsigned int CAPACITY = 150; + + // = CAPACITY*1.2; + const double MAX_BOOKING_LIMIT = 180; + + // 0.8; // il faut calculer ro dans la requete + // const double SHOW_RATE = 0.9 ; + + // 120; + // const unsigned int NET_BOOKINGS = 120; + // const int OVERBOOKING_METHOD_TYPE = 0; + + + // service level parameters + //pSHOW_RATEbability that we have to deny one or more passengers = 1/10.000 + const double SERVICE_LEVEL1 = 0.0001; + + //the fraction of passengers who will be denied to board = 1 over 10.000 + const double SERVICE_LEVEL2 = 0.0001; + const int SERVICE_LEVEL_TYPE = 2; + + //parameters fSHOW_RATEm Forecaster + //demand average and deviation for a flight date + // const double DEMAND_AVERAGE = 135; + + //100,10 + // const double DEMAND_DEVIATION = 10; + // const double NS_PERCENTAGE = 0.1; + //10,2 + // const double NS_DEVIATION = 0.02; + // const double REMAINING_CANCELLATIONS_PERCENTAGE = 0.2; + //20,5 + const double CANCELLATIONS_DEVIATION = 0.05; + // ////////////// END OF TODO: REMOVE THOSE CONSTANTS ////////// + + // ////////////////////////////////////////////////////////////////////// + FldDistributionParameters Overbooking::getOverbookingCalculation () const { + FldDistributionParameters resultOBPercentage; + + const FldOverbookingPolicy::EN_Policy lPolicy = _policy.getPolicy(); + + switch (lPolicy) { + case FldOverbookingPolicy::HEUR: + resultOBPercentage = calculateHeuristic(); + break; + case FldOverbookingPolicy::RISK: + resultOBPercentage = calculateRiskBased(); + break; + case FldOverbookingPolicy::SL1: + resultOBPercentage = calculateServiceLevel(); + break; + case FldOverbookingPolicy::HYBRID: + resultOBPercentage = calculateHybridPolicy(); + break; + default: + resultOBPercentage = calculateHeuristic(); + break; + } + return resultOBPercentage; + } + + // 0 : Method Heuristic take No show and cancellations infor + //to calculate the Overbooking percentage and deviation + // ////////////////////////////////////////////////////////////////////// + FldDistributionParameters Overbooking::calculateHeuristic() const { + FldDistributionParameters resultOBPercentage; + + const double lCancellationsPercentage = + _remainingCancellationDistributionParameters.getMean() + * _netBookings / _capacity; + + // Overbooking average percentage + const double lNoShow = _noShowDistributionParameters.getMean(); + const double lOBMean = (lNoShow + lCancellationsPercentage) + / (1 - (lNoShow + lCancellationsPercentage)); + resultOBPercentage.setMean (lOBMean); + + // Overbooking deviation (heuristic) + const double lNSStdDev = + _noShowDistributionParameters.getStandardDeviation(); + const double lNSVariance = lNSStdDev * lNSStdDev; + + const double lCxStdDev = + _cancellationDistributionParameters.getStandardDeviation(); + const double lCxVariance = lCxStdDev * lCxStdDev; + + const double lOBStdDev = sqrt (lNSVariance + lCxVariance); + resultOBPercentage.setStandardDeviation (lOBStdDev); + + return resultOBPercentage ; + } + + // 1 : Method Risk based take No show and cancellations infor + //to calculate the Overbooking percentage and deviation + // ////////////////////////////////////////////////////////////////////// + FldDistributionParameters Overbooking::calculateRiskBased() const { + FldDistributionParameters resultOBPercentage; + + // take the Overbooking average and deviation by Heuristic method + // in order to calculate some parameters ? show rate par exemple + resultOBPercentage = calculateHeuristic(); + + //Calculation SHOW_RATE : Shows rate = shows/net booking; + //Calculation booking limit + const double lBookingLimit = calculateBookingLimit (); + + const double lOBMean = lBookingLimit / _capacity - 1.0; + resultOBPercentage.setMean (lOBMean); + + return resultOBPercentage; + } + + // 2 : Service level policy + // ////////////////////////////////////////////////////////////////////// + FldDistributionParameters Overbooking::calculateServiceLevel() const { + FldDistributionParameters resultOBPercentage; + + // No-Show Rate + const double lNoShowMean = _noShowDistributionParameters.getMean(); + + // service level 1 + unsigned int b = _capacity; + switch (SERVICE_LEVEL_TYPE){ + case 1: default: { + double test = serviceLevel1 (lNoShowMean, b, _capacity); + while (test < SERVICE_LEVEL1) { + b++; + test = serviceLevel1 (lNoShowMean, b, _capacity); + } + break; + } + case 2: { + // service level 2 + double test = fractionServiceLevel2 (lNoShowMean, b, _capacity); + while (test < SERVICE_LEVEL2){ + b++; + test = fractionServiceLevel2 (lNoShowMean, b, _capacity); + } + break; + } + } + resultOBPercentage.setMean (static_cast<double>(b) / _capacity - 1.0); + // TODO: To be altered + resultOBPercentage.setStandardDeviation (0); + + return resultOBPercentage; + } + + // 3 : Hybrid policy + // ////////////////////////////////////////////////////////////////////// + FldDistributionParameters Overbooking::calculateHybridPolicy() const { + FldDistributionParameters resultOBPercentage; + + FldDistributionParameters resultOBPercentage_1 = calculateRiskBased(); + FldDistributionParameters resultOBPercentage_2 = calculateServiceLevel(); + + //intermediate step to calculate the OB% + const double lMean1 = resultOBPercentage_1.getMean(); + const double lMean2 = resultOBPercentage_2.getMean(); + const double lSDeviation1 = resultOBPercentage_1.getStandardDeviation(); + const double lSDeviation2 = resultOBPercentage_2.getStandardDeviation(); + + //The hybrid method gets the minimum value + if (lMean1 > lMean2) { + resultOBPercentage.setMean (lMean2); + resultOBPercentage.setStandardDeviation (lSDeviation2); + return resultOBPercentage; + } + assert (lMean1 <= lMean2); + + resultOBPercentage.setMean (lMean1); + resultOBPercentage.setStandardDeviation (lSDeviation1); + + return resultOBPercentage; + } + + //Distribution + //binomial distribution, normal distribution + + // Service level + // in the Service Level policy method we can switch between service + // level 1 and 2 in the Hybrid policy, because they are constraints + // so we can choose one or the other or the two + + + // useful functions + // ////////////////////////////////////////////////////////////////////// + double Overbooking::calculateBookingLimit () const { + double resultBookingLimit = _capacity; + + // Demand Distribution Parameters + const double lDemandMean = _demandDistributionParameters.getMean(); + const double lDemandStdDev = + _demandDistributionParameters.getStandardDeviation(); + + // Algorithm + double pNormal = + gsl_cdf_gaussian_Q (_capacity - lDemandMean, lDemandStdDev); + + // double pNormal = probabilityNormal (CAPACITY, DEMAND_AVERAGE, + // DEMAND_DEVIATION); + + if (PRICE_OVER_DENIED_COST >= 1 - pNormal) { + resultBookingLimit = MAX_BOOKING_LIMIT; + return resultBookingLimit; + } + assert (PRICE_OVER_DENIED_COST < 1 - pNormal); + + pNormal = gsl_cdf_gaussian_Q (_capacity - 1 - lDemandMean, + lDemandStdDev); + + // pNormal = probabilityNormal (CAPACITY-1, DEMAND_AVERAGE, + // DEMAND_DEVIATION); + + const double lNoShowMean = _noShowDistributionParameters.getMean(); + + double lProbability = (1 - pNormal) + * gsl_sf_pow_int (lNoShowMean, _capacity); + + int counter = 1; + while ((lProbability < PRICE_OVER_DENIED_COST) && (counter < 100)) { + counter++; + if (resultBookingLimit >= MAX_BOOKING_LIMIT) { + return resultBookingLimit; + + } else { + resultBookingLimit += 1.0; + } + + const unsigned int b = static_cast<unsigned int> (resultBookingLimit); + + pNormal = gsl_cdf_gaussian_Q (b + 1 - lDemandMean, lDemandStdDev); + + // pNormal = probabilityNormal (b+1, DEMAND_AVERAGE, DEMAND_DEVIATION); + + assert (_capacity > 1); + assert (b - _capacity + 1 > 0); + // assert (b >= 0); (derived from the other two) + + + // The cumulated probability that the number of shows exceeds + // the leg/cabin physical capacity + lProbability += (1+pNormal) + * lNoShowMean * gsl_ran_binomial_pdf (_capacity-1, lNoShowMean, b); + + } + return resultBookingLimit; + } + + + // Private useful functions, some of them are to be replaced by gsl + // library's functions + + // ////////////////////////////////////////////////////////////////////// + //to be deleted, already available in gsl lib + //cumulated binomial probability + double Overbooking::probabilityNormal (const int b, const double average, + const double sdeviation) const { + double resultCdf = 0.0; + + for (int i=0; i < b+1 ; i++) { + resultCdf += 1 /( sqrt(2 * M_PI) ) + * gsl_sf_exp (-1* (gsl_sf_pow_int(i-average, 2)) / (2*sdeviation)); + } + return resultCdf; + } + + // ////////////////////////////////////////////////////////////////////// + + // to be deleted, already available in gsl lib, gsl_ran_binomial_pdf(unsigned int k, double SHOW_RATE, unsigned int b) + double Overbooking::binomialProbability_F_b_s (const double iShowRate, + const int b, + const int k) const { + double Factorials = gsl_sf_fact(b)/gsl_sf_fact(k)/gsl_sf_fact(b-k); + double f = Factorials* + gsl_sf_pow_int(iShowRate, k)*gsl_sf_pow_int(1-iShowRate, b-k) ; + + return f; + } + + // pSHOW_RATEbability to deny one or more services + // ////////////////////////////////////////////////////////////////////// + + + + ////////////// Private functions for Servive level policies///////////// + + // service level 1 : cumulated probability of having no-shows + //the constant SHOW_RATE can be changed in local variable in this function + + // ////////////////////////////////////////////////////////////////////// + double Overbooking::serviceLevel1 (const double iShowRate, + const int b, const int C) const { + double resultProbability = 1.0; + for (int i = 1; i<=C; i++) { + resultProbability -= gsl_ran_binomial_pdf (i, iShowRate, b);} + return resultProbability; + } + + //////////////fraction of customers who will be denied service/////////////// + double Overbooking::fractionServiceLevel2 (const double iShowRate, + const int b, const int C) const { + double resultFraction = serviceLevel1 (iShowRate, b-1, _capacity-1) + - C / b / iShowRate * serviceLevel1 (iShowRate, b, _capacity); + + return resultFraction; + } +} + + + /* where can I move this main function ?*/ + // int main(){ + //tester = a supprimer + // double []test; + // overBookingCalculation tester = new overBookingCalculation("AY", "831"); + // test = tester.getOverbookingCalculation(2); + + // System.out.println("OB % = " + test[0]); + // System.out.println("OB deviation = " + test[1]); + + + Modified: trunk/rmol/rmol/bom/Overbooking.hpp =================================================================== --- trunk/rmol/rmol/bom/Overbooking.hpp 2009-03-20 17:03:01 UTC (rev 179) +++ trunk/rmol/rmol/bom/Overbooking.hpp 2009-03-22 16:47:07 UTC (rev 180) @@ -1,227 +1,227 @@ -#ifndef __RMOL_OVERBOOKING_HPP -#define __RMOL_OVERBOOKING_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <iostream> -#include <vector> -// RMOL -#include <rmol/field/FldDistributionParameters.hpp> -#include <rmol/field/FldOverbookingPolicy.hpp> -#include <rmol/bom/DistributionParameterList.hpp> -#include <rmol/bom/BomAbstract.hpp> - -namespace RMOL { - - /** Class holding the algorithms for the optimisation of the - overbooking controls. */ - class Overbooking : public BomAbstract { - /** Friend Classes - <br>Those classes need to access the internal attributes of this object - in order to construct and initialise it.*/ - friend class FacOverbooking; - - public: - // ///////// Getters ///////// - /** Get the overbooking calculation policy. */ - const FldOverbookingPolicy& getPolicy () const { - return _policy; - } - - /** Get the overbooking percentage. */ - double getOverbookingPercentage () const { - return _overbookingPercentage; - } - - /** Get the load factor. */ - double getLoadFactor () const { - return _loadFactor; - } - - /** Get the capacity. */ - unsigned int getCapacity () const { - return _capacity; - } - - /** Get the net bookings. */ - unsigned int getNetBookings () const { - return _netBookings; - } - - - /** Get the No-Show Distribution Parameters. */ - FldDistributionParameters getNoShowDistributionParameters () const { - return _noShowDistributionParameters; - } - - /** Get the Cancellation Distribution Parameters. */ - FldDistributionParameters getCancellationDistributionParameters () const { - return _cancellationDistributionParameters; - } - - /** Get the Remaining Cancellation Distribution Parameters. */ - FldDistributionParameters getRemainingCancellationDistributionParameters () const { - return _remainingCancellationDistributionParameters; - } - - /** Get the Demand Distribution Parameters. */ - FldDistributionParameters getDemandDistributionParameters () const { - return _demandDistributionParameters; - } - - // ///////// Setters ///////// - /** Set the overbooking calculation policy. */ - void setOverbookingPercentage (const FldOverbookingPolicy& iPolicy) { - _policy = iPolicy; - } - - /** Set the overbooking percentage. */ - void setOverbookingPercentage (const double iOverbookingPercentage) { - _overbookingPercentage = iOverbookingPercentage; - } - - /** Set the load factor. */ - void setLoadFactor (const double iLoadFactor) { - _loadFactor = iLoadFactor; - } - - /** Set the No-Show Distribution Parameters. */ - void setNoShowDistributionParameters (const FldDistributionParameters iNoShowDistributionParameters) { - _noShowDistributionParameters = iNoShowDistributionParameters; - } - - /** Set the Cancellation Distribution Parameters. */ - void setCancellationDistributionParameters (const FldDistributionParameters iCancellationDistributionParameters) { - _cancellationDistributionParameters = iCancellationDistributionParameters; - } - - /** Set the Remaining Cancellation Distribution Parameters. */ - void setRemainingCancellationDistributionParameters (const FldDistributionParameters iRemainingCancellationDistributionParameters) { - _remainingCancellationDistributionParameters = - iRemainingCancellationDistributionParameters; - } - - /** Set the Demand Distribution Parameters. */ - void setDemandDistributionParameters (const FldDistributionParameters iDemandDistributionParameters) { - _demandDistributionParameters = iDemandDistributionParameters; - } - - /** Set the capacity. */ - void setCapacity (const unsigned int iCapacity) { - _capacity = iCapacity; - } - - /** Set the net bookings. */ - void setNetBookings (const unsigned int iNetBookings) { - _netBookings = iNetBookings; - } - - - // /////////// - /** This function return the OB% with its standard deviation - following the given choice of method*/ - FldDistributionParameters getOverbookingCalculation () const; - - /** This function calculates the OB% by the heuristic method */ - FldDistributionParameters calculateHeuristic() const; - - /** This function calculates the OB% by the cost-based method */ - FldDistributionParameters calculateRiskBased() const; - - /** This function calculates the OB% by the service level policies */ - FldDistributionParameters calculateServiceLevel() const; - - /** This function calculates the OB% by the Hybrid policy*/ - FldDistributionParameters calculateHybridPolicy() const; - - - public: - // ///////// Display methods //////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream&) const; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream&); - - /** Get the serialised version of the Place object. */ - std::string toString() const; - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const; - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const; - - /** Display the full Place context. */ - const std::string display() const; - - /** Display a short Place context. */ - const std::string shortDisplay() const; - - - private: - /** Constructors. - <br>Protected to force the use of the Factory. */ - Overbooking (); - Overbooking (const Overbooking&); - Overbooking (const FldOverbookingPolicy&); - - /** Destructor. */ - virtual ~Overbooking(); - - - private: - /** Calculate the booking limit. */ - double calculateBookingLimit () const; - - /** Calculate the normal probability. */ - double probabilityNormal (const int, const double, const double) const; - - /** Calculate the binomial probability. */ - double binomialProbability_F_b_s (const double, - const int, const int) const; - /** Calculate the first service level. */ - double serviceLevel1 (const double, const int, const int) const; - - /** Calculate the fraction of service level 2. */ - double fractionServiceLevel2 (const double , const int , const int) const; - - - private: - // /////// Attributes ////////// - /** Overbooking Calculation Policy. */ - FldOverbookingPolicy _policy; - - /** Overbooking percentage. */ - double _overbookingPercentage; - - /** Capacity. */ - unsigned int _capacity; - - /** Net Bookings. */ - unsigned int _netBookings; - - /** Load Factor. */ - double _loadFactor; - - /** No-Show Distribution Parameters. */ - FldDistributionParameters _noShowDistributionParameters; - - /** Cancellation Distribution Parameters. */ - FldDistributionParameters _cancellationDistributionParameters; - - /** Remaining Cancellation Distribution Parameters. */ - FldDistributionParameters _remainingCancellationDistributionParameters; - - /** Demand Distribution Parameters. */ - FldDistributionParameters _demandDistributionParameters; - }; -} - -#endif // __RMOL_OVERBOOKING_HPP +#ifndef __RMOL_OVERBOOKING_HPP +#define __RMOL_OVERBOOKING_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iostream> +#include <vector> +// RMOL +#include <rmol/field/FldDistributionParameters.hpp> +#include <rmol/field/FldOverbookingPolicy.hpp> +#include <rmol/bom/DistributionParameterList.hpp> +#include <rmol/bom/BomAbstract.hpp> + +namespace RMOL { + + /** Class holding the algorithms for the optimisation of the + overbooking controls. */ + class Overbooking : public BomAbstract { + /** Friend Classes + <br>Those classes need to access the internal attributes of this object + in order to construct and initialise it.*/ + friend class FacOverbooking; + + public: + // ///////// Getters ///////// + /** Get the overbooking calculation policy. */ + const FldOverbookingPolicy& getPolicy () const { + return _policy; + } + + /** Get the overbooking percentage. */ + double getOverbookingPercentage () const { + return _overbookingPercentage; + } + + /** Get the load factor. */ + double getLoadFactor () const { + return _loadFactor; + } + + /** Get the capacity. */ + unsigned int getCapacity () const { + return _capacity; + } + + /** Get the net bookings. */ + unsigned int getNetBookings () const { + return _netBookings; + } + + + /** Get the No-Show Distribution Parameters. */ + FldDistributionParameters getNoShowDistributionParameters () const { + return _noShowDistributionParameters; + } + + /** Get the Cancellation Distribution Parameters. */ + FldDistributionParameters getCancellationDistributionParameters () const { + return _cancellationDistributionParameters; + } + + /** Get the Remaining Cancellation Distribution Parameters. */ + FldDistributionParameters getRemainingCancellationDistributionParameters () const { + return _remainingCancellationDistributionParameters; + } + + /** Get the Demand Distribution Parameters. */ + FldDistributionParameters getDemandDistributionParameters () const { + return _demandDistributionParameters; + } + + // ///////// Setters ///////// + /** Set the overbooking calculation policy. */ + void setOverbookingPercentage (const FldOverbookingPolicy& iPolicy) { + _policy = iPolicy; + } + + /** Set the overbooking percentage. */ + void setOverbookingPercentage (const double iOverbookingPercentage) { + _overbookingPercentage = iOverbookingPercentage; + } + + /** Set the load factor. */ + void setLoadFactor (const double iLoadFactor) { + _loadFactor = iLoadFactor; + } + + /** Set the No-Show Distribution Parameters. */ + void setNoShowDistributionParameters (const FldDistributionParameters iNoShowDistributionParameters) { + _noShowDistributionParameters = iNoShowDistributionParameters; + } + + /** Set the Cancellation Distribution Parameters. */ + void setCancellationDistributionParameters (const FldDistributionParameters iCancellationDistributionParameters) { + _cancellationDistributionParameters = iCancellationDistributionParameters; + } + + /** Set the Remaining Cancellation Distribution Parameters. */ + void setRemainingCancellationDistributionParameters (const FldDistributionParameters iRemainingCancellationDistributionParameters) { + _remainingCancellationDistributionParameters = + iRemainingCancellationDistributionParameters; + } + + /** Set the Demand Distribution Parameters. */ + void setDemandDistributionParameters (const FldDistributionParameters iDemandDistributionParameters) { + _demandDistributionParameters = iDemandDistributionParameters; + } + + /** Set the capacity. */ + void setCapacity (const unsigned int iCapacity) { + _capacity = iCapacity; + } + + /** Set the net bookings. */ + void setNetBookings (const unsigned int iNetBookings) { + _netBookings = iNetBookings; + } + + + // /////////// + /** This function return the OB% with its standard deviation + following the given choice of method*/ + FldDistributionParameters getOverbookingCalculation () const; + + /** This function calculates the OB% by the heuristic method */ + FldDistributionParameters calculateHeuristic() const; + + /** This function calculates the OB% by the cost-based method */ + FldDistributionParameters calculateRiskBased() const; + + /** This function calculates the OB% by the service level policies */ + FldDistributionParameters calculateServiceLevel() const; + + /** This function calculates the OB% by the Hybrid policy*/ + FldDistributionParameters calculateHybridPolicy() const; + + + public: + // ///////// Display methods //////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream&) const; + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream&); + + /** Get the serialised version of the Place object. */ + std::string toString() const; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + /** Display the full Place context. */ + const std::string display() const; + + /** Display a short Place context. */ + const std::string shortDisplay() const; + + + private: + /** Constructors. + <br>Protected to force the use of the Factory. */ + Overbooking (); + Overbooking (const Overbooking&); + Overbooking (const FldOverbookingPolicy&); + + /** Destructor. */ + virtual ~Overbooking(); + + + private: + /** Calculate the booking limit. */ + double calculateBookingLimit () const; + + /** Calculate the normal probability. */ + double probabilityNormal (const int, const double, const double) const; + + /** Calculate the binomial probability. */ + double binomialProbability_F_b_s (const double, + const int, const int) const; + /** Calculate the first service level. */ + double serviceLevel1 (const double, const int, const int) const; + + /** Calculate the fraction of service level 2. */ + double fractionServiceLevel2 (const double , const int , const int) const; + + + private: + // /////// Attributes ////////// + /** Overbooking Calculation Policy. */ + FldOverbookingPolicy _policy; + + /** Overbooking percentage. */ + double _overbookingPercentage; + + /** Capacity. */ + unsigned int _capacity; + + /** Net Bookings. */ + unsigned int _netBookings; + + /** Load Factor. */ + double _loadFactor; + + /** No-Show Distribution Parameters. */ + FldDistributionParameters _noShowDistributionParameters; + + /** Cancellation Distribution Parameters. */ + FldDistributionParameters _cancellationDistributionParameters; + + /** Remaining Cancellation Distribution Parameters. */ + FldDistributionParameters _remainingCancellationDistributionParameters; + + /** Demand Distribution Parameters. */ + FldDistributionParameters _demandDistributionParameters; + }; +} + +#endif // __RMOL_OVERBOOKING_HPP Modified: trunk/rmol/rmol/field/FldOverbookingPolicy.cpp =================================================================== --- trunk/rmol/rmol/field/FldOverbookingPolicy.cpp 2009-03-20 17:03:01 UTC (rev 179) +++ trunk/rmol/rmol/field/FldOverbookingPolicy.cpp 2009-03-22 16:47:07 UTC (rev 180) @@ -1,44 +1,44 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -#include <rmol/field/FldOverbookingPolicy.hpp> - -namespace RMOL { - - // ////////////////////////////////////////////////////////////////////// - const std::string FldOverbookingPolicy:: - _labels[FldOverbookingPolicy::LAST_VALUE] = {"HEUR", "RISK", "SL1", "SL2", - "HYBRID"}; - - // ////////////////////////////////////////////////////////////////////// - FldOverbookingPolicy:: - FldOverbookingPolicy (const FldOverbookingPolicy& iPolicy) : - _policy (iPolicy.getPolicy()) { - } - - // ////////////////////////////////////////////////////////////////////// - FldOverbookingPolicy:: - FldOverbookingPolicy (const EN_Policy iPolicy) : - _policy (iPolicy) { - } - - // ////////////////////////////////////////////////////////////////////// - FldOverbookingPolicy::~FldOverbookingPolicy() { - } - - // ////////////////////////////////////////////////////////////////////// - const std::string& FldOverbookingPolicy:: - getLabel (const FldOverbookingPolicy::EN_Policy& iPolicy) { - return FldOverbookingPolicy::_labels[iPolicy]; - } - - // ////////////////////////////////////////////////////////////////////// - void FldOverbookingPolicy::toStream (std::ostream& ioOut) const { - ioOut << getLabel (_policy); - } - - // ////////////////////////////////////////////////////////////////////// - void FldOverbookingPolicy::fromStream (std::istream& ioIn) { - } - -} +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +#include <rmol/field/FldOverbookingPolicy.hpp> + +namespace RMOL { + + // ////////////////////////////////////////////////////////////////////// + const std::string FldOverbookingPolicy:: + _labels[FldOverbookingPolicy::LAST_VALUE] = {"HEUR", "RISK", "SL1", "SL2", + "HYBRID"}; + + // ////////////////////////////////////////////////////////////////////// + FldOverbookingPolicy:: + FldOverbookingPolicy (const FldOverbookingPolicy& iPolicy) : + _policy (iPolicy.getPolicy()) { + } + + // ////////////////////////////////////////////////////////////////////// + FldOverbookingPolicy:: + FldOverbookingPolicy (const EN_Policy iPolicy) : + _policy (iPolicy) { + } + + // ////////////////////////////////////////////////////////////////////// + FldOverbookingPolicy::~FldOverbookingPolicy() { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string& FldOverbookingPolicy:: + getLabel (const FldOverbookingPolicy::EN_Policy& iPolicy) { + return FldOverbookingPolicy::_labels[iPolicy]; + } + + // ////////////////////////////////////////////////////////////////////// + void FldOverbookingPolicy::toStream (std::ostream& ioOut) const { + ioOut << getLabel (_policy); + } + + // ////////////////////////////////////////////////////////////////////// + void FldOverbookingPolicy::fromStream (std::istream& ioIn) { + } + +} Modified: trunk/rmol/rmol/field/FldOverbookingPolicy.hpp =================================================================== --- trunk/rmol/rmol/field/FldOverbookingPolicy.hpp 2009-03-20 17:03:01 UTC (rev 179) +++ trunk/rmol/rmol/field/FldOverbookingPolicy.hpp 2009-03-22 16:47:07 UTC (rev 180) @@ -1,69 +1,69 @@ -#ifndef __RMOL_FIELD_FLDOVERBOOKING_POLICY_HPP -#define __RMOL_FIELD_FLDOVERBOOKING_POLICY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <string> -// RMOL -#include <rmol/field/FldAbstract.hpp> - -namespace RMOL { - - /** Class wrapping the policy for the overbooking calculation. */ - class FldOverbookingPolicy : public FldAbstract { - public: - typedef enum { - HEUR = 0, // Heuristic - RISK, // Risk-Based - SL1, // Service-Level 1 - SL2, // Service-Level 2 - HYBRID, // Hybrid - LAST_VALUE - } EN_Policy; - - /** Get the label (BOM type) as a string. */ - static const std::string& getLabel (const EN_Policy&); - - // Getters - /** Getter for the mean value. */ - EN_Policy getPolicy() const { - return _policy; - } - - // Setters - /** Setter for the mean value. */ - void setPolicy (const EN_Policy& iPolicy) { - _policy = iPolicy; - }... [truncated message content] |
From: <den...@us...> - 2009-03-20 17:03:11
|
Revision: 179 http://rmol.svn.sourceforge.net/rmol/?rev=179&view=rev Author: denis_arnaud Date: 2009-03-20 17:03:01 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Update the number of the version and the README. Modified Paths: -------------- trunk/rmol/README trunk/rmol/configure.ac Modified: trunk/rmol/README =================================================================== --- trunk/rmol/README 2009-03-20 16:09:10 UTC (rev 178) +++ trunk/rmol/README 2009-03-20 17:03:01 UTC (rev 179) @@ -21,7 +21,7 @@ http://sourceforge.net/project/showfiles.php?group_id=177703 Then, as usual, you can just type the following sequence: -"./configure --prefix=~/dev/deliveries/rmol-0.15 && make && make check && cd test && ./testLibsh" +"./configure --prefix=/projects/sim/deliveries/rmol-0.19.0 && make && make check && cd test && ./testLibsh" Of course, if you want to install the library (librmol*.so*), just type: "make install". Modified: trunk/rmol/configure.ac =================================================================== --- trunk/rmol/configure.ac 2009-03-20 16:09:10 UTC (rev 178) +++ trunk/rmol/configure.ac 2009-03-20 17:03:01 UTC (rev 179) @@ -2,7 +2,7 @@ #------------------------------------------------------------------- AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (C) 2007-2009 Denis Arnaud <den...@us...>]) -AC_INIT([RMOL],[0.18.0],[den...@us...],[rmol]) +AC_INIT([RMOL],[0.19.0],[den...@us...],[rmol]) AC_CONFIG_HEADER([rmol/config.h]) AC_CONFIG_SRCDIR([rmol/basic/BasConst.cpp]) AC_CONFIG_AUX_DIR([config]) @@ -15,7 +15,7 @@ AC_SUBST(RPM_RELEASE) # Shared library versioning -GENERIC_LIBRARY_VERSION="0:18:0" +GENERIC_LIBRARY_VERSION="0:19:0" # | | | # +------+ | +---+ # | | | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <qua...@us...> - 2009-03-20 16:09:15
|
Revision: 178 http://rmol.svn.sourceforge.net/rmol/?rev=178&view=rev Author: quannaus Date: 2009-03-20 16:09:10 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Update the booking limit vector for EMSR method. Modified Paths: -------------- trunk/rmol/rmol/RMOL_Service.hpp trunk/rmol/rmol/service/RMOL_Service.cpp trunk/rmol/test/sample2.csv Modified: trunk/rmol/rmol/RMOL_Service.hpp =================================================================== --- trunk/rmol/rmol/RMOL_Service.hpp 2009-03-08 23:15:40 UTC (rev 177) +++ trunk/rmol/rmol/RMOL_Service.hpp 2009-03-20 16:09:10 UTC (rev 178) @@ -49,8 +49,8 @@ void heuristicOptimisationByEmsr (); /** Single resource optimization that uses EMSR heuristic and - returns a vector of cumulated booking limits. */ - void heuristicOptimisationByEmsr (BookingLimitVector_T&); + returns a bid-price vector and a vector of cumulated booking limits. */ + void heuristicOptimisationByEmsr (BidPriceVector_T&, BookingLimitVector_T&); /** Single resource optimization using EMSR-a heuristic. */ void heuristicOptimisationByEmsrA (); Modified: trunk/rmol/rmol/service/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-08 23:15:40 UTC (rev 177) +++ trunk/rmol/rmol/service/RMOL_Service.cpp 2009-03-20 16:09:10 UTC (rev 178) @@ -92,8 +92,8 @@ // ////////////////////////////////////////////////////////////////////// void RMOL_Service:: - optimalOptimisationByMCIntegration (const int K, - BookingLimitVector_T& ioBookingLimitVector) { + optimalOptimisationByMCIntegration(const int K, + BookingLimitVector_T& ioBookingLimitVector){ assert (_rmolServiceContext != NULL); const double iCapacity = _rmolServiceContext->getCapacity(); @@ -163,7 +163,8 @@ // ////////////////////////////////////////////////////////////////////// void RMOL_Service:: - heuristicOptimisationByEmsr (BidPriceVector_T& ioBidPriceVector) { + heuristicOptimisationByEmsr (BidPriceVector_T& ioBidPriceVector, + BookingLimitVector_T& ioBookingLimitVector) { assert (_rmolServiceContext != NULL); const double iCapacity = _rmolServiceContext->getCapacity(); BucketHolder* ioBucketHolder_ptr = _rmolServiceContext->getBucketHolder(); @@ -171,6 +172,15 @@ Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, ioBidPriceVector); + + // Update the booking limit vector. + for (ioBucketHolder_ptr->begin(); ioBucketHolder_ptr->hasNotReachedEnd(); + ioBucketHolder_ptr->iterate()) { + Bucket& currentBucket = ioBucketHolder_ptr->getCurrentBucket(); + const double lBookingLimit = currentBucket.getCumulatedBookingLimit(); + ioBookingLimitVector.push_back (lBookingLimit); + } + } // ////////////////////////////////////////////////////////////////////// Modified: trunk/rmol/test/sample2.csv =================================================================== --- trunk/rmol/test/sample2.csv 2009-03-08 23:15:40 UTC (rev 177) +++ trunk/rmol/test/sample2.csv 2009-03-20 16:09:10 UTC (rev 178) @@ -1,5 +1,6 @@ -price; mean; standard deviation; -1050; 17.3; 5.8; -567; 45.1; 15.0; -534; 39.6; 13.2; -520; 34.0; 11.3; +../../rmol/service/RMOL_Service.cpp:90: 500Class; Price; Mean; Std Dev; Protection; Cum. Protection; Cum. Bkg Limit; +1; 100([2.22507e-308, 100]), upper yield = 100.00; , mean = 20.00; , std_dev = 9.00; , protection = 15.23; , cumulative protection = 15.23; , booking limit = 0.00, cumulative booking limit = 500.00 +2; 70([2.22507e-308, 70]), upper yield = 70.00; , mean = 45.00; , std_dev = 12.00; , protection = 50.57; , cumulative protection = 65.80; , booking limit = 0.00, cumulative booking limit = 484.77 +3; 42([2.22507e-308, 42]), upper yield = 42.00; , mean = 0.00; , std_dev = 0.00; , protection = 434.20; , cumulative protection = 500.00; , booking limit = 0.00, cumulative booking limit = 434.20 +Cabin Capacity = 500; Total Mean Demand = 65; Demand Factor = 0.13; Optimal Revenue = 23299.5 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-08 23:15:49
|
Revision: 177 http://rmol.svn.sourceforge.net/rmol/?rev=177&view=rev Author: denis_arnaud Date: 2009-03-08 23:15:40 +0000 (Sun, 08 Mar 2009) Log Message: ----------- [Build-RPM-F10] Corrected the RPM specification file according to review request (https://bugzilla.redhat.com/show_bug.cgi?id=489233). Modified Paths: -------------- trunk/rmol/COPYING trunk/rmol/configure.ac trunk/rmol/rmol.spec.in Modified: trunk/rmol/COPYING =================================================================== --- trunk/rmol/COPYING 2009-03-08 21:23:17 UTC (rev 176) +++ trunk/rmol/COPYING 2009-03-08 23:15:40 UTC (rev 177) @@ -501,3 +501,4 @@ That's all there is to it! +Source: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html Modified: trunk/rmol/configure.ac =================================================================== --- trunk/rmol/configure.ac 2009-03-08 21:23:17 UTC (rev 176) +++ trunk/rmol/configure.ac 2009-03-08 23:15:40 UTC (rev 177) @@ -11,7 +11,7 @@ AM_CONDITIONAL([HAVE_CPPUNIT], [test "x$CPPUNIT_LIBS" != x]) # RPM release number -RPM_RELEASE="0.dev.1" +RPM_RELEASE="1" AC_SUBST(RPM_RELEASE) # Shared library versioning Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-08 21:23:17 UTC (rev 176) +++ trunk/rmol/rmol.spec.in 2009-03-08 23:15:40 UTC (rev 177) @@ -1,18 +1,12 @@ # -%define version @VERSION@ -%define release @RPM_RELEASE@ - -# Name: @PACKAGE@ -Version: %{version} -Release: %{release} -Vendor: The RMOL Team -Distribution: Research Software +Version: @VERSION@ +Release: @RPM_RELEASE@%{?dist} Summary: @PACKAGE_NAME@ is a C++ library of Revenue Management and Optimisation classes and functions. Group: System Environment/Libraries -License: LGPL +License: LGPLv2 URL: http://%{name}.sourceforge.net Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -114,5 +108,7 @@ %doc %{_docdir}/%{name}-%{version} %changelog +* Sun Mar 8 2009 Denis Arnaud <den...@m4...> @RPM_RELEASE@ +- RPM release for Fedora 10 * Wed Mar 4 2009 Denis Arnaud <den...@m4...> @RPM_RELEASE@ - Second RPM release This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <den...@us...> - 2009-03-08 21:23:23
|
Revision: 176 http://rmol.svn.sourceforge.net/rmol/?rev=176&view=rev Author: denis_arnaud Date: 2009-03-08 21:23:17 +0000 (Sun, 08 Mar 2009) Log Message: ----------- [Build] Added a dependency on cppunit within the RPM specification file (rmol.spec.in). Modified Paths: -------------- trunk/rmol/rmol.spec.in Modified: trunk/rmol/rmol.spec.in =================================================================== --- trunk/rmol/rmol.spec.in 2009-03-08 19:51:59 UTC (rev 175) +++ trunk/rmol/rmol.spec.in 2009-03-08 21:23:17 UTC (rev 176) @@ -20,6 +20,7 @@ BuildRequires: automake, autoconf, libtool, gettext BuildRequires: gsl-devel >= 1.8 BuildRequires: boost-devel >= 1.34 +BuildRequires: cppunit-devel >= 1.10 #Requires: %description This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |