RINASim
October 2016
Documentation of framework for OMNeT++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
MM_Simple_Drop.cc
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
#include <
MM_Simple_Drop.h
>
19
20
namespace
MM_Simple_Drop
{
21
22
Define_Module
(
MM_Simple_Drop
);
23
24
MM_Simple_Drop::~MM_Simple_Drop(){
25
queueCount.clear();
26
}
27
28
void
MM_Simple_Drop::pduInsertered(
RMTQueue
* q,
RMTPort
* p) {
29
queueCount[q]++;
30
}
31
32
void
MM_Simple_Drop::pduDropped(
RMTQueue
* q,
const
cPacket * s,
RMTPort
* p) {
33
queueCount[q]--;
34
}
35
36
void
MM_Simple_Drop::pduReleased(
RMTQueue
* q,
RMTPort
* p) {
37
queueCount[q]--;
38
}
39
40
void
MM_Simple_Drop::queueCreated(
RMTQueue
* q,
RMTPort
* p) {
41
queueCount[q] = 0;
42
}
43
44
double
MM_Simple_Drop::getDropProbability(
RMTQueue
* q,
RMTPort
* p) {
45
return
(q->
getMaxLength
() < queueCount[q])? 1.0 : 0.0;
46
}
47
48
}
MM_Simple_Drop.h
RMTQueue::getMaxLength
int getMaxLength() const
Definition:
RMTQueue.cc:215
MM_Simple_Drop
Definition:
MM_Simple_Drop.cc:20
MM_Simple_Drop::Define_Module
Define_Module(MM_Simple_Drop)
RMTPort
Definition:
RMTPort.h:36
RMTQueue
Definition:
RMTQueue.h:34
policies
DIF
RMT
Monitor
ModularMonitor
MM_Simple_Drop
MM_Simple_Drop.cc
Generated on Tue Oct 25 2016 21:08:54 for RINASim by
1.8.10