-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIntermittenGenerationProcess.hpp
More file actions
executable file
·92 lines (75 loc) · 2.81 KB
/
IntermittenGenerationProcess.hpp
File metadata and controls
executable file
·92 lines (75 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// IntermittenGenerationProcess.hpp
// AggregationNS3
//
// Created by Alper Sinan Akyurek on 12/6/16.
// Copyright © 2016 Alper Sinan Akyurek. All rights reserved.
//
#ifndef IntermittenGenerationProcess_hpp
#define IntermittenGenerationProcess_hpp
#include "GenerationProcess.hpp"
/**
Implements an Intermittent generation process.
**/
class IntermittentGenerationProcess : public GenerationProcess
{
private:
/** Uniform distributed random number generator **/
typedef ns3::Ptr<ns3::UniformRandomVariable> TUniformGenerator;
private:
/** Uniform random number generator **/
TUniformGenerator m_uniformGenerator;
/** First of the two rates **/
TMeanRate m_slowRate;
/** Second of the two rates **/
TMeanRate m_fastRate;
/** Minimum time for slow rate interval **/
TArrivalTime m_minimumSlowTime;
/** Maximum time for slow rate interval **/
TArrivalTime m_maximumSlowTime;
/** Minimum time for fast rate interval **/
TArrivalTime m_minimumFastTime;
/** Maximum time for fast rate interval **/
TArrivalTime m_maximumFastTime;
/** Indicates whether the current state is slow or fast **/
bool m_slowStateCurrently;
public:
/**
Constructor to set the generation rates and switching.
\param slowRate Slow Mean generation rate.
\param fastRate Fast Mean generation rate.
\param minSlowTime Minimum time for Slow rate.
\param maxSlowTime Maximum time for Slow rate.
\param minFastTime Minimum time for Fast rate.
\param maxFastTime Maximum time for Fast rate.
**/
IntermittentGenerationProcess( const TMeanRate slowRate,
const TMeanRate fastRate,
const TArrivalTime minSlowTime,
const TArrivalTime maxSlowTime,
const TArrivalTime minFastTime,
const TArrivalTime maxFastTime );
private:
/**
Schedules a generation according to the Poisson distribution.
**/
void
ScheduleGeneration( void );
/**
Creates a measurement and adds to the queue.
**/
void
CreateMeasurement( void );
/**
Returns the next arrival time according ot the exponential distribution
\return Next measurement arrival time.
**/
TArrivalTime
GetNextTime( void ) const;
/**
Schedules an intermittent switch from slow to fast.
**/
void
ScheduleSwitch( void );
};
#endif /* IntermittenGenerationProcess_hpp */