A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
OverallGainAverageTest Class Reference

Test case for the TwoRaySpectrumPropagationLossModel class. More...

+ Inheritance diagram for OverallGainAverageTest:
+ Collaboration diagram for OverallGainAverageTest:

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.
 
 ~OverallGainAverageTest () override
 Destructor.
 
double ComputePowerSpectralDensityOverallPower (Ptr< const SpectrumValue > psd)
 Computes the overall power of a PSD.
 
Ptr< SpectrumValueCreateTxPowerSpectralDensity (double fc)
 Creates a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidth.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Build the test scenario.
 

Private Attributes

double m_fc
 the carrier frequency
 
Ptr< AntennaModelm_rxAntElem
 the antenna element of the RX antenna panel
 
uint16_t m_rxNumAntennas
 the number of antenna elements of the RX antenna panel
 
std::string m_threeGppScenario
 the 3GPP scenario
 
Ptr< AntennaModelm_txAntElem
 the antenna element of the TX antenna panel
 
uint16_t m_txNumAntennas
 the number of antenna elements of the TX antenna panel
 

Static Private Attributes

static constexpr double M_BW {200e6}
 The simulation bandwidth. Results are independent from this parameter.
 
static constexpr double M_RB_WIDTH {1e6}
 The width of a RB, which in turn specifies the resolution of the generated PSDs.
 
static constexpr uint32_t N_MEASUREMENTS {1000}
 Number of samples to draw when estimating the average.
 
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.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
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.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ OverallGainAverageTest()

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.

Parameters
txAntElemthe antenna element of the TX antenna panel
rxAntElemthe antenna element of the RX antenna panel
txNumAntennasthe number of antenna elements of the TX antenna panel
rxNumAntennasthe number of antenna elements of the RX antenna panel
fcthe carrier frequency
threeGppScenariothe 3GPP scenario

Definition at line 414 of file two-ray-splm-test-suite.cc.

◆ ~OverallGainAverageTest()

OverallGainAverageTest::~OverallGainAverageTest ( )
override

Destructor.

Definition at line 433 of file two-ray-splm-test-suite.cc.

Member Function Documentation

◆ ComputePowerSpectralDensityOverallPower()

double OverallGainAverageTest::ComputePowerSpectralDensityOverallPower ( Ptr< const SpectrumValue psd)

Computes the overall power of a PSD.

Parameters
psdthe PSD
Returns
the overall power of the PSD, obtained as the integral of the sub-bands power over the PSD domain

Definition at line 438 of file two-ray-splm-test-suite.cc.

References ns3::Integral().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateTxPowerSpectralDensity()

Ptr< SpectrumValue > OverallGainAverageTest::CreateTxPowerSpectralDensity ( double  fc)

Creates a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidth.

Parameters
fcthe central frequency of the PSD
Returns
a PSD centered at fc, of bandwidth bw and sub-bands of width rbWidths

Definition at line 444 of file two-ray-splm-test-suite.cc.

References ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, M_BW, and M_RB_WIDTH.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void OverallGainAverageTest::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, N_MEASUREMENTS, nodes, NS_TEST_EXPECT_MSG_EQ_TOL, and TOLERANCE.

+ Here is the call graph for this function:

Member Data Documentation

◆ M_BW

constexpr double OverallGainAverageTest::M_BW {200e6}
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().

◆ m_fc

double OverallGainAverageTest::m_fc
private

the carrier frequency

Definition at line 410 of file two-ray-splm-test-suite.cc.

Referenced by DoRun().

◆ M_RB_WIDTH

constexpr double OverallGainAverageTest::M_RB_WIDTH {1e6}
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().

◆ m_rxAntElem

Ptr<AntennaModel> OverallGainAverageTest::m_rxAntElem
private

the antenna element of the RX antenna panel

Definition at line 407 of file two-ray-splm-test-suite.cc.

Referenced by DoRun().

◆ m_rxNumAntennas

uint16_t OverallGainAverageTest::m_rxNumAntennas
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().

◆ m_threeGppScenario

std::string OverallGainAverageTest::m_threeGppScenario
private

the 3GPP scenario

Definition at line 411 of file two-ray-splm-test-suite.cc.

Referenced by DoRun().

◆ m_txAntElem

Ptr<AntennaModel> OverallGainAverageTest::m_txAntElem
private

the antenna element of the TX antenna panel

Definition at line 406 of file two-ray-splm-test-suite.cc.

Referenced by DoRun().

◆ m_txNumAntennas

uint16_t OverallGainAverageTest::m_txNumAntennas
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().

◆ N_MEASUREMENTS

constexpr uint32_t OverallGainAverageTest::N_MEASUREMENTS {1000}
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().

◆ TOLERANCE

constexpr double OverallGainAverageTest::TOLERANCE {0.02}
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().


The documentation for this class was generated from the following file: