23#include "ns3/double.h"
24#include "ns3/isotropic-antenna-model.h"
26#include "ns3/pointer.h"
27#include "ns3/simulator.h"
29#include "ns3/three-gpp-antenna-model.h"
30#include "ns3/uinteger.h"
31#include "ns3/uniform-planar-array.h"
85 double expectedGainDb);
91 void DoRun()
override;
120 std::ostringstream oss;
121 oss <<
"UPA=" << rows <<
"x" << cols <<
", row spacing=" << rowSpace <<
"*lambda"
122 <<
", col spacing=" << colSpace <<
"*lambda"
125 <<
", element=" << element->GetInstanceTypeId().GetName() <<
", direction=" << direction;
137 double expectedGainDb)
138 :
TestCase(BuildNameString(element, rows, cols, rowSpace, colSpace, alpha, beta, direction)),
142 m_rowSpace(rowSpace),
143 m_colSpace(colSpace),
146 m_direction(direction),
147 m_expectedGain(expectedGainDb)
159 std::pair<double, double> fp = a->GetElementFieldPattern(
m_direction);
162 std::complex<double> prod{0};
163 for (
size_t i = 0; i < sv.
GetSize(); i++)
165 prod += sv[i] * bf[i];
167 double bfGain = std::pow(std::abs(prod), 2);
168 double bfGainDb = 10 * std::log10(bfGain);
171 double elementPowerGain = std::pow(std::get<0>(fp), 2) + std::pow(std::get<1>(fp), 2);
172 double elementPowerGainDb = 10 * std::log10(elementPowerGain);
175 return bfGainDb + elementPowerGainDb;
203 "wrong value of the radiation pattern");
236 TestCase::Duration::QUICK);
246 TestCase::Duration::QUICK);
256 TestCase::Duration::QUICK);
266 TestCase::Duration::QUICK);
276 TestCase::Duration::QUICK);
286 TestCase::Duration::QUICK);
296 TestCase::Duration::QUICK);
306 TestCase::Duration::QUICK);
316 TestCase::Duration::QUICK);
326 TestCase::Duration::QUICK);
338 TestCase::Duration::QUICK);
348 TestCase::Duration::QUICK);
358 TestCase::Duration::QUICK);
370 TestCase::Duration::QUICK);
380 TestCase::Duration::QUICK);
390 TestCase::Duration::QUICK);
Class holding the azimuth and inclination angles of spherical coordinates.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double DegreesToRadians(double degrees)
converts degrees to radians
double RadiansToDegrees(double radians)
converts radians to degrees