1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Marco Miozzo <marco.miozzo@cttc.es>,
19  *         Nicola Baldo <nbaldo@cttc.es>
20  *         Dizhi Zhou <dizhi.zhou@gmail.com>
21  */
22 
23 #ifndef LENA_TEST_FDBET_FF_MAC_SCHEDULER_H
24 #define LENA_TEST_FDBET_FF_MAC_SCHEDULER_H
25 
26 #include "ns3/simulator.h"
27 #include "ns3/test.h"
28 
29 
30 using namespace ns3;
31 
32 
33 /**
34  * \ingroup lte-test
35  * \ingroup tests
36  *
37  * \brief This system test program creates different test cases with a single eNB and
38  * several UEs, all having the same Radio Bearer specification. In each test
39  * case, the UEs see the same SINR from the eNB; different test cases are
40  * implemented obtained by using different SINR values and different numbers of
41  * UEs. The test consists on checking that the obtained throughput performance
42  * is equal among users is consistent with the definition of blind equal throughput
43  * scheduling
44  */
45 class LenaFdBetFfMacSchedulerTestCase1 : public TestCase
46 {
47 public:
48   /**
49    * Constructor
50    *
51    * \param nUser number of UE nodes
52    * \param dist distance between nodes
53    * \param thrRefDl DL throughput reference
54    * \param thrRefUl UL throughput reference
55    * \param errorModelEnabled error model enabled?
56    */
57   LenaFdBetFfMacSchedulerTestCase1 (uint16_t nUser, double dist, double thrRefDl, double thrRefUl,bool errorModelEnabled);
58   virtual ~LenaFdBetFfMacSchedulerTestCase1 ();
59 
60 private:
61   /**
62    *  Builds the test name string based on provided parameter values
63    *
64    * \param nUser number of UE nodes
65    * \param dist distance between nodes
66    * \returns name string
67    */
68   static std::string BuildNameString (uint16_t nUser, double dist);
69   virtual void DoRun (void);
70   uint16_t m_nUser; ///< number of UE nodes
71   double m_dist; ///< distance between the nodes
72   double m_thrRefDl; ///< DL throughput reference
73   double m_thrRefUl; ///< UL throughput reference
74   bool m_errorModelEnabled; ///< error model enabled?
75 };
76 
77 
78 /**
79  * \ingroup lte-test
80  * \ingroup tests
81  *
82  * \brief Test case is simillar to the one defined in
83  * LenaFdBetFfMacSchedulerTestCase1, with the difference that UEs are
84  * placed in such a way to experience different SINRs from eNodeB.
85  */
86 class LenaFdBetFfMacSchedulerTestCase2 : public TestCase
87 {
88 public:
89   /**
90    * Constructor
91    *
92    * \param dist distance between nodes
93    * \param achievableRateDl DL achievable rate
94    * \param estThrFdBetUl UL estimated throughput bet UL
95    * \param errorModelEnabled error model enabled?
96    */
97   LenaFdBetFfMacSchedulerTestCase2 (std::vector<double> dist, std::vector<uint32_t> achievableRateDl, std::vector<uint32_t> estThrFdBetUl, bool errorModelEnabled);
98   virtual ~LenaFdBetFfMacSchedulerTestCase2 ();
99 
100 private:
101   /**
102    *  Builds the test name string based on provided parameter values
103    *
104    * \param nUser number of UE nodes
105    * \param dist distance between nodes
106    * \returns name string
107    */
108   static std::string BuildNameString (uint16_t nUser, std::vector<double> dist);
109   virtual void DoRun (void);
110   uint16_t m_nUser; ///< number of UE nodes
111   std::vector<double> m_dist; ///< distance between the nodes
112   std::vector<uint32_t> m_achievableRateDl; ///< DL achievable rate
113   std::vector<uint32_t> m_estThrFdBetUl; ///< estimated throughput FDBET UL
114   bool m_errorModelEnabled; ///< specifies whether the error model is enabled
115 };
116 
117 
118 
119 /**
120  * \ingroup lte-test
121  * \ingroup tests
122  *
123  * \brief Test suite for FDBetFfMacScheduler test case.
124  */
125 
126 class LenaTestFdBetFfMacSchedulerSuite : public TestSuite
127 {
128 public:
129   LenaTestFdBetFfMacSchedulerSuite ();
130 };
131 
132 #endif /* LENA_TEST_FDBET_FF_MAC_SCHEDULER_H */
133