00001 #ifndef __STDAIR_BAS_RANDOMGENERATION_HPP 00002 #define __STDAIR_BAS_RANDOMGENERATION_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // StdAir 00008 #include <stdair/stdair_basic_types.hpp> 00009 #include <stdair/stdair_maths_types.hpp> 00010 #include <stdair/basic/StructAbstract.hpp> 00011 00012 namespace stdair { 00013 00017 struct RandomGeneration : public StructAbstract { 00018 public: 00019 // //////////// Business Methods ///////////// 00024 RealNumber_T generateUniform01(); 00025 00030 RealNumber_T operator()() { 00031 return generateUniform01(); 00032 } 00033 00039 RealNumber_T generateUniform (const RealNumber_T&, const RealNumber_T&); 00040 00045 RealNumber_T generateNormal (const RealNumber_T&, const RealNumber_T&); 00046 00051 RealNumber_T generateExponential (const RealNumber_T&); 00052 00056 BaseGenerator_T& getBaseGenerator () { return _generator; } 00057 00058 00059 public: 00060 // ////////////// Display Support Methods ////////// 00064 const std::string describe() const; 00065 00066 00067 public: 00068 // ////////// Constructors and destructors ///////// 00072 RandomGeneration (const RandomSeed_T&); 00076 RandomGeneration(); 00077 00078 private: 00082 RandomGeneration (const RandomGeneration&); 00086 RandomGeneration& operator= (const RandomGeneration& iRandomGeneration) { 00087 _generator = iRandomGeneration._generator; 00088 return *this; 00089 } 00090 public: 00094 ~RandomGeneration(); 00095 00103 void init (const RandomSeed_T&); 00104 00105 // ////////// Attributes ////////// 00112 BaseGenerator_T _generator; 00113 }; 00114 00115 } 00116 #endif // __STDAIR_BAS_RANDOMGENERATION_HPP