1.00.13
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
8
#include <
trademgen/basic/RandomGenerationContext.hpp
>
9
10
namespace
TRADEMGEN
{
11
12
// //////////////////////////////////////////////////////////////////////
13
RandomGenerationContext::RandomGenerationContext
()
14
: _numberOfRequestsGeneratedSoFar (0),
15
_cumulativeProbabilitySoFar (0.0) {
16
}
17
18
// //////////////////////////////////////////////////////////////////////
19
RandomGenerationContext::
20
RandomGenerationContext
(
const
RandomGenerationContext
& iRGC)
21
: _numberOfRequestsGeneratedSoFar (iRGC._numberOfRequestsGeneratedSoFar),
22
_cumulativeProbabilitySoFar (iRGC._cumulativeProbabilitySoFar) {
23
}
24
25
// //////////////////////////////////////////////////////////////////////
26
RandomGenerationContext::~RandomGenerationContext
() {
27
}
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
// //////////////////////////////////////////////////////////////////////
38
void
RandomGenerationContext::incrementGeneratedRequestsCounter
() {
39
++_numberOfRequestsGeneratedSoFar;
40
}
41
42
// //////////////////////////////////////////////////////////////////////
43
void
RandomGenerationContext::reset
() {
44
_cumulativeProbabilitySoFar = 0.0;
45
_numberOfRequestsGeneratedSoFar = 0;
46
}
47
48
}
RandomGenerationContext.hpp
TRADEMGEN
Definition
BasConst.cpp:10
TRADEMGEN::RandomGenerationContext::reset
void reset()
Definition
RandomGenerationContext.cpp:43
TRADEMGEN::RandomGenerationContext::describe
const std::string describe() const
Definition
RandomGenerationContext.cpp:30
TRADEMGEN::RandomGenerationContext::~RandomGenerationContext
~RandomGenerationContext()
Definition
RandomGenerationContext.cpp:26
TRADEMGEN::RandomGenerationContext::RandomGenerationContext
RandomGenerationContext()
Definition
RandomGenerationContext.cpp:13
TRADEMGEN::RandomGenerationContext::incrementGeneratedRequestsCounter
void incrementGeneratedRequestsCounter()
Definition
RandomGenerationContext.cpp:38
Generated on Fri Jul 25 2025 00:00:00 for TraDemGen by
1.14.0