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 ("ItuR1411NlosOverRooftopPropagationLossModelTest"); | 34 NS_LOG_COMPONENT_DEFINE ("ItuR1411NlosOverRooftopPropagationLossModelTest"); |
35 | 35 |
| 36 /** |
| 37 * \ingroup propagation-test |
| 38 * \ingroup tests |
| 39 * |
| 40 * \brief ItuR1411 Nlos Over Rooftop Propagation Loss Model Test Case |
| 41 */ |
36 class ItuR1411NlosOverRooftopPropagationLossModelTestCase : public TestCase | 42 class ItuR1411NlosOverRooftopPropagationLossModelTestCase : public TestCase |
37 { | 43 { |
38 public: | 44 public: |
| 45 /** |
| 46 * Constructor |
| 47 * |
| 48 * \param freq frequency |
| 49 * \param dist distribution |
| 50 * \param hb HB |
| 51 * \param hm HM |
| 52 * \param env environment type |
| 53 * \param city size |
| 54 * \param refValue reference value |
| 55 * \param name reference name |
| 56 */ |
39 ItuR1411NlosOverRooftopPropagationLossModelTestCase (double freq, double dist,
double hb, double hm, EnvironmentType env, CitySize city, double refValue, std:
:string name); | 57 ItuR1411NlosOverRooftopPropagationLossModelTestCase (double freq, double dist,
double hb, double hm, EnvironmentType env, CitySize city, double refValue, std:
:string name); |
40 virtual ~ItuR1411NlosOverRooftopPropagationLossModelTestCase (); | 58 virtual ~ItuR1411NlosOverRooftopPropagationLossModelTestCase (); |
41 | 59 |
42 private: | 60 private: |
43 virtual void DoRun (void); | 61 virtual void DoRun (void); |
| 62 /** |
| 63 * Create mobility model |
| 64 * \param index the mobility model index |
| 65 * \returns the mobility model |
| 66 */ |
44 Ptr<MobilityModel> CreateMobilityModel (uint16_t index); | 67 Ptr<MobilityModel> CreateMobilityModel (uint16_t index); |
45 | 68 |
46 double m_freq; | 69 double m_freq; ///< frequency |
47 double m_dist; | 70 double m_dist; ///< distribution |
48 double m_hb; | 71 double m_hb; ///< HB |
49 double m_hm; | 72 double m_hm; ///< HM |
50 EnvironmentType m_env; | 73 EnvironmentType m_env; ///< environment type |
51 CitySize m_city; | 74 CitySize m_city; ///< city size |
52 double m_lossRef; | 75 double m_lossRef; ///< loss reference |
53 | 76 |
54 }; | 77 }; |
55 | 78 |
56 ItuR1411NlosOverRooftopPropagationLossModelTestCase::ItuR1411NlosOverRooftopProp
agationLossModelTestCase (double freq, double dist, double hb, double hm, Enviro
nmentType env, CitySize city, double refValue, std::string name) | 79 ItuR1411NlosOverRooftopPropagationLossModelTestCase::ItuR1411NlosOverRooftopProp
agationLossModelTestCase (double freq, double dist, double hb, double hm, Enviro
nmentType env, CitySize city, double refValue, std::string name) |
57 : TestCase (name), | 80 : TestCase (name), |
58 m_freq (freq), | 81 m_freq (freq), |
59 m_dist (dist), | 82 m_dist (dist), |
60 m_hb (hb), | 83 m_hb (hb), |
61 m_hm (hm), | 84 m_hm (hm), |
62 m_env (env), | 85 m_env (env), |
(...skipping 28 matching lines...) Expand all Loading... |
91 double loss = propagationLossModel->GetLoss (mma, mmb); | 114 double loss = propagationLossModel->GetLoss (mma, mmb); |
92 | 115 |
93 NS_LOG_INFO ("Calculated loss: " << loss); | 116 NS_LOG_INFO ("Calculated loss: " << loss); |
94 NS_LOG_INFO ("Theoretical loss: " << m_lossRef); | 117 NS_LOG_INFO ("Theoretical loss: " << m_lossRef); |
95 · | 118 · |
96 NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss!"); | 119 NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss!"); |
97 | 120 |
98 } | 121 } |
99 | 122 |
100 | 123 |
101 | 124 /** |
| 125 * \ingroup propagation-test |
| 126 * \ingroup tests |
| 127 * |
| 128 * \brief ItuR 1411 NLos Over Rooftop Propagation Loss Model Test Suite |
| 129 */ |
102 class ItuR1411NlosOverRooftopPropagationLossModelTestSuite : public TestSuite | 130 class ItuR1411NlosOverRooftopPropagationLossModelTestSuite : public TestSuite |
103 { | 131 { |
104 public: | 132 public: |
105 ItuR1411NlosOverRooftopPropagationLossModelTestSuite (); | 133 ItuR1411NlosOverRooftopPropagationLossModelTestSuite (); |
106 }; | 134 }; |
107 | 135 |
108 | 136 |
109 | 137 |
110 ItuR1411NlosOverRooftopPropagationLossModelTestSuite::ItuR1411NlosOverRooftopPro
pagationLossModelTestSuite () | 138 ItuR1411NlosOverRooftopPropagationLossModelTestSuite::ItuR1411NlosOverRooftopPro
pagationLossModelTestSuite () |
111 : TestSuite ("itu-r-1411-nlos-over-rooftop", SYSTEM) | 139 : TestSuite ("itu-r-1411-nlos-over-rooftop", SYSTEM) |
112 { | 140 { |
113 | 141 |
114 LogComponentEnable ("ItuR1411NlosOverRooftopPropagationLossModelTest", LOG_LEV
EL_ALL); | 142 LogComponentEnable ("ItuR1411NlosOverRooftopPropagationLossModelTest", LOG_LEV
EL_ALL); |
115 | 143 |
116 // reference values obtained with the octave scripts in src/propagation/test/r
eference/ | 144 // reference values obtained with the octave scripts in src/propagation/test/r
eference/ |
117 | 145 |
118 AddTestCase (new ItuR1411NlosOverRooftopPropagationLossModelTestCase (2.1140e9
, 900, 30, 1, UrbanEnvironment, LargeCity, 143.68, "f=2114Mhz, dist=900, urban l
arge city"), TestCase::QUICK); | 146 AddTestCase (new ItuR1411NlosOverRooftopPropagationLossModelTestCase (2.1140e9
, 900, 30, 1, UrbanEnvironment, LargeCity, 143.68, "f=2114Mhz, dist=900, urban l
arge city"), TestCase::QUICK); |
119 | 147 |
120 AddTestCase (new ItuR1411NlosOverRooftopPropagationLossModelTestCase (1.865e9,
500, 30, 1, UrbanEnvironment, LargeCity, 132.84, "f=2114Mhz, dist=900, urban l
arge city"), TestCase::QUICK); | 148 AddTestCase (new ItuR1411NlosOverRooftopPropagationLossModelTestCase (1.865e9,
500, 30, 1, UrbanEnvironment, LargeCity, 132.84, "f=2114Mhz, dist=900, urban l
arge city"), TestCase::QUICK); |
121 | 149 |
122 } | 150 } |
123 | 151 |
124 | 152 |
125 | 153 |
126 static ItuR1411NlosOverRooftopPropagationLossModelTestSuite g_ituR1411NlosOverRo
oftopTestSuite; | 154 static ItuR1411NlosOverRooftopPropagationLossModelTestSuite g_ituR1411NlosOverRo
oftopTestSuite; ///< the test suite |
OLD | NEW |