src/lte/model/lte-amc.h
author Peter D. Barnes, Jr. <barnes26@llnl.gov>
Fri, 26 Sep 2014 15:51:00 -0700
changeset 10968 2d29fee2b7b8
parent 10425 1867d8c25aa7
child 10983 087597a150da
permissions -rw-r--r--
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents: 7238
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     2
/*
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     3
 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     4
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     8
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    12
 * GNU General Public License for more details.
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    13
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    17
 *
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    18
 * Original Author: Giuseppe Piro  <g.piro@poliba.it>
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    19
 * Modified by:     Nicola Baldo   <nbaldo@cttc.es>
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    20
 * Modified by:     Marco Miozzo   <mmiozzo@cttc.es>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    21
 */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    22
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    23
#ifndef AMCMODULE_H
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    24
#define AMCMODULE_H
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    25
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    26
#include <vector>
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    27
#include <ns3/ptr.h>
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    28
#include <ns3/object.h>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    29
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    30
namespace ns3 {
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    31
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    32
class SpectrumValue;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    33
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    34
/**
7238
85a7e87bb4cc Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 6852
diff changeset
    35
 * \ingroup lte
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    36
 * \brief The LteAmc class implements the Adaptive Modulation And Coding Scheme
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    37
 * as proposed in 3GPP TSG-RAN WG1 - R1-081483
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    38
 * http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    39
 *
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    40
 * \note All the methods of this class are static, so you'll never
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    41
 * need to create and manage instances of this class.
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    42
 */
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    43
class LteAmc : public Object
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    44
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    45
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    46
public:
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    47
  static TypeId GetTypeId (void);
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    48
  
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    49
  LteAmc ();
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    50
  virtual ~LteAmc();
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    51
  
8644
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    52
  enum AmcModel
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    53
    {
8648
b73a8905c1eb Remove LteAmc::Ber parameter from LteAmc::MiErrorModel for avoiding misunderstanding
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8646
diff changeset
    54
      PiroEW2010,
8646
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8644
diff changeset
    55
      // model based on Piro, G.; Grieco, L.A.; Boggia, G.; Camarda, P.;
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8644
diff changeset
    56
      //A two-level scheduling algorithm for QoS support in the downlink of 
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8644
diff changeset
    57
      //LTE cellular networks European Wireless Conference (EW), 2010
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8644
diff changeset
    58
      MiErrorModel // model based on 10% of BER according to LteMiErrorModel
8644
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    59
    };
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    60
  
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    61
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    62
   * \brief Get the Modulation anc Coding Scheme for
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    63
   * a CQI value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    64
   * \param cqi the cqi value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    65
   * \return the MCS  value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    66
   */
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    67
  /*static*/ int GetMcsFromCqi (int cqi);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    68
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    69
  /**
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    70
  * \brief Get the Transport Block Size for a selected MCS and number of PRB (table 7.1.7.2.1-1 of 36.213)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    71
  * \param mcs the mcs index
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    72
  * \param nprb the no. of PRB
8120
126ab426750b added a few comments to lte-amc
Nicola Baldo <nbaldo@cttc.es>
parents: 8098
diff changeset
    73
  * \return the Transport Block Size in bits
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    74
  */
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    75
  /*static*/ int GetTbSizeFromMcs (int mcs, int nprb);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    76
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    77
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    78
   * \brief Get the spectral efficiency value associated
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    79
   * to the received CQI
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    80
   * \param cqi the cqi value
8120
126ab426750b added a few comments to lte-amc
Nicola Baldo <nbaldo@cttc.es>
parents: 8098
diff changeset
    81
   * \return the spectral efficiency in (bit/s)/Hz
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    82
   */
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
    83
  /*static*/ double GetSpectralEfficiencyFromCqi (int cqi);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    84
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    85
  /**
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    86
   * \brief Create a message with CQI feedback
8644
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    87
   * \param sinr the SpectrumValue vector of SINR for evaluating the CQI
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
    88
   * \param rbgSize size of RB group (in RBs) for evaluating subband/wideband CQI
10425
1867d8c25aa7 doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents: 8648
diff changeset
    89
   * \return a vector of CQI feedbacks
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    90
   */
10425
1867d8c25aa7 doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents: 8648
diff changeset
    91
  /*static*/ std::vector<int> CreateCqiFeedbacks (const SpectrumValue& sinr,
1867d8c25aa7 doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents: 8648
diff changeset
    92
                                                  uint8_t rbgSize = 0);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    93
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    94
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    95
   * \brief Get a proper CQI for the spectrale efficiency value.
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    96
   * In order to assure a fewer block error rate, the AMC chooses the lower CQI value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    97
   * for a given spectral efficiency
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    98
   * \param s the spectral efficiency
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    99
   * \return the CQI value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   100
   */
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   101
  /*static*/ int GetCqiFromSpectralEfficiency (double s);
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   102
  
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   103
private:
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   104
  
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   105
  double m_ber;
8644
83faaf37b22c Add missing files of Hybrid and Simple BuildingsPropagationLossModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8515
diff changeset
   106
  AmcModel m_amcModel;
8515
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   107
245c032fb764 Convert LteAmc to Object and add BER parameter
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8253
diff changeset
   108
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   109
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   110
};
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   111
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   112
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   113
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   114
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   115
#endif /* AMCMODULE_H */