OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2014 Piotr Gawlowicz |
| 4 * |
| 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 |
| 7 * published by the Free Software Foundation; |
| 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 General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com> |
| 19 * |
| 20 */ |
| 21 |
| 22 #ifndef NIST_LTE_FFR_SAP_H |
| 23 #define NIST_LTE_FFR_SAP_H |
| 24 |
| 25 #include <ns3/nist-lte-rrc-sap.h> |
| 26 #include <ns3/nist-ff-mac-sched-sap.h> |
| 27 #include <map> |
| 28 |
| 29 namespace ns3 { |
| 30 |
| 31 /** |
| 32 * \brief Service Access Point (SAP) offered by the Frequency Reuse algorithm |
| 33 * instance to the MAC Scheduler instance. |
| 34 * |
| 35 * This is the *NistLteFfrSapProvider*, i.e., the part of the SAP |
| 36 * that contains the Frequency Reuse algorithm methods called by the MAC Schedul
er |
| 37 * instance. |
| 38 */ |
| 39 class NistLteFfrSapProvider |
| 40 { |
| 41 public: |
| 42 virtual ~NistLteFfrSapProvider (); |
| 43 |
| 44 /** |
| 45 * \brief Get vector of available RBG in DL for this Cell |
| 46 * \return vector of size (m_dlBandwidth/RbgSize); false indicates |
| 47 * that RBG is free to use, true otherwise |
| 48 * |
| 49 * This function is called by MAC Scheduler in the beginning of DL |
| 50 * scheduling process. Frequency Reuse Algorithm based on its policy |
| 51 * generates vector of RBG which can be used and which can not be used |
| 52 * by Scheduler to schedule transmission. |
| 53 */ |
| 54 virtual std::vector <bool> GetAvailableDlRbg () = 0; |
| 55 |
| 56 /** |
| 57 * \brief Check if UE can be served on i-th RB in DL |
| 58 * \param i RBG ID |
| 59 * \param rnti Radio Network Temporary Identity, an integer identifying the UE |
| 60 * where the report originates from |
| 61 * \return true if UE can be served on i-th RB, false otherwise |
| 62 * |
| 63 * This function is called by MAC Scheduler during DL scheduling process |
| 64 * to check if UE is allowed to be served with i-th RBG. Frequency Reuse |
| 65 * Algorithm based on its policy decides if RBG is allowed to UE. |
| 66 * If yes, Scheduler will try to allocate this RBG for UE, if not this UE |
| 67 * will not be served with this RBG. |
| 68 */ |
| 69 virtual bool IsDlRbgAvailableForUe (int i, uint16_t rnti) = 0; |
| 70 |
| 71 /** |
| 72 * \brief Get vector of available RB in UL for this Cell |
| 73 * \return vector of size m_ulBandwidth; false indicates |
| 74 * that RB is free to use, true otherwise |
| 75 * |
| 76 * This function is called by MAC Scheduler in the beginning of UL |
| 77 * scheduling process. Frequency Reuse Algorithm based on its policy |
| 78 * generates vector of RB which can be used and which can not be used |
| 79 * by Scheduler to schedule transmission. |
| 80 */ |
| 81 virtual std::vector <bool> GetAvailableUlRbg () = 0; |
| 82 |
| 83 /** |
| 84 * \brief Check if UE can be served on i-th RB in UL |
| 85 * \param i RB ID |
| 86 * \param rnti Radio Network Temporary Identity, an integer identifying the UE |
| 87 * where the report originates from |
| 88 * \return true if UE can be served on i-th RB, false otherwise |
| 89 * |
| 90 * This function is called by MAC Scheduler during UL scheduling process |
| 91 * to check if UE is allowed to be served with i-th RB. Frequency Reuse |
| 92 * Algorithm based on its policy decides if RB is allowed to UE. |
| 93 * If yes, Scheduler will try to allocate this RB for UE, if not this UE |
| 94 * will not be served with this RB. |
| 95 */ |
| 96 virtual bool IsUlRbgAvailableForUe (int i, uint16_t rnti) = 0; |
| 97 |
| 98 /** |
| 99 * \brief ReportDlCqiInfo |
| 100 */ |
| 101 virtual void ReportDlCqiInfo (const struct NistFfMacSchedSapProvider::NistSche
dDlCqiInfoReqParameters& params) = 0; |
| 102 |
| 103 /** |
| 104 * \brief ReportUlCqiInfo |
| 105 */ |
| 106 virtual void ReportUlCqiInfo (const struct NistFfMacSchedSapProvider::NistSche
dUlCqiInfoReqParameters& params) = 0; |
| 107 |
| 108 /** |
| 109 * \brief ReportUlCqiInfo |
| 110 */ |
| 111 virtual void ReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCq
iMap ) = 0; |
| 112 |
| 113 /** |
| 114 * \brief GetTpc |
| 115 */ |
| 116 virtual uint8_t GetTpc (uint16_t rnti) = 0; |
| 117 |
| 118 /** |
| 119 * \brief GetMinContinuousUlBandwidth |
| 120 */ |
| 121 virtual uint8_t GetMinContinuousUlBandwidth () = 0; |
| 122 }; // end of class NistLteFfrSapProvider |
| 123 |
| 124 |
| 125 /** |
| 126 * \brief Service Access Point (SAP) offered by the eNodeB RRC instance to the |
| 127 * Frequency Reuse algorithm instance. |
| 128 * |
| 129 * This is the *NistLteFfrSapUser*, i.e., the part of the SAP that |
| 130 * contains the MAC Scheduler methods called by the Frequency Reuse algorithm in
stance. |
| 131 */ |
| 132 class NistLteFfrSapUser |
| 133 { |
| 134 public: |
| 135 virtual ~NistLteFfrSapUser (); |
| 136 |
| 137 }; // end of class NistLteFfrSapUser |
| 138 |
| 139 |
| 140 /** |
| 141 * \brief Template for the implementation of the NistLteFfrSapProvider |
| 142 * as a member of an owner class of type C to which all methods are |
| 143 * forwarded. |
| 144 */ |
| 145 template <class C> |
| 146 class MemberNistLteFfrSapProvider : public NistLteFfrSapProvider |
| 147 { |
| 148 public: |
| 149 MemberNistLteFfrSapProvider (C* owner); |
| 150 |
| 151 // inherited from NistLteFfrSapProvider |
| 152 virtual std::vector <bool> GetAvailableDlRbg (); |
| 153 virtual bool IsDlRbgAvailableForUe (int i, uint16_t rnti); |
| 154 virtual std::vector <bool> GetAvailableUlRbg (); |
| 155 virtual bool IsUlRbgAvailableForUe (int i, uint16_t rnti); |
| 156 virtual void ReportDlCqiInfo (const struct NistFfMacSchedSapProvider::NistSche
dDlCqiInfoReqParameters& params); |
| 157 virtual void ReportUlCqiInfo (const struct NistFfMacSchedSapProvider::NistSche
dUlCqiInfoReqParameters& params); |
| 158 virtual void ReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCq
iMap ); |
| 159 virtual uint8_t GetTpc (uint16_t rnti); |
| 160 virtual uint8_t GetMinContinuousUlBandwidth (); |
| 161 private: |
| 162 MemberNistLteFfrSapProvider (); |
| 163 C* m_owner; |
| 164 |
| 165 }; // end of class MemberNistLteFfrSapProvider |
| 166 |
| 167 |
| 168 template <class C> |
| 169 MemberNistLteFfrSapProvider<C>::MemberNistLteFfrSapProvider (C* owner) |
| 170 : m_owner (owner) |
| 171 { |
| 172 } |
| 173 |
| 174 |
| 175 template <class C> |
| 176 std::vector <bool> |
| 177 MemberNistLteFfrSapProvider<C>::GetAvailableDlRbg () |
| 178 { |
| 179 return m_owner->DoGetAvailableDlRbg (); |
| 180 } |
| 181 |
| 182 template <class C> |
| 183 bool |
| 184 MemberNistLteFfrSapProvider<C>::IsDlRbgAvailableForUe (int i, uint16_t rnti) |
| 185 { |
| 186 return m_owner->DoIsDlRbgAvailableForUe (i,rnti); |
| 187 } |
| 188 |
| 189 template <class C> |
| 190 std::vector <bool> |
| 191 MemberNistLteFfrSapProvider<C>::GetAvailableUlRbg () |
| 192 { |
| 193 return m_owner->DoGetAvailableUlRbg (); |
| 194 } |
| 195 |
| 196 template <class C> |
| 197 bool |
| 198 MemberNistLteFfrSapProvider<C>::IsUlRbgAvailableForUe (int i, uint16_t rnti) |
| 199 { |
| 200 return m_owner->DoIsUlRbgAvailableForUe (i,rnti); |
| 201 } |
| 202 |
| 203 template <class C> |
| 204 void |
| 205 MemberNistLteFfrSapProvider<C>::ReportDlCqiInfo (const struct NistFfMacSchedSapP
rovider::NistSchedDlCqiInfoReqParameters& params) |
| 206 { |
| 207 m_owner->DoReportDlCqiInfo (params); |
| 208 } |
| 209 |
| 210 template <class C> |
| 211 void |
| 212 MemberNistLteFfrSapProvider<C>::ReportUlCqiInfo (const struct NistFfMacSchedSapP
rovider::NistSchedUlCqiInfoReqParameters& params) |
| 213 { |
| 214 m_owner->DoReportUlCqiInfo (params); |
| 215 } |
| 216 |
| 217 template <class C> |
| 218 void |
| 219 MemberNistLteFfrSapProvider<C>::ReportUlCqiInfo ( std::map <uint16_t, std::vecto
r <double> > ulCqiMap ) |
| 220 { |
| 221 m_owner->DoReportUlCqiInfo (ulCqiMap); |
| 222 } |
| 223 |
| 224 template <class C> |
| 225 uint8_t |
| 226 MemberNistLteFfrSapProvider<C>::GetTpc ( uint16_t rnti ) |
| 227 { |
| 228 return m_owner->DoGetTpc (rnti); |
| 229 } |
| 230 |
| 231 template <class C> |
| 232 uint8_t |
| 233 MemberNistLteFfrSapProvider<C>::GetMinContinuousUlBandwidth () |
| 234 { |
| 235 return m_owner->DoGetMinContinuousUlBandwidth (); |
| 236 } |
| 237 |
| 238 /** |
| 239 * \brief Template for the implementation of the NistLteFfrSapUser |
| 240 * as a member of an owner class of type C to which all methods are |
| 241 * forwarded. |
| 242 */ |
| 243 template <class C> |
| 244 class MemberNistLteFfrSapUser : public NistLteFfrSapUser |
| 245 { |
| 246 public: |
| 247 MemberNistLteFfrSapUser (C* owner); |
| 248 |
| 249 // inherited from NistLteFfrSapUser |
| 250 private: |
| 251 MemberNistLteFfrSapUser (); |
| 252 C* m_owner; |
| 253 |
| 254 }; // end of class NistLteFfrSapUser |
| 255 |
| 256 template <class C> |
| 257 MemberNistLteFfrSapUser<C>::MemberNistLteFfrSapUser (C* owner) |
| 258 : m_owner (owner) |
| 259 { |
| 260 } |
| 261 |
| 262 } // end of namespace ns3 |
| 263 |
| 264 |
| 265 #endif /* NIST_LTE_FFR_SAP_H */ |
OLD | NEW |