OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011,2012 Centre Tecnologic de Telecomunicacions de Catalunya (
CTTC) | 3 * Copyright (c) 2011,2012 Centre Tecnologic de Telecomunicacions de Catalunya (
CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include <ns3/string.h> | 26 #include <ns3/string.h> |
27 #include <ns3/double.h> | 27 #include <ns3/double.h> |
28 #include <ns3/constant-position-mobility-model.h> | 28 #include <ns3/constant-position-mobility-model.h> |
29 #include <ns3/enum.h> | 29 #include <ns3/enum.h> |
30 | 30 |
31 | 31 |
32 using namespace ns3; | 32 using namespace ns3; |
33 | 33 |
34 NS_LOG_COMPONENT_DEFINE ("ItuR1411LosPropagationLossModelTest"); | 34 NS_LOG_COMPONENT_DEFINE ("ItuR1411LosPropagationLossModelTest"); |
35 | 35 |
| 36 /** |
| 37 * \ingroup propagation-test |
| 38 * \defgroup propagation-test propagation module tests |
| 39 */ |
| 40 |
| 41 |
| 42 /** |
| 43 * \ingroup propagation-test |
| 44 * \ingroup tests |
| 45 * |
| 46 * \brief ItuR 1411 Los Propagation Loss Model Test Case |
| 47 */ |
36 class ItuR1411LosPropagationLossModelTestCase : public TestCase | 48 class ItuR1411LosPropagationLossModelTestCase : public TestCase |
37 { | 49 { |
38 public: | 50 public: |
| 51 /** |
| 52 * Constructor |
| 53 * |
| 54 * \param freq frequency |
| 55 * \param dist distribution |
| 56 * \param hb HB |
| 57 * \param hm HM |
| 58 * \param refValue reference value |
| 59 * \param name reference name |
| 60 */ |
39 ItuR1411LosPropagationLossModelTestCase (double freq, double dist, double hb,
double hm, double refValue, std::string name); | 61 ItuR1411LosPropagationLossModelTestCase (double freq, double dist, double hb,
double hm, double refValue, std::string name); |
40 virtual ~ItuR1411LosPropagationLossModelTestCase (); | 62 virtual ~ItuR1411LosPropagationLossModelTestCase (); |
41 | 63 |
42 private: | 64 private: |
43 virtual void DoRun (void); | 65 virtual void DoRun (void); |
| 66 /** |
| 67 * Create mobility model |
| 68 * |
| 69 * \param index the mobility model index |
| 70 * \returns the mobility model |
| 71 */ |
44 Ptr<MobilityModel> CreateMobilityModel (uint16_t index); | 72 Ptr<MobilityModel> CreateMobilityModel (uint16_t index); |
45 | 73 |
46 double m_freq; | 74 double m_freq; ///< frequency |
47 double m_dist; | 75 double m_dist; ///< distribution |
48 double m_hb; | 76 double m_hb; ///< HB |
49 double m_hm; | 77 double m_hm; ///< HM |
50 double m_lossRef; | 78 double m_lossRef; ///< loss reference |
51 | 79 |
52 }; | 80 }; |
53 | 81 |
54 ItuR1411LosPropagationLossModelTestCase::ItuR1411LosPropagationLossModelTestCase
(double freq, double dist, double hb, double hm, double refValue, std::string n
ame) | 82 ItuR1411LosPropagationLossModelTestCase::ItuR1411LosPropagationLossModelTestCase
(double freq, double dist, double hb, double hm, double refValue, std::string n
ame) |
55 : TestCase (name), | 83 : TestCase (name), |
56 m_freq (freq), | 84 m_freq (freq), |
57 m_dist (dist), | 85 m_dist (dist), |
58 m_hb (hb), | 86 m_hb (hb), |
59 m_hm (hm), | 87 m_hm (hm), |
60 m_lossRef (refValue) | 88 m_lossRef (refValue) |
(...skipping 24 matching lines...) Expand all Loading... |
85 double loss = propagationLossModel->GetLoss (mma, mmb); | 113 double loss = propagationLossModel->GetLoss (mma, mmb); |
86 | 114 |
87 NS_LOG_INFO ("Calculated loss: " << loss); | 115 NS_LOG_INFO ("Calculated loss: " << loss); |
88 NS_LOG_INFO ("Theoretical loss: " << m_lossRef); | 116 NS_LOG_INFO ("Theoretical loss: " << m_lossRef); |
89 · | 117 · |
90 NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss!"); | 118 NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss!"); |
91 | 119 |
92 } | 120 } |
93 | 121 |
94 | 122 |
95 | 123 /** |
| 124 * \ingroup propagation-test |
| 125 * \ingroup tests |
| 126 * |
| 127 * \brief ItuR 1411 Los Propagation Loss Model Test Suite |
| 128 */ |
96 class ItuR1411LosPropagationLossModelTestSuite : public TestSuite | 129 class ItuR1411LosPropagationLossModelTestSuite : public TestSuite |
97 { | 130 { |
98 public: | 131 public: |
99 ItuR1411LosPropagationLossModelTestSuite (); | 132 ItuR1411LosPropagationLossModelTestSuite (); |
100 }; | 133 }; |
101 | 134 |
102 | 135 |
103 | 136 |
104 ItuR1411LosPropagationLossModelTestSuite::ItuR1411LosPropagationLossModelTestSui
te () | 137 ItuR1411LosPropagationLossModelTestSuite::ItuR1411LosPropagationLossModelTestSui
te () |
105 : TestSuite ("itu-r-1411-los", SYSTEM) | 138 : TestSuite ("itu-r-1411-los", SYSTEM) |
106 { | 139 { |
107 | 140 |
108 LogComponentEnable ("ItuR1411LosPropagationLossModelTest", LOG_LEVEL_ALL); | 141 LogComponentEnable ("ItuR1411LosPropagationLossModelTest", LOG_LEVEL_ALL); |
109 | 142 |
110 // reference values obtained with the octave scripts in src/propagation/test/r
eference/ | 143 // reference values obtained with the octave scripts in src/propagation/test/r
eference/ |
111 | 144 |
112 AddTestCase (new ItuR1411LosPropagationLossModelTestCase (2.1140e9, 100, 30, 1
, 81.005, "freq=2114MHz, dist=100m"), TestCase::QUICK); | 145 AddTestCase (new ItuR1411LosPropagationLossModelTestCase (2.1140e9, 100, 30, 1
, 81.005, "freq=2114MHz, dist=100m"), TestCase::QUICK); |
113 | 146 |
114 AddTestCase (new ItuR1411LosPropagationLossModelTestCase (1999e6, 200, 30, 1,
87.060, "freq=1999MHz, dist=200m"), TestCase::QUICK); | 147 AddTestCase (new ItuR1411LosPropagationLossModelTestCase (1999e6, 200, 30, 1,
87.060, "freq=1999MHz, dist=200m"), TestCase::QUICK); |
115 | 148 |
116 | 149 |
117 | 150 |
118 | 151 |
119 } | 152 } |
120 | 153 |
121 | 154 |
122 | 155 |
123 static ItuR1411LosPropagationLossModelTestSuite g_ituR1411LosTestSuite; | 156 static ItuR1411LosPropagationLossModelTestSuite g_ituR1411LosTestSuite; ///< the
test suite |
OLD | NEW |