From: <qua...@us...> - 2009-02-10 14:46:13
|
Revision: 164 http://rmol.svn.sourceforge.net/rmol/?rev=164&view=rev Author: quannaus Date: 2009-02-10 14:46:08 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Small change in the call for EMSR method. Modified Paths: -------------- trunk/rmol/rmol/RMOL_Service.cpp trunk/rmol/rmol/command/Optimiser.cpp trunk/rmol/rmol/command/Optimiser.hpp Modified: trunk/rmol/rmol/RMOL_Service.cpp =================================================================== --- trunk/rmol/rmol/RMOL_Service.cpp 2009-01-13 16:48:12 UTC (rev 163) +++ trunk/rmol/rmol/RMOL_Service.cpp 2009-02-10 14:46:08 UTC (rev 164) @@ -3,6 +3,8 @@ // ////////////////////////////////////////////////////////////////////// // C #include <assert.h> +// STL +#include <iomanip> // RMOL #include <rmol/basic/BasConst_RMOL_Service.hpp> #include <rmol/field/FldYieldRange.hpp> @@ -125,25 +127,35 @@ const double iCapacity = _context->getCapacity(); BucketHolder* ioBucketHolder_ptr = _context->getBucketHolder(); assert (ioBucketHolder_ptr != NULL); + BidPriceVector_T lBidPriceVector; - Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr); + Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, + lBidPriceVector); // Display ioBucketHolder_ptr->display(); + + std::cout << "BVP: "; + 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:: - heuristicOptimisationByEmsr (BookingLimitVector_T& ioBookingLimitVector) { + heuristicOptimisationByEmsr (BidPriceVector_T& ioBidPriceVector) { assert (_context != NULL); const double iCapacity = _context->getCapacity(); BucketHolder* ioBucketHolder_ptr = _context->getBucketHolder(); assert (ioBucketHolder_ptr != NULL); - Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr); - - // Fill up booking vector - ioBucketHolder_ptr->fillup(ioBookingLimitVector); + Optimiser::heuristicOptimisationByEmsr (iCapacity, *ioBucketHolder_ptr, + ioBidPriceVector); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/rmol/rmol/command/Optimiser.cpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.cpp 2009-01-13 16:48:12 UTC (rev 163) +++ trunk/rmol/rmol/command/Optimiser.cpp 2009-02-10 14:46:08 UTC (rev 164) @@ -79,19 +79,11 @@ // ////////////////////////////////////////////////////////////////////// void Optimiser:: heuristicOptimisationByEmsr (const ResourceCapacity_T iCabinCapacity, - BucketHolder& ioBucketHolder) { - BidPriceVector_T lBidPriceVector; + BucketHolder& ioBucketHolder, + BidPriceVector_T& ioBidPriceVector) { Emsr::heuristicOptimisationByEmsr (iCabinCapacity, ioBucketHolder, - lBidPriceVector); - std::cout << "BVP: "; - 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; + ioBidPriceVector); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/rmol/rmol/command/Optimiser.hpp =================================================================== --- trunk/rmol/rmol/command/Optimiser.hpp 2009-01-13 16:48:12 UTC (rev 163) +++ trunk/rmol/rmol/command/Optimiser.hpp 2009-02-10 14:46:08 UTC (rev 164) @@ -47,7 +47,8 @@ overbooking. */ static void heuristicOptimisationByEmsr (const ResourceCapacity_T, - BucketHolder&); + BucketHolder&, + BidPriceVector_T&); /** EMRS-a algorithm. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |