-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEG.h
136 lines (102 loc) · 2.09 KB
/
DEG.h
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef DEG_H_
#define DEG_H_
#include <random>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
class DEG {
protected:
double lowerBound, upperBound, realFPH, estimFPH, DTC, avgPktWeight,
varPktWeight;
int nReq, distribution;
double packetWeight();
bool mode; // mode: deterministic = true | probabilistic = false regarding the weight of the packets, sending them or not is still deterministic
public:
virtual ~DEG() {
}
;
bool on;
DEG(double lower, double upper, double realFPH, double estimFPH,
double avg, double var, bool mode, int distribution,
char* name);
char* name;
void setRealFPH(double percentage);
double send();
virtual bool needToSend(int i);
double getAvgPktWeight() const {
return avgPktWeight;
}
void setAvgPktWeight(double avgPktWeight) {
this->avgPktWeight = avgPktWeight;
}
int getDistribution() const {
return distribution;
}
void setDistribution(int distribution) {
this->distribution = distribution;
}
double getDtc() const {
return DTC;
}
void setDtc(double dtc) {
DTC = dtc;
}
int getEstimFph() const {
return estimFPH;
}
void setEstimFph(int estimFph) {
estimFPH = estimFph;
}
int getLowerBound() const {
return lowerBound;
}
void setLowerBound(int lowerBound) {
this->lowerBound = lowerBound;
}
bool isMode() const {
return mode;
}
void setMode(bool mode) {
this->mode = mode;
}
int getReq() const {
return nReq;
}
void setReq(int req) {
nReq = req;
}
int getRealFph() const {
return realFPH;
}
void setRealFph(int realFph) {
realFPH = realFph;
}
int getUpperBound() const {
return upperBound;
}
void setUpperBound(int upperBound) {
this->upperBound = upperBound;
}
double getVarPktWeight() const {
return varPktWeight;
}
void setVarPktWeight(double varPktWeight) {
this->varPktWeight = varPktWeight;
}
char* getName() const {
return name;
}
void setName(char* name) {
this->name = name;
}
bool isOn() const {
return on;
}
void setOn(bool on) {
this->on = on;
}
};
#endif /* DEG_H_ */