A Discrete-Event Network Simulator
API
FtrFadingModelAverageTest Class Reference

Test case for the TwoRaySpectrumPropagationLossModel class. More...

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

Public Member Functions

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

Static Private Attributes

static constexpr uint16_t MAX_M_VALUE {1000}
 Maximum value for the m parameter. More...
 
static constexpr uint32_t N_MEASUREMENTS {100000}
 Number of samples to draw when populating the distribution. More...
 
static constexpr uint8_t NUM_VALUES {3}
 Number of different values for each FTR parameter. More...
 
static constexpr double TOLERANCE {1e-2}
 Tolerance for testing FTR's expectations against theoretical values, expressed as a fraction of the expected mean. 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 of the Fluctuating Two Ray (FTR) fading model is consistent with the theoretical value.

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

Constructor & Destructor Documentation

◆ FtrFadingModelAverageTest()

FtrFadingModelAverageTest::FtrFadingModelAverageTest ( )

Constructor.

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

◆ ~FtrFadingModelAverageTest()

FtrFadingModelAverageTest::~FtrFadingModelAverageTest ( )
override

Destructor.

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

Member Function Documentation

◆ DoRun()

void FtrFadingModelAverageTest::DoRun ( void  )
overrideprivatevirtual

◆ 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 125 of file two-ray-splm-test-suite.cc.

References N_MEASUREMENTS, NS_LOG_FUNCTION, and second::value.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ FtrSquaredNormExpectedMean()

constexpr double 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 141 of file two-ray-splm-test-suite.cc.

References two-ray-to-three-gpp-ch-calibration::k, and two-ray-to-three-gpp-ch-calibration::sigma.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ MAX_M_VALUE

constexpr uint16_t FtrFadingModelAverageTest::MAX_M_VALUE {1000}
staticconstexprprivate

Maximum value for the m parameter.

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

Referenced by DoRun().

◆ N_MEASUREMENTS

constexpr uint32_t FtrFadingModelAverageTest::N_MEASUREMENTS {100000}
staticconstexprprivate

Number of samples to draw when populating the distribution.

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

Referenced by FtrSquaredNormAverage().

◆ NUM_VALUES

constexpr uint8_t FtrFadingModelAverageTest::NUM_VALUES {3}
staticconstexprprivate

Number of different values for each FTR parameter.

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

Referenced by DoRun().

◆ TOLERANCE

constexpr 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 105 of file two-ray-splm-test-suite.cc.

Referenced by DoRun().


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