TraDemGen Logo  0.2.2
C++ Simulated Travel Demand Generation Library
RandomGenerationContext.hpp
Go to the documentation of this file.
00001 #ifndef __TRADEMGEN_BAS_RANDOM_GENERATION_CONTEXT_HPP
00002 #define __TRADEMGEN_BAS_RANDOM_GENERATION_CONTEXT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir
00011 #include <stdair/stdair_basic_types.hpp>
00012 #include <stdair/stdair_maths_types.hpp>
00013 #include <stdair/basic/StructAbstract.hpp>
00014 
00015 namespace TRADEMGEN {
00016 
00020   struct RandomGenerationContext : public stdair::StructAbstract {
00021   public:
00022     // ////////// Getters /////////
00026     const stdair::Count_T& getNumberOfRequestsGeneratedSoFar() const {
00027       return _numberOfRequestsGeneratedSoFar;
00028     }
00029 
00034     const stdair::Probability_T& getCumulativeProbabilitySoFar() const {
00035       return _cumulativeProbabilitySoFar;
00036     }
00037     
00038   public:
00039     // ////////// Setters /////////
00043     void setNumberOfRequestsGeneratedSoFar (const stdair::Count_T& iCount) {
00044       _numberOfRequestsGeneratedSoFar = iCount;
00045     }
00046 
00051     void setCumulativeProbabilitySoFar (const stdair::Probability_T& iProb) {
00052       _cumulativeProbabilitySoFar = iProb;
00053     }
00054     
00055 
00056   public: 
00057     // ////////// Constructors and destructors /////////
00061     RandomGenerationContext();
00062 
00066     RandomGenerationContext (const RandomGenerationContext&);
00067 
00071     ~RandomGenerationContext();
00072     
00073 
00074   public:
00075     // /////////////// Business Methods //////////
00079     void incrementGeneratedRequestsCounter();
00080 
00084     void reset();
00085 
00086 
00087   public:
00088     // ////////////// Display Support Methods //////////
00092     const std::string describe() const;
00093 
00094 
00095   private:
00096     // ////////// Attributes //////////
00100     stdair::Count_T _numberOfRequestsGeneratedSoFar;
00101 
00106     stdair::Probability_T _cumulativeProbabilitySoFar;   
00107   };
00108 
00109 }
00110 #endif // __STDAIR_BAS_RANDOM_GENERATION_CONTEXT_HPP