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");
216 void DoRun()
override;
227 ant->SetAttribute(
"AntennaVerticalSpacing",
DoubleValue(0.5));
228 ant->SetAttribute(
"AntennaHorizontalSpacing",
DoubleValue(0.5));
236 ant2->SetAttribute(
"AntennaVerticalSpacing",
DoubleValue(0.5));
237 ant2->SetAttribute(
"AntennaHorizontalSpacing",
DoubleValue(0.5));
246 "Expecting update, since the pair was never setup");
248 ant2->IsChannelOutOfDate(ant),
250 "Not expecting update, since the pair was just updated and no settings changed");
254 "Expecting update, antenna parameter changed");
256 ant->IsChannelOutOfDate(ant2),
258 "Not expecting update, since the pair was just updated and no settings changed");
262 "Expecting update, antenna parameter changed");
295 TestCase::Duration::QUICK);
305 TestCase::Duration::QUICK);
315 TestCase::Duration::QUICK);
325 TestCase::Duration::QUICK);
335 TestCase::Duration::QUICK);
345 TestCase::Duration::QUICK);
355 TestCase::Duration::QUICK);
365 TestCase::Duration::QUICK);
375 TestCase::Duration::QUICK);
385 TestCase::Duration::QUICK);
397 TestCase::Duration::QUICK);
407 TestCase::Duration::QUICK);
417 TestCase::Duration::QUICK);
429 TestCase::Duration::QUICK);
439 TestCase::Duration::QUICK);
449 TestCase::Duration::QUICK);
451 "Test IsChannelOutOfDate() and InvalidateChannels() for "
452 "UniformPlanarArray with 3GPP antenna element"),
453 TestCase::Duration::QUICK);
UpdateOnChange Test Case.
UpdateOnChangeTestCase(Ptr< AntennaModel > element, std::string name)
The constructor of the test case.
Ptr< AntennaModel > m_element
the antenna element
void DoRun() override
Run the test.
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_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#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