12#include "ns3/double.h"
13#include "ns3/isotropic-antenna-model.h"
15#include "ns3/pointer.h"
16#include "ns3/simulator.h"
18#include "ns3/three-gpp-antenna-model.h"
19#include "ns3/uinteger.h"
20#include "ns3/uniform-planar-array.h"
74 double expectedGainDb);
80 void DoRun()
override;
109 std::ostringstream oss;
110 oss <<
"UPA=" << rows <<
"x" << cols <<
", row spacing=" << rowSpace <<
"*lambda"
111 <<
", col spacing=" << colSpace <<
"*lambda"
114 <<
", element=" << element->GetInstanceTypeId().GetName() <<
", direction=" << direction;
126 double expectedGainDb)
127 :
TestCase(BuildNameString(element, rows, cols, rowSpace, colSpace, alpha, beta, direction)),
131 m_rowSpace(rowSpace),
132 m_colSpace(colSpace),
135 m_direction(direction),
136 m_expectedGain(expectedGainDb)
148 std::pair<double, double> fp = a->GetElementFieldPattern(
m_direction);
151 std::complex<double> prod{0};
152 for (
size_t i = 0; i < sv.
GetSize(); i++)
154 prod += sv[i] * bf[i];
156 double bfGain = std::pow(std::abs(prod), 2);
157 double bfGainDb = 10 * std::log10(bfGain);
160 double elementPowerGain = std::pow(std::get<0>(fp), 2) + std::pow(std::get<1>(fp), 2);
161 double elementPowerGainDb = 10 * std::log10(elementPowerGain);
164 return bfGainDb + elementPowerGainDb;
192 "wrong value of the radiation pattern");
225 TestCase::Duration::QUICK);
235 TestCase::Duration::QUICK);
245 TestCase::Duration::QUICK);
255 TestCase::Duration::QUICK);
265 TestCase::Duration::QUICK);
275 TestCase::Duration::QUICK);
285 TestCase::Duration::QUICK);
295 TestCase::Duration::QUICK);
305 TestCase::Duration::QUICK);
315 TestCase::Duration::QUICK);
327 TestCase::Duration::QUICK);
337 TestCase::Duration::QUICK);
347 TestCase::Duration::QUICK);
359 TestCase::Duration::QUICK);
369 TestCase::Duration::QUICK);
379 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 ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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