9#include "ns3/constant-position-mobility-model.h"
10#include "ns3/double.h"
11#include "ns3/isotropic-antenna-model.h"
13#include "ns3/mobility-helper.h"
14#include "ns3/node-container.h"
15#include "ns3/pointer.h"
16#include "ns3/simulator.h"
17#include "ns3/string.h"
19#include "ns3/three-gpp-antenna-model.h"
20#include "ns3/three-gpp-channel-model.h"
21#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
22#include "ns3/two-ray-spectrum-propagation-loss-model.h"
23#include "ns3/uinteger.h"
24#include "ns3/uniform-planar-array.h"
57 void DoRun()
override;
104 :
TestCase(
"Check that the average of the Fluctuating Two Ray model is consistent with the "
105 "theoretical expectation")
132 return 2 * sigma * (1 + k);
138 std::array<double, NUM_VALUES> sigma;
139 std::array<double, NUM_VALUES> k;
140 std::array<double, NUM_VALUES> delta;
145 double power = std::pow(2,
j);
221 void DoRun()
override;
251 :
TestCase(
"Check that the overall array response gain has the proper trend with respect to "
252 "the number of antennas and the type of single element antenna"),
315 "gain different from the theoretically expected value");
375 void DoRun()
override;
411 :
TestCase(
"Check that the overall array response gain has the proper trend with respect to"
412 "the number of antennas and the type of single element antenna"),
440 std::vector<int>
rbsId;
496 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
497 mobility.Install(
nodes);
571 "The 3GPP and Two Ray models should provide similar average channel gains");
608 Vector(0.0, 0.0, 0.0),
609 Vector(5.0, 0.0, 0.0),
613 TestCase::Duration::QUICK);
618 Vector(0.0, 0.0, 0.0),
619 Vector(5.0, 0.0, 0.0),
623 TestCase::Duration::QUICK);
628 Vector(0.0, 0.0, 0.0),
629 Vector(5.0, 0.0, 0.0),
633 TestCase::Duration::QUICK);
638 Vector(0.0, 0.0, 0.0),
639 Vector(5.0, 0.0, 0.0),
643 TestCase::Duration::QUICK);
648 Vector(0.0, 0.0, 0.0),
649 Vector(5.0, 0.0, 0.0),
653 TestCase::Duration::QUICK);
658 Vector(0.0, 0.0, 0.0),
659 Vector(5.0, 0.0, 0.0),
663 TestCase::Duration::QUICK);
668 Vector(0.0, 0.0, 0.0),
669 Vector(5.0, 0.0, 0.0),
673 TestCase::Duration::QUICK);
678 Vector(0.0, 0.0, 0.0),
679 Vector(5.0, 0.0, 0.0),
683 TestCase::Duration::QUICK);
688 Vector(0.0, 0.0, 0.0),
689 Vector(5.0, 0.0, 0.0),
693 TestCase::Duration::QUICK);
698 Vector(0.0, 0.0, 0.0),
699 Vector(5.0, 0.0, 0.0),
703 TestCase::Duration::QUICK);
708 Vector(0.0, 0.0, 0.0),
709 Vector(5.0, 0.0, 0.0),
713 TestCase::Duration::QUICK);
718 Vector(0.0, 0.0, 0.0),
719 Vector(5.0, 0.0, 0.0),
723 TestCase::Duration::QUICK);
728 Vector(0.0, 0.0, 0.0),
729 Vector(5.0, 0.0, 0.0),
733 TestCase::Duration::QUICK);
738 Vector(0.0, 0.0, 0.0),
739 Vector(5.0, 0.0, 0.0),
743 TestCase::Duration::QUICK);
748 Vector(0.0, 0.0, 0.0),
749 Vector(5.0, 0.0, 0.0),
753 TestCase::Duration::QUICK);
758 Vector(0.0, 0.0, 0.0),
759 Vector(5.0, 0.0, 0.0),
763 TestCase::Duration::QUICK);
768 Vector(0.0, 0.0, 0.0),
769 Vector(5.0, 0.0, 0.0),
773 TestCase::Duration::QUICK);
778 Vector(0.0, 0.0, 0.0),
779 Vector(5.0, 0.0, 0.0),
783 TestCase::Duration::QUICK);
790 TestCase::Duration::EXTENSIVE);
792 TestCase::Duration::EXTENSIVE);
794 TestCase::Duration::EXTENSIVE);
796 TestCase::Duration::EXTENSIVE);
798 TestCase::Duration::EXTENSIVE);
800 TestCase::Duration::EXTENSIVE);
802 TestCase::Duration::EXTENSIVE);
804 TestCase::Duration::EXTENSIVE);
806 TestCase::Duration::EXTENSIVE);
808 TestCase::Duration::EXTENSIVE);
810 TestCase::Duration::EXTENSIVE);
812 TestCase::Duration::EXTENSIVE);
814 TestCase::Duration::EXTENSIVE);
816 TestCase::Duration::EXTENSIVE);
818 TestCase::Duration::EXTENSIVE);
820 TestCase::Duration::EXTENSIVE);
822 TestCase::Duration::EXTENSIVE);
824 TestCase::Duration::EXTENSIVE);
826 TestCase::Duration::EXTENSIVE);
828 TestCase::Duration::EXTENSIVE);
Test case for the TwoRaySpectrumPropagationLossModel class.
uint16_t m_txNumAntennas
the number of antenna elements of the TX antenna panel
~ArrayResponseTest() override
Destructor.
uint16_t m_rxNumAntennas
the number of antenna elements of the RX antenna panel
static constexpr double TOLERANCE
Tolerance for testing value produced by the simulator against expected theoretical value,...
double m_rxBearing
the bearing angle of the RX antenna panel [rad]
Vector m_rxPosVec
the position of the RX
Vector m_txPosVec
the position of the TX
double m_txBearing
the bearing angle of the TX antenna panel [rad]
Ptr< AntennaModel > m_txAntElem
the antenna element of the TX antenna panel
double m_expectedGain
the gain which is theoretically expected [db]
void DoRun() override
Build the test scenario.
Ptr< AntennaModel > m_rxAntElem
the antenna element of the RX antenna panel
ArrayResponseTest(Ptr< AntennaModel > txAntElem, Ptr< AntennaModel > rxAntElem, uint16_t txNumAntennas, uint16_t rxNumAntennas, Vector txPosVec, Vector rxPosVec, double txBearing, double rxBearing, double expectedGain)
The constructor of the test case.
Test case for the TwoRaySpectrumPropagationLossModel class.
static constexpr uint32_t N_MEASUREMENTS
Number of samples to draw when populating the distribution.
FtrFadingModelAverageTest()
Constructor.
static constexpr uint16_t MAX_M_VALUE
Maximum value for the m parameter.
double FtrSquaredNormAverage(const TwoRaySpectrumPropagationLossModel::FtrParams &ftrParams) const
Compute the average of the FTR squared norm.
static constexpr uint8_t NUM_VALUES
Number of different values for each FTR parameter.
~FtrFadingModelAverageTest() override
Destructor.
static constexpr double TOLERANCE
Tolerance for testing FTR's expectations against theoretical values, expressed as a fraction of the e...
void DoRun() override
Build the test scenario.
constexpr double FtrSquaredNormExpectedMean(double sigma, double k) const
Compute the expected mean of the FTR squared norm.
Test case for the TwoRaySpectrumPropagationLossModel class.
Ptr< AntennaModel > m_txAntElem
the antenna element of the TX antenna panel
uint16_t m_rxNumAntennas
the number of antenna elements of the RX antenna panel
double m_fc
the carrier frequency
static constexpr double M_RB_WIDTH
The width of a RB, which in turn specifies the resolution of the generated PSDs.
double ComputePowerSpectralDensityOverallPower(Ptr< const SpectrumValue > psd)
Computes the overall power of a PSD.
static constexpr uint32_t N_MEASUREMENTS
Number of samples to draw when estimating the average.
static constexpr double M_BW
The simulation bandwidth. Results are independent from this parameter.
std::string m_threeGppScenario
the 3GPP scenario
~OverallGainAverageTest() override
Destructor.
Ptr< AntennaModel > m_rxAntElem
the antenna element of the RX antenna panel
OverallGainAverageTest(Ptr< AntennaModel > txAntElem, Ptr< AntennaModel > rxAntElem, uint16_t txNumAntennas, uint16_t rxNumAntennas, double fc, std::string threeGppScenario)
The constructor of the test case.
Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double fc)
Creates a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidth.
void DoRun() override
Build the test scenario.
static constexpr double TOLERANCE
Tolerance for testing average channel gain produced by the Two Ray model with respect to the 3GPP mod...
uint16_t m_txNumAntennas
the number of antenna elements of the TX antenna panel
Test suite for the TwoRaySpectrumPropagationLossModel class.
TwoRaySplmTestSuite()
Constructor.
Class holding the azimuth and inclination angles of spherical coordinates.
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
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 > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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 ...
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double Integral(const SpectrumValue &arg)
std::vector< BandInfo > Bands
Container of BandInfo.
static unsigned int value(char c)
The building block of a SpectrumModel.
double fl
lower limit of subband
Struct holding the Fluctuating Two Ray fast-fading model parameters.
static TwoRaySplmTestSuite myTestSuite