RINASim  October 2016
Documentation of framework for OMNeT++
dlCUInfo.h
Go to the documentation of this file.
1 //
2 // Copyright © 2014 - 2015 PRISTINE Consortium (http://ict-pristine.eu)
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see http://www.gnu.org/licenses/.
16 //
17 
18 #ifndef dlCUInfo_H_
19 #define dlCUInfo_H_
20 
21 #include <omnetpp.h>
22 
23 #include <string>
24 #include <map>
25 #include <vector>
26 #include <list>
27 
28 namespace DQMonitor {
29 
30 using namespace std;
31 
32 
33 struct ILimVals {
34  double index;
35  long long rate; // bps
36  long long spaceRate; //bps
37  double spaceVar; //[0..1]
38  double dropProb; //[0..1]
39 
40  ILimVals(double i, long long r, long long sr, double sv, double p);
41 };
42 
43 struct IDropProb {
44  int index;
45  double prob;
46 
47  IDropProb(int i, double p);
48 };
49 
50 struct PP {
51  int priority;
52  double probability;
53 
54  PP(int prio, double prob);
55 };
56 
57 typedef vector<PP> PPlist;
58 typedef PPlist::iterator PPlistIt;
59 
60 struct IDegrad {
61  double index;
62  PPlist PPs;
63 
64  IDegrad(double i);
65  int getRandomPriority (int def);
66 };
67 
68 template <typename T> bool compareIndex(const T& a, const T& b);
69 
70 
71 typedef vector<ILimVals> ILimValsList;
72 typedef vector<IDropProb> IDropProbList;
73 typedef vector<IDegrad> IDegradList;
74 
75 typedef ILimValsList::iterator ILimValsIt;
76 typedef IDropProbList::iterator IDropProbIt;
77 typedef IDegradList::iterator IDegradIt;
78 
79 struct Times {
80  double serveT;
81  double spaceT;
82 
83  Times();
84  Times(double se, double sp);
85 };
86 
87 class L {
88 private:
89  bool limit, space;
90 
91  ILimValsList vl;
92  IDropProbList dl;
93 
94 public:
95  L();
96  L(bool lim, bool spa, ILimValsList v, IDropProbList d);
97 
98  bool needRate();
99  bool spaces();
100  bool limits();
101  Times getTimes(double wt, int size);
102  double getDropProb(double wt, int ws);
103 };
104 
105 class C {
106 private:
108  IDropProbList dl;
109 
110 public:
111  C();
112  C(double dd, IDropProbList d);
113 
114  double getDropProb(int s);
115 };
116 
117 class U {
118 private:
120 
121  bool degrad;
122 
123  long long rate;
124  IDegradList dl;
125 
126 public:
127  U();
128  U(int dp, bool deg, long long r, IDegradList d);
129 
130  bool isDegraded();
131  double getTime(int size);
132  int getPriority(double wt);
133 };
134 
135 class dlCUInfo {
136 public:
137  string queueName;
138  L * limit;
141 
142  dlCUInfo();
143  dlCUInfo(string qn, L * l, C * c, U * u);
144 };
145 
146 }
147 #endif /* SIMPLEMONITOR_H_ */
PPlist::iterator PPlistIt
Definition: dlCUInfo.h:58
IDropProbList dl
Definition: dlCUInfo.h:92
bool space
Definition: dlCUInfo.h:89
double defaultDropProb
Definition: dlCUInfo.h:107
ILimValsList vl
Definition: dlCUInfo.h:91
long long rate
Definition: dlCUInfo.h:35
vector< IDropProb > IDropProbList
Definition: dlCUInfo.h:72
bool degrad
Definition: dlCUInfo.h:121
long long rate
Definition: dlCUInfo.h:123
long long spaceRate
Definition: dlCUInfo.h:36
vector< PP > PPlist
Definition: dlCUInfo.h:57
bool compareIndex(const T &a, const T &b)
Definition: dlCUInfo.cc:49
IDegradList dl
Definition: dlCUInfo.h:124
IDropProbList dl
Definition: dlCUInfo.h:108
double serveT
Definition: dlCUInfo.h:80
int defaultPriority
Definition: dlCUInfo.h:119
IDegradList::iterator IDegradIt
Definition: dlCUInfo.h:77
int priority
Definition: dlCUInfo.h:51
IDropProbList::iterator IDropProbIt
Definition: dlCUInfo.h:76
double probability
Definition: dlCUInfo.h:52
ILimValsList::iterator ILimValsIt
Definition: dlCUInfo.h:75
double spaceT
Definition: dlCUInfo.h:81
vector< ILimVals > ILimValsList
Definition: dlCUInfo.h:71
vector< IDegrad > IDegradList
Definition: dlCUInfo.h:73