TraDemGen Logo  1.00.9
C++ Simulated Travel Demand Generation Library
Loading...
Searching...
No Matches
RandomGenerationContext.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <sstream>
7// TraDemGen
9
10namespace TRADEMGEN {
11
12 // //////////////////////////////////////////////////////////////////////
14 : _numberOfRequestsGeneratedSoFar (0),
15 _cumulativeProbabilitySoFar (0.0) {
16 }
17
18 // //////////////////////////////////////////////////////////////////////
21 : _numberOfRequestsGeneratedSoFar (iRGC._numberOfRequestsGeneratedSoFar),
22 _cumulativeProbabilitySoFar (iRGC._cumulativeProbabilitySoFar) {
23 }
24
25 // //////////////////////////////////////////////////////////////////////
28
29 // //////////////////////////////////////////////////////////////////////
30 const std::string RandomGenerationContext::describe() const {
31 std::ostringstream oStr;
32 oStr << _numberOfRequestsGeneratedSoFar
33 << " => " << _cumulativeProbabilitySoFar;
34 return oStr.str();
35 }
36
37 // //////////////////////////////////////////////////////////////////////
39 ++_numberOfRequestsGeneratedSoFar;
40 }
41
42 // //////////////////////////////////////////////////////////////////////
44 _cumulativeProbabilitySoFar = 0.0;
45 _numberOfRequestsGeneratedSoFar = 0;
46 }
47
48}