00001 // ////////////////////////////////////////////////////////////////////// 00002 // Import section 00003 // ////////////////////////////////////////////////////////////////////// 00004 // STL 00005 #include <cmath> 00006 // RMOL Bom 00007 #include <rmol/bom/Bucket.hpp> 00008 #include <rmol/bom/BucketHolder.hpp> 00009 #include <rmol/bom/SellupProbabilityCalculator.hpp> 00010 00011 namespace RMOL { 00012 00013 // ////////////////////////////////////////////////////////////////////// 00014 void SellupProbabilityCalculator::calculateSellupProbability 00015 (BucketHolder& iBucketHolder, 00016 const double iQYield, 00017 const SellupFactorHolder_T& iSellupFactorHolder, 00018 SellupProbabilityVector_T& ioSellupProbabilityVector) { 00019 // Compute sell-up probability for each bucket and store it in a vector 00020 short j = 0; 00021 for (iBucketHolder.begin(); 00022 iBucketHolder.hasNotReachedEnd(); 00023 iBucketHolder.iterate()) { 00024 Bucket& lCurrentBucket = iBucketHolder.getCurrentBucket(); 00025 const double lYield = lCurrentBucket.getAverageYield(); 00026 const double probSellup = 00027 exp(-iSellupFactorHolder.at(j) *lYield/iQYield); 00028 ioSellupProbabilityVector.push_back(probSellup); 00029 j++; 00030 } 00031 } 00032 }
Generated on Sat Aug 13 2011 11:59:19 for RMOL by Doxygen 1.7.1