-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGainFunction.hpp
executable file
·76 lines (62 loc) · 2.15 KB
/
GainFunction.hpp
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
//
// GainFunction.hpp
// AggregationNS3
//
// Created by Alper Sinan Akyurek on 8/9/16.
// Copyright © 2016 Alper Sinan Akyurek. All rights reserved.
//
#ifndef GainFunction_hpp
#define GainFunction_hpp
#include "Measurement.hpp"
#include "GenerationProcess.hpp"
#include "DeadlineProcess.hpp"
#include <ns3/core-module.h>
/**
Base gain function class. Any inheriting class must implement the gain value
and gain derivative value functions for optimization.
**/
class GainFunction : public ns3::SimpleRefCount< GainFunction >
{
public:
/** Generation Process Smart Pointer type **/
typedef ns3::Ptr< GenerationProcess > TGenerationPtr;
/** Deadline process Smart Pointer type **/
typedef ns3::Ptr< DeadlineProcess > TDeadlinePtr;
/** Gain value type **/
typedef double TGain;
/** Transmission Tyime type **/
typedef ns3::Time TTransmissionTime;
protected:
/** Generation Process pointer, initially null **/
TGenerationPtr m_generationProcess = nullptr;
/** Deadline Process pointer, initially null **/
TDeadlinePtr m_deadlineProcess = nullptr;
public:
/**
Virtual function to set the generation and deadline processes.
\param gen Generation process pointer.
\param deadline Deadline process pointer.
**/
virtual void
SetProcesses( const TGenerationPtr & gen,
const TDeadlinePtr & deadline );
/**
Virtual empty destructor.
**/
virtual ~GainFunction( void ){}
/**
Virtual function to obtain the gain derivative value.
\param x Aggreagation time to be calculated for.
\return Gain derivative value.
**/
virtual TGain
GetGainDerivative( const TTransmissionTime & x ) const = 0;
/**
Virtual function to obtain the gain value.
\param x Aggreagation time to be calculated for.
\return Gain value.
**/
virtual TGain
GetGain( const TTransmissionTime & x ) const = 0;
};
#endif /* MeasurementGainFunction_hpp */