diff --git a/src/lte/model/lte-amc.cc b/src/lte/model/lte-amc.cc index 40651aa4b..97345cf37 100644 --- a/src/lte/model/lte-amc.cc +++ b/src/lte/model/lte-amc.cc @@ -21,11 +21,12 @@ */ -#include "lte-amc.h" +#include #include #include #include #include +#include #ifdef __FreeBSD__ #define log2(x) (log(x)/M_LN2) @@ -203,6 +204,32 @@ int TransportBlockSizeTable [110][27] = { }; +LteAmc::LteAmc () + :m_ber (0.00005) +{ + +} + + +LteAmc::~LteAmc () +{ + +} + +TypeId +LteAmc::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::LteAmc") + .SetParent () + .AddConstructor () + .AddAttribute ("Ber", + "The requester BER (default is 0.00005).", + DoubleValue (0.00005), + MakeDoubleAccessor (&LteAmc::m_ber), + MakeDoubleChecker ()); + return tid; +} + int LteAmc::GetCqiFromSpectralEfficiency (double s) diff --git a/src/lte/model/lte-amc.h b/src/lte/model/lte-amc.h index 118d7409d..c1cce8fac 100644 --- a/src/lte/model/lte-amc.h +++ b/src/lte/model/lte-amc.h @@ -17,6 +17,7 @@ * * Original Author: Giuseppe Piro * Modified by: Nicola Baldo + * Modified by: Marco Miozzo */ #ifndef AMCMODULE_H @@ -24,6 +25,7 @@ #include #include +#include namespace ns3 { @@ -38,17 +40,22 @@ class SpectrumValue; * \note All the methods of this class are static, so you'll never * need to create and manage instances of this class. */ -class LteAmc +class LteAmc : public Object { public: + static TypeId GetTypeId (void); + + LteAmc (); + virtual ~LteAmc(); + /** * \brief Get the Modulation anc Coding Scheme for * a CQI value * \param cqi the cqi value * \return the MCS value */ - static int GetMcsFromCqi (int cqi); + /*static*/ int GetMcsFromCqi (int cqi); /** * \brief Get the Transport Block Size for a selected MCS and number of PRB (table 7.1.7.2.1-1 of 36.213) @@ -56,7 +63,7 @@ public: * \param nprb the no. of PRB * \return the Transport Block Size in bits */ - static int GetTbSizeFromMcs (int mcs, int nprb); + /*static*/ int GetTbSizeFromMcs (int mcs, int nprb); /** * \brief Get the spectral efficiency value associated @@ -64,13 +71,13 @@ public: * \param cqi the cqi value * \return the spectral efficiency in (bit/s)/Hz */ - static double GetSpectralEfficiencyFromCqi (int cqi); + /*static*/ double GetSpectralEfficiencyFromCqi (int cqi); /** * \brief Create a message with CQI feedback * */ - static std::vector CreateCqiFeedbacks (const SpectrumValue& sinr); + /*static*/ std::vector CreateCqiFeedbacks (const SpectrumValue& sinr); /** * \brief Get a proper CQI for the spectrale efficiency value. @@ -79,7 +86,13 @@ public: * \param s the spectral efficiency * \return the CQI value */ - static int GetCqiFromSpectralEfficiency (double s); + /*static*/ int GetCqiFromSpectralEfficiency (double s); + +private: + + double m_ber; + + };