Convert LteAmc to Object and add BER parameter
This commit is contained in:
@@ -21,11 +21,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "lte-amc.h"
|
||||
#include <ns3/lte-amc.h>
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/assert.h>
|
||||
#include <math.h>
|
||||
#include <ns3/spectrum-value.h>
|
||||
#include <ns3/double.h>
|
||||
|
||||
#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<Object> ()
|
||||
.AddConstructor<LteAmc> ()
|
||||
.AddAttribute ("Ber",
|
||||
"The requester BER (default is 0.00005).",
|
||||
DoubleValue (0.00005),
|
||||
MakeDoubleAccessor (&LteAmc::m_ber),
|
||||
MakeDoubleChecker<double> ());
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
LteAmc::GetCqiFromSpectralEfficiency (double s)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*
|
||||
* Original Author: Giuseppe Piro <g.piro@poliba.it>
|
||||
* Modified by: Nicola Baldo <nbaldo@cttc.es>
|
||||
* Modified by: Marco Miozzo <mmiozzo@cttc.es>
|
||||
*/
|
||||
|
||||
#ifndef AMCMODULE_H
|
||||
@@ -24,6 +25,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <ns3/ptr.h>
|
||||
#include <ns3/object.h>
|
||||
|
||||
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<int> CreateCqiFeedbacks (const SpectrumValue& sinr);
|
||||
/*static*/ std::vector<int> 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;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user