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"
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");
218 :
TestSuite(
"uniform-planar-array-test", UNIT)
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'.
MatrixArray class inherits ValArray class and provides additional interfaces to ValArray which enable...
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Hold objects of type Ptr<T>.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
std::string GetName() const
Get the name.
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