A Discrete-Event Network Simulator
API
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. More...
 
 ~OverallGainAverageTest () override
 Destructor. More...
 
double ComputePowerSpectralDensityOverallPower (Ptr< const SpectrumValue > psd)
 Computes the overall power of a PSD. More...
 
Ptr< SpectrumValueCreateTxPowerSpectralDensity (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
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Build the test scenario. More...
 

Private Attributes

double m_fc
 the carrier frequency More...
 
Ptr< AntennaModelm_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< AntennaModelm_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...
 
TestCaseGetParent () 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...
 

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 f(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, M_BW, and M_RB_WIDTH.

Referenced by DoRun().

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

◆ DoRun()

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: