OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2014 Piotr Gawlowicz | 3 * Copyright (c) 2014 Piotr Gawlowicz |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 /** | 32 /** |
33 * \brief Distributed Fractional Frequency Reuse algorithm implementation. | 33 * \brief Distributed Fractional Frequency Reuse algorithm implementation. |
34 */ | 34 */ |
35 class LteFfrDistributedAlgorithm : public LteFfrAlgorithm | 35 class LteFfrDistributedAlgorithm : public LteFfrAlgorithm |
36 { | 36 { |
37 public: | 37 public: |
38 LteFfrDistributedAlgorithm (); | 38 LteFfrDistributedAlgorithm (); |
39 virtual ~LteFfrDistributedAlgorithm (); | 39 virtual ~LteFfrDistributedAlgorithm (); |
40 | 40 |
41 // inherited from Object | 41 /** |
| 42 * \brief Get the type ID. |
| 43 * \return the object TypeId |
| 44 */ |
42 static TypeId GetTypeId (); | 45 static TypeId GetTypeId (); |
43 | 46 |
44 // inherited from LteFfrAlgorithm | 47 // inherited from LteFfrAlgorithm |
45 virtual void SetLteFfrSapUser (LteFfrSapUser* s); | 48 virtual void SetLteFfrSapUser (LteFfrSapUser* s); |
46 virtual LteFfrSapProvider* GetLteFfrSapProvider (); | 49 virtual LteFfrSapProvider* GetLteFfrSapProvider (); |
47 | 50 |
48 virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s); | 51 virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s); |
49 virtual LteFfrRrcSapProvider* GetLteFfrRrcSapProvider (); | 52 virtual LteFfrRrcSapProvider* GetLteFfrRrcSapProvider (); |
50 | 53 |
51 // let the forwarder class access the protected and private members | 54 // let the forwarder class access the protected and private members |
(...skipping 16 matching lines...) Expand all Loading... |
68 virtual void DoReportUlCqiInfo (const struct FfMacSchedSapProvider::SchedUlCqi
InfoReqParameters& params); | 71 virtual void DoReportUlCqiInfo (const struct FfMacSchedSapProvider::SchedUlCqi
InfoReqParameters& params); |
69 virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ul
CqiMap ); | 72 virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ul
CqiMap ); |
70 virtual uint8_t DoGetTpc (uint16_t rnti); | 73 virtual uint8_t DoGetTpc (uint16_t rnti); |
71 virtual uint8_t DoGetMinContinuousUlBandwidth (); | 74 virtual uint8_t DoGetMinContinuousUlBandwidth (); |
72 | 75 |
73 // FFR SAP RRC PROVIDER IMPLEMENTATION | 76 // FFR SAP RRC PROVIDER IMPLEMENTATION |
74 virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults
); | 77 virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults
); |
75 virtual void DoRecvLoadInformation (EpcX2Sap::LoadInformationParams params); | 78 virtual void DoRecvLoadInformation (EpcX2Sap::LoadInformationParams params); |
76 | 79 |
77 private: | 80 private: |
| 81 /** |
| 82 * Set down link configuration function |
| 83 * |
| 84 * \param cellId cell ID |
| 85 * \param bandwidth the bandwidth |
| 86 */ |
78 void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth); | 87 void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth); |
| 88 /** |
| 89 * Set up link configuration function |
| 90 * |
| 91 * \param cellId cell ID |
| 92 * \param bandwidth the bandwidth |
| 93 */ |
79 void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth); | 94 void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth); |
| 95 /** |
| 96 * Initialize down link RGB maps function |
| 97 */ |
80 void InitializeDownlinkRbgMaps (); | 98 void InitializeDownlinkRbgMaps (); |
| 99 /** |
| 100 * Initialize up link RGB maps function |
| 101 */ |
81 void InitializeUplinkRbgMaps (); | 102 void InitializeUplinkRbgMaps (); |
82 | 103 |
| 104 /** |
| 105 * Initialize up link RGB maps function |
| 106 * |
| 107 * \param rnti the RNTI |
| 108 * \param cellId the cell ID |
| 109 * \param rsrp the RSRP |
| 110 * \param rsrq the RSRQ |
| 111 */ |
83 void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId, uint8_t rsrp
, uint8_t rsrq); | 112 void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId, uint8_t rsrp
, uint8_t rsrq); |
84 | 113 |
| 114 /// Calculate function |
85 void Calculate (); | 115 void Calculate (); |
| 116 /** |
| 117 * Send load information function |
| 118 * |
| 119 * \param targetCellId the cell ID |
| 120 */ |
86 void SendLoadInformation (uint16_t targetCellId); | 121 void SendLoadInformation (uint16_t targetCellId); |
87 | 122 |
88 // FFR SAP | 123 // FFR SAP |
89 LteFfrSapUser* m_ffrSapUser; | 124 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP User |
90 LteFfrSapProvider* m_ffrSapProvider; | 125 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP Provider |
91 | 126 |
92 // FFR RRF SAP | 127 // FFR RRF SAP |
93 LteFfrRrcSapUser* m_ffrRrcSapUser; | 128 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP User |
94 LteFfrRrcSapProvider* m_ffrRrcSapProvider; | 129 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP Provider |
95 | 130 |
96 std::vector <bool> m_dlRbgMap; | 131 std::vector <bool> m_dlRbgMap; ///< DL RBG map |
97 std::vector <bool> m_ulRbgMap; | 132 std::vector <bool> m_ulRbgMap; ///< UL RBG map |
98 | 133 |
99 uint8_t m_edgeRbNum; | 134 uint8_t m_edgeRbNum; ///< edge RB number |
100 std::vector <bool> m_dlEdgeRbgMap; | 135 std::vector <bool> m_dlEdgeRbgMap; ///< DL edge RBG map |
101 std::vector <bool> m_ulEdgeRbgMap; | 136 std::vector <bool> m_ulEdgeRbgMap; ///< UL edge RBG map |
102 | 137 |
| 138 /// UePosition enumeration |
103 enum UePosition | 139 enum UePosition |
104 { | 140 { |
105 AreaUnset, | 141 AreaUnset, |
106 CenterArea, | 142 CenterArea, |
107 EdgeArea | 143 EdgeArea |
108 }; | 144 }; |
109 | 145 |
110 std::map< uint16_t, uint8_t > m_ues; | 146 std::map< uint16_t, uint8_t > m_ues; ///< UEs map |
111 | 147 |
112 uint8_t m_egdeSubBandRsrqThreshold; | 148 uint8_t m_edgeSubBandRsrqThreshold; ///< edge sub band RSRQ threshold |
113 | 149 |
114 uint8_t m_centerPowerOffset; | 150 uint8_t m_centerPowerOffset; ///< center power offset |
115 uint8_t m_edgePowerOffset; | 151 uint8_t m_edgePowerOffset; ///< edge power offset |
116 | 152 |
117 uint8_t m_centerAreaTpc; | 153 uint8_t m_centerAreaTpc; ///< center area TPC |
118 uint8_t m_edgeAreaTpc; | 154 uint8_t m_edgeAreaTpc; ///< edge area TCP |
119 | 155 |
120 Time m_calculationInterval; | 156 Time m_calculationInterval; ///< calculation interval |
121 EventId m_calculationEvent; | 157 EventId m_calculationEvent; ///< calculation event |
122 | 158 |
123 // The expected measurement identity | 159 // The expected measurement identity |
124 uint8_t m_rsrqMeasId; | 160 uint8_t m_rsrqMeasId; ///< RSRQ measurement ID |
125 uint8_t m_rsrpMeasId; | 161 uint8_t m_rsrpMeasId; ///< RSRP measurement ID |
126 | 162 |
127 /** | 163 /** |
128 * \brief Measurements reported by a UE for a cell ID. | 164 * \brief Measurements reported by a UE for a cell ID. |
129 * | 165 * |
130 * The values are quantized according 3GPP TS 36.133 section 9.1.4 and 9.1.7. | 166 * The values are quantized according 3GPP TS 36.133 section 9.1.4 and 9.1.7. |
131 */ | 167 */ |
132 class UeMeasure : public SimpleRefCount<UeMeasure> | 168 class UeMeasure : public SimpleRefCount<UeMeasure> |
133 { | 169 { |
134 public: | 170 public: |
135 uint16_t m_cellId; | 171 uint16_t m_cellId; ///< Cell ID |
136 uint8_t m_rsrp; | 172 uint8_t m_rsrp; ///< RSRP |
137 uint8_t m_rsrq; | 173 uint8_t m_rsrq; ///< RSRQ |
138 }; | 174 }; |
139 | 175 |
140 // cellId | 176 /// cellId |
141 typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t; | 177 typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t; |
142 // rnti | 178 /// rnti |
143 typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t; | 179 typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t; |
144 MeasurementTable_t m_ueMeasures; | 180 MeasurementTable_t m_ueMeasures; ///< UE measures |
145 | 181 |
146 std::vector<uint16_t> m_neigborCell; | 182 std::vector<uint16_t> m_neigborCell; ///< neighbor cell |
147 | 183 |
148 uint8_t m_rsrpDifferenceThreshold; | 184 uint8_t m_rsrpDifferenceThreshold; ///< RSRP difference threshold |
149 | 185 |
150 std::map<uint16_t, uint32_t> m_cellWeightMap; | 186 std::map<uint16_t, uint32_t> m_cellWeightMap; ///< cell weight map |
151 | 187 |
152 std::map<uint16_t, std::vector <bool> > m_rntp; | 188 std::map<uint16_t, std::vector <bool> > m_rntp; ///< RNTP |
153 | 189 |
154 }; // end of class LteFfrDistributedAlgorithm | 190 }; // end of class LteFfrDistributedAlgorithm |
155 | 191 |
156 } // end of namespace ns3 | 192 } // end of namespace ns3 |
157 | 193 |
158 #endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */ | 194 #endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */ |
OLD | NEW |