CellInfo.h Source File

Simu5G: CellInfo.h Source File
Simu5G
CellInfo.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 _CELLINFO_H_
14#define _CELLINFO_H_
15
16#include <inet/common/ModuleRefByPar.h>
17#include <inet/networklayer/contract/ipv4/Ipv4Address.h>
18
19#include "simu5g/common/binder/Binder.h"
20#include "simu5g/common/LteCommon.h"
21
22namespace simu5g {
23
24using namespace omnetpp;
25
29class CellInfo : public cSimpleModule
30{
31 private:
33 inet::ModuleRefByPar<Binder> binder_;
34
36 MacCellId cellId_;
37
38 // MACRO_ENB or MICRO_ENB
39 EnbType eNbType_;
40
42 double pgnMinX_;
44 double pgnMinY_;
46 double pgnMaxX_;
48 double pgnMaxY_;
49
51 double nodeX_ = 0;
53 double nodeY_ = 0;
54
56 int totalBands_;
58 int numPreferredBands_;
59
60 // TODO these should be parameters per carrier, move to CarrierComponent
61
63 int rbyDl_;
65 int rbyUl_;
67 int rbxDl_;
69 int rbxUl_;
71 int rbPilotDl_;
73 int rbPilotUl_;
75 int signalDl_;
77 int signalUl_;
79 double mcsScaleUl_ = 0;
81 double mcsScaleDl_ = 0;
82
83 /*
84 * Carrier Aggregation support
85 */
86 // total number of logical bands *in this cell* (sum of bands used by carriers enabled in this cell)
87 unsigned int numBands_ = 0;
88 CarrierInfoMap carrierMap_;
89
90 // store the carrier frequencies used by this cell
91 std::vector<GHz> carriersVector_;
92
93 // max numerology index used in this cell
94 NumerologyIndex maxNumerologyIndex_ = 0;
95 /************************************/
96
97 // Position of each UE
98 std::map<MacNodeId, inet::Coord> uePosition;
99
100 protected:
101
102 void initialize(int stage) override;
103 int numInitStages() const override { return inet::NUM_INIT_STAGES; }
104
105 virtual void calculateMcsScale();
106 virtual void updateMCSScale(double& mcs, double signalRe, double signalCarriers = 0, Direction dir = DL);
107
111 virtual SlotFormat computeSlotFormat(bool useTdd, unsigned int tddNumSymbolsDl, unsigned int tddNumSymbolsUl);
112
113 public:
114
115
116 MacCellId getMacCellId()
117 {
118 return cellId_;
119 }
120
121 int getRbyDl()
122 {
123 return rbyDl_;
124 }
125
126 int getRbyUl()
127 {
128 return rbyUl_;
129 }
130
131 int getRbxDl()
132 {
133 return rbxDl_;
134 }
135
136 int getRbxUl()
137 {
138 return rbxUl_;
139 }
140
141 int getRbPilotDl()
142 {
143 return rbPilotDl_;
144 }
145
146 int getRbPilotUl()
147 {
148 return rbPilotUl_;
149 }
150
151 int getSignalDl()
152 {
153 return signalDl_;
154 }
155
156 int getSignalUl()
157 {
158 return signalUl_;
159 }
160
161 int getTotalBands()
162 {
163 return totalBands_;
164 }
165
166 // returns the number of bands in the cell
167 unsigned int getNumBands();
168
169 // returns the carrier frequency of the primary cell
170 GHz getPrimaryCarrierFrequency();
171
172 double getMcsScaleUl()
173 {
174 return mcsScaleUl_;
175 }
176
177 double getMcsScaleDl()
178 {
179 return mcsScaleDl_;
180 }
181
182 int getNumPreferredBands()
183 {
184 return numPreferredBands_;
185 }
186
187
188 void setEnbType(EnbType t)
189 {
190 eNbType_ = t;
191 }
192
193 EnbType getEnbType()
194 {
195 return eNbType_;
196 }
197
198 inet::Coord getUePosition(MacNodeId id)
199 {
200 if (uePosition.find(id) != uePosition.end())
201 return uePosition[id];
202 else
203 return inet::Coord::ZERO;
204 }
205
206 const std::map<MacNodeId, inet::Coord>& getUePositionList()
207 {
208 return uePosition;
209 }
210
211 void setUePosition(MacNodeId id, inet::Coord c)
212 {
213 uePosition[id] = c;
214 }
215
216 //---------------------------------------------------------------
217
218 /*
219 * Carrier Aggregation support
220 */
221 // register a new carrier for this node with the given number of bands
222 void registerCarrier(GHz carrierFrequency, unsigned int carrierNumBands, unsigned int numerologyIndex,
223 bool useTdd = false, unsigned int tddNumSymbolsDl = 0, unsigned int tddNumSymbolsUl = 0);
224
225 const std::vector<GHz>& getCarriers();
226
227 const CarrierInfoMap& getCarrierInfoMap();
228
229 NumerologyIndex getMaxNumerologyIndex() { return maxNumerologyIndex_; }
230
231 // convert a carrier-local band index to a cellwide band index
232 unsigned int getCellwiseBand(GHz carrierFrequency, Band index);
233
234 // returns the number of bands for the primary cell
235 unsigned int getPrimaryCarrierNumBands();
236
237 // returns the number of bands for the given carrier
238 unsigned int getCarrierNumBands(GHz carrierFrequency);
239
240 // returns the band limit vector for the given carrier
241 // if arg is not specified, returns the info for the primary carrier
242 const BandLimitVector& getCarrierBandLimit(GHz carrierFrequency);
243
244 unsigned int getCarrierStartingBand(GHz carrierFrequency);
245 unsigned int getCarrierLastBand(GHz carrierFrequency);
246 /*******************************************************************************/
247
248 void detachUser(MacNodeId nodeId);
249 void attachUser(MacNodeId nodeId);
250
251};
252
253} //namespace
254
255#endif
There is one CellInfo module for each eNB (thus one for each cell). Keeps cross-layer information abo...
Definition CellInfo.h:30
virtual SlotFormat computeSlotFormat(bool useTdd, unsigned int tddNumSymbolsDl, unsigned int tddNumSymbolsUl)
Definition AlertReceiver.h:24
unsigned short Band
Logical band.
Definition LteTypes.h:140
MacNodeId MacCellId
Cell node ID. It is numerically equal to eNodeB MAC node ID.
Definition LteTypes.h:66
unsigned short NumerologyIndex
Numerology Index.
Definition LteCommon.h:205