LteDlFeedbackGenerator.h Source File

Simu5G: LteDlFeedbackGenerator.h Source File
Simu5G
LteDlFeedbackGenerator.h
1//
2// Simu5G
3//
4// Copyright (C) 2012-2021 Giovanni Nardini, Giovanni Stea, Antonio Virdis et al. (University of Pisa)
5// Copyright (C) 2022-2026 Giovanni Nardini, Giovanni Stea et al. (University of Pisa)
6//
7// This file is part of a software released under the license included in file
8// "license.pdf". Please read LICENSE and README files before using it.
9// The above files and the present reference are part of the software itself,
10// and cannot be removed from it.
11//
12
13#ifndef _LTE_LTEDLFBGENERATOR_H_
14#define _LTE_LTEDLFBGENERATOR_H_
15
16#include <inet/common/ModuleRefByPar.h>
17
18#include "simu5g/common/cellInfo/CellInfo.h"
19#include "simu5g/common/LteCommon.h"
20#include "simu5g/stack/phy/feedback/LteFeedback.h"
21#include "simu5g/common/timer/TTimer.h"
22#include "simu5g/common/timer/TTimerMsg_m.h"
23#include "simu5g/stack/phy/feedback/LteFeedbackComputation.h"
24#include "simu5g/stack/phy/PhyUe.h"
25
26namespace simu5g {
27
28using namespace omnetpp;
29
30class PhyUe;
31
36class LteDlFeedbackGenerator : public cSimpleModule
37{
38 enum FbTimerType
39 {
40 PERIODIC_SENSING = 0, PERIODIC_TX, APERIODIC_TX
41 };
42
43 private:
44
45 FeedbackType fbType_;
46 RbAllocationType rbAllocationType_;
53 simtime_t fbPeriod_;
54 simtime_t fbDelay_;
55
56 bool usePeriodic_;
57 TxMode currentTxMode_;
58
59 opp_component_ptr<CellInfo> cellInfo_;
60 inet::ModuleRefByPar<Binder> binder_;
61 inet::ModuleRefByPar<PhyUe> phy_;
62
63 // cellInfo parameters
64 int numPreferredBands_;
65 int numBands_;
66
67 // Timers
68 TTimer *tPeriodicSensing_ = nullptr;
69 TTimer *tPeriodicTx_ = nullptr;
70 TTimer *tAperiodicTx_ = nullptr;
71
72 // Feedback Maps
73 LteFeedbackDoubleVector periodicFeedback;
74 LteFeedbackDoubleVector aperiodicFeedback;
75
76 //MacNodeID
77 MacNodeId masterId_;
78 MacNodeId nodeId_;
79
80 bool feedbackComputationPisa_;
81
82 private:
83
84 // initialize cell information
85 virtual void initCellInfo();
86
90 virtual void sendFeedback(LteFeedbackDoubleVector fb, FbPeriodicity per);
91
92 virtual LteFeedbackComputation *getFeedbackComputationFromName(std::string name, ParameterMap& params);
93
94 protected:
95
99 void initialize(int stage) override;
100
101 int numInitStages() const override { return inet::NUM_INIT_STAGES; }
102
107 void handleMessage(cMessage *msg) override;
108
112 virtual void sensing(FbPeriodicity per);
113
114 public:
115
120
126 virtual void aperiodicRequest();
127
133 virtual void setTxMode(TxMode newTxMode);
134
135 /*
136 * Perform handover-related operations
137 * Update cell id and the reference to the cellInfo
138 */
139 virtual void handleHandover(MacCellId newEnbId);
140};
141
142} //namespace
143
144#endif
Lte Downlink Feedback Generator.
Definition LteDlFeedbackGenerator.h:37
virtual void setTxMode(TxMode newTxMode)
void handleMessage(cMessage *msg) override
void initialize(int stage) override
virtual void sensing(FbPeriodicity per)
Generic timer interface.
Definition TTimer.h:26
Definition AlertReceiver.h:24
std::map< std::string, cMsgPar > ParameterMap
Definition LteCommon.h:518
MacNodeId MacCellId
Cell node ID. It is numerically equal to eNodeB MAC node ID.
Definition LteTypes.h:66