Test case for the TwoRaySpectrumPropagationLossModel class. More...
Public Member Functions | |
OverallGainAverageTest (Ptr< AntennaModel > txAntElem, Ptr< AntennaModel > rxAntElem, uint16_t txNumAntennas, uint16_t rxNumAntennas, double fc, std::string threeGppScenario) | |
The constructor of the test case. More... | |
~OverallGainAverageTest () override | |
Destructor. More... | |
double | ComputePowerSpectralDensityOverallPower (Ptr< const SpectrumValue > psd) |
Computes the overall power of a PSD. More... | |
Ptr< SpectrumValue > | CreateTxPowerSpectralDensity (double fc) |
Creates a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidth. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Build the test scenario. More... | |
Private Attributes | |
double | m_fc |
the carrier frequency More... | |
Ptr< AntennaModel > | m_rxAntElem |
the antenna element of the RX antenna panel More... | |
uint16_t | m_rxNumAntennas |
the number of antenna elements of the RX antenna panel More... | |
std::string | m_threeGppScenario |
the 3GPP scenario More... | |
Ptr< AntennaModel > | m_txAntElem |
the antenna element of the TX antenna panel More... | |
uint16_t | m_txNumAntennas |
the number of antenna elements of the TX antenna panel More... | |
Static Private Attributes | |
static constexpr double | M_BW {200e6} |
The simulation bandwidth. Results are independent from this parameter. More... | |
static constexpr double | M_RB_WIDTH {1e6} |
The width of a RB, which in turn specifies the resolution of the generated PSDs. More... | |
static constexpr uint32_t | N_MEASUREMENTS {1000} |
Number of samples to draw when estimating the average. More... | |
static constexpr double | TOLERANCE {0.02} |
Tolerance for testing average channel gain produced by the Two Ray model with respect to the 3GPP model, which serves as the reference. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Test case for the TwoRaySpectrumPropagationLossModel class.
Check that the average overall channel gain obtained using the TwoRaySpectrumPropagationLossModel class is close (it is, after all, a simplified and performance-oriented model) to the one obtained using the ThreeGppSpectrumPropagationLossModel
Definition at line 339 of file two-ray-splm-test-suite.cc.
OverallGainAverageTest::OverallGainAverageTest | ( | Ptr< AntennaModel > | txAntElem, |
Ptr< AntennaModel > | rxAntElem, | ||
uint16_t | txNumAntennas, | ||
uint16_t | rxNumAntennas, | ||
double | fc, | ||
std::string | threeGppScenario | ||
) |
The constructor of the test case.
txAntElem | the antenna element of the TX antenna panel |
rxAntElem | the antenna element of the RX antenna panel |
txNumAntennas | the number of antenna elements of the TX antenna panel |
rxNumAntennas | the number of antenna elements of the RX antenna panel |
fc | the carrier frequency |
threeGppScenario | the 3GPP scenario |
Definition at line 414 of file two-ray-splm-test-suite.cc.
|
override |
Destructor.
Definition at line 433 of file two-ray-splm-test-suite.cc.
double OverallGainAverageTest::ComputePowerSpectralDensityOverallPower | ( | Ptr< const SpectrumValue > | psd | ) |
Computes the overall power of a PSD.
psd | the PSD |
Definition at line 438 of file two-ray-splm-test-suite.cc.
References ns3::Integral().
Referenced by DoRun().
Ptr< SpectrumValue > OverallGainAverageTest::CreateTxPowerSpectralDensity | ( | double | fc | ) |
Creates a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidth.
fc | the central frequency of the PSD |
Definition at line 444 of file two-ray-splm-test-suite.cc.
References f(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, M_BW, and M_RB_WIDTH.
Referenced by DoRun().
|
overrideprivatevirtual |
Build the test scenario.
Implements ns3::TestCase.
Definition at line 481 of file two-ray-splm-test-suite.cc.
References ComputePowerSpectralDensityOverallPower(), ns3::NodeContainer::Create(), CreateTxPowerSpectralDensity(), ns3::NodeContainer::Get(), ns3::Object::GetObject(), m_fc, m_rxAntElem, m_rxNumAntennas, m_threeGppScenario, m_txAntElem, m_txNumAntennas, third::mobility, N_MEASUREMENTS, nodes, NS_TEST_EXPECT_MSG_EQ_TOL, ns3::SpectrumSignalParameters::psd, and TOLERANCE.
|
staticconstexprprivate |
The simulation bandwidth. Results are independent from this parameter.
Definition at line 398 of file two-ray-splm-test-suite.cc.
Referenced by CreateTxPowerSpectralDensity().
|
private |
the carrier frequency
Definition at line 410 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
staticconstexprprivate |
The width of a RB, which in turn specifies the resolution of the generated PSDs.
Results are independent from this parameter.
Definition at line 404 of file two-ray-splm-test-suite.cc.
Referenced by CreateTxPowerSpectralDensity().
|
private |
the antenna element of the RX antenna panel
Definition at line 407 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
private |
the number of antenna elements of the RX antenna panel
Definition at line 409 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
private |
|
private |
the antenna element of the TX antenna panel
Definition at line 406 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
private |
the number of antenna elements of the TX antenna panel
Definition at line 408 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
staticconstexprprivate |
Number of samples to draw when estimating the average.
Definition at line 395 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
staticconstexprprivate |
Tolerance for testing average channel gain produced by the Two Ray model with respect to the 3GPP model, which serves as the reference.
Definition at line 392 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().