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

Test case for the TwoRaySpectrumPropagationLossModel class. More...

+ Inheritance diagram for FtrFadingModelAverageTest:
+ Collaboration diagram for FtrFadingModelAverageTest:

Public Member Functions

 FtrFadingModelAverageTest ()
 Constructor.
 
 ~FtrFadingModelAverageTest () override
 Destructor.
 
- 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.
 
double FtrSquaredNormAverage (const TwoRaySpectrumPropagationLossModel::FtrParams &ftrParams) const
 Compute the average of the FTR squared norm.
 
constexpr double FtrSquaredNormExpectedMean (double sigma, double k) const
 Compute the expected mean of the FTR squared norm.
 

Static Private Attributes

static constexpr uint16_t MAX_M_VALUE {1000}
 Maximum value for the m parameter.
 
static constexpr uint32_t N_MEASUREMENTS {100000}
 Number of samples to draw when populating the distribution.
 
static constexpr uint8_t NUM_VALUES {3}
 Number of different values for each FTR parameter.
 
static constexpr double TOLERANCE {1e-2}
 Tolerance for testing FTR's expectations against theoretical values, expressed as a fraction of the expected mean.
 

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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::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 of the Fluctuating Two Ray (FTR) fading model is consistent with the theoretical value.

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

Constructor & Destructor Documentation

◆ FtrFadingModelAverageTest()

FtrFadingModelAverageTest::FtrFadingModelAverageTest ( )

Constructor.

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

◆ ~FtrFadingModelAverageTest()

FtrFadingModelAverageTest::~FtrFadingModelAverageTest ( )
override

Destructor.

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

Member Function Documentation

◆ DoRun()

void FtrFadingModelAverageTest::DoRun ( )
overrideprivatevirtual

Build the test scenario.

Implements ns3::TestCase.

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

References ns3::CreateObject(), FtrSquaredNormAverage(), FtrSquaredNormExpectedMean(), MAX_M_VALUE, NS_TEST_ASSERT_MSG_EQ_TOL, NUM_VALUES, and TOLERANCE.

+ Here is the call graph for this function:

◆ FtrSquaredNormAverage()

double FtrFadingModelAverageTest::FtrSquaredNormAverage ( const TwoRaySpectrumPropagationLossModel::FtrParams & ftrParams) const
private

Compute the average of the FTR squared norm.

Parameters
[in]ftrParamsThe FTR parameters.
Returns
The average of N_MEASUREMENTS FTR samples.

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

References ns3::CreateObject(), N_MEASUREMENTS, and NS_LOG_FUNCTION.

Referenced by DoRun().

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

◆ FtrSquaredNormExpectedMean()

double constexpr FtrFadingModelAverageTest::FtrSquaredNormExpectedMean ( double sigma,
double k ) const
constexprprivate

Compute the expected mean of the FTR squared norm.

The expected mean $ \mathbb{E} \left[ h^2 \right] $ can be computed as $ \mathbb{E}\left[ |h|^2 \right] = V_1^2 + V_2^2 + 2*\sigma $, where: $ \sigma^2 $ is the variance of the Gaussian distributed random variables which model the real and complex component of the specular terms and $ V_1 $ and $ V_2 $ are the constant amplitudes of the reflected components.รน In turn, this equals to $ 2*\sigma^2 \left( 1 + K \right) $.

See J. M. Romero-Jerez, F. J. Lopez-Martinez, J. F. Paris and A. Goldsmith, "The Fluctuating Two-Ray Fading Model for mmWave Communications," 2016 IEEE Globecom Workshops (GC Wkshps) for further details.

Parameters
[in]sigmaThe sigma parameter of the FTR model.
[in]kThe k parameter of the FTR model.
Returns
The expected mean.

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

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ MAX_M_VALUE

uint16_t FtrFadingModelAverageTest::MAX_M_VALUE {1000}
staticconstexprprivate

Maximum value for the m parameter.

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

Referenced by DoRun().

◆ N_MEASUREMENTS

uint32_t FtrFadingModelAverageTest::N_MEASUREMENTS {100000}
staticconstexprprivate

Number of samples to draw when populating the distribution.

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

Referenced by FtrSquaredNormAverage().

◆ NUM_VALUES

uint8_t FtrFadingModelAverageTest::NUM_VALUES {3}
staticconstexprprivate

Number of different values for each FTR parameter.

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

Referenced by DoRun().

◆ TOLERANCE

double FtrFadingModelAverageTest::TOLERANCE {1e-2}
staticconstexprprivate

Tolerance for testing FTR's expectations against theoretical values, expressed as a fraction of the expected mean.

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

Referenced by DoRun().


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