From: <qua...@us...> - 2010-11-04 17:31:01
|
Revision: 359 http://stdair.svn.sourceforge.net/stdair/?rev=359&view=rev Author: quannaus Date: 2010-11-04 17:30:55 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Removed the seed generator for trademgen in BomRoot. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-11-04 17:30:55 UTC (rev 359) @@ -11,6 +11,8 @@ #include <map> // Boost Random #include <boost/random/linear_congruential.hpp> +#include <boost/random/uniform_real.hpp> +#include <boost/random/variate_generator.hpp> // Boost (Extended STL) #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/posix_time/posix_time.hpp> @@ -426,6 +428,10 @@ /** Random number generator. */ typedef boost::minstd_rand BaseGenerator_T; + /** Uniform random generator. */ + typedef boost::variate_generator<stdair::BaseGenerator_T&, + boost::uniform_real<> > UniformGenerator_T; + // ////////////////////////////////////////////////////////////////////// // Probability /** Probability */ Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-11-04 17:30:55 UTC (rev 359) @@ -11,8 +11,7 @@ // //////////////////////////////////////////////////////////////////// BomRoot::BomRoot (const Key_T& iKey) - : _key (iKey), _seed (DEFAULT_RANDOM_SEED), _generator (_seed), - _uniformGenerator (_generator, boost::uniform_real<> (0, 1)) { + : _key (iKey) { } // //////////////////////////////////////////////////////////////////// @@ -26,11 +25,4 @@ return oStr.str(); } - // //////////////////////////////////////////////////////////////////// - RandomSeed_T BomRoot::generateSeed () { - RealNumber_T lVariateUnif = _uniformGenerator() * 1e9; - RandomSeed_T oSeed = static_cast<RandomSeed_T> (lVariateUnif); - return oSeed; - } - } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-11-02 17:39:46 UTC (rev 358) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-11-04 17:30:55 UTC (rev 359) @@ -54,14 +54,6 @@ // Attributes Key_T _key; HolderMap_T _holderMap; - - // TEST - stdair::RandomSeed_T _seed; - stdair::BaseGenerator_T _generator; - boost::variate_generator<stdair::BaseGenerator_T&, - boost::uniform_real<> > _uniformGenerator; - public: - RandomSeed_T generateSeed (); }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |