Test case for the TwoRaySpectrumPropagationLossModel class. More...
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 |
TestCase & | operator= (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... | |
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 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.
FtrFadingModelAverageTest::FtrFadingModelAverageTest | ( | ) |
Constructor.
Definition at line 114 of file two-ray-splm-test-suite.cc.
|
override |
Destructor.
Definition at line 120 of file two-ray-splm-test-suite.cc.
|
overrideprivatevirtual |
Build the test scenario.
Implements ns3::TestCase.
Definition at line 147 of file two-ray-splm-test-suite.cc.
References two-ray-to-three-gpp-ch-calibration::delta, FtrSquaredNormAverage(), FtrSquaredNormExpectedMean(), two-ray-to-three-gpp-ch-calibration::k, two-ray-to-three-gpp-ch-calibration::m, MAX_M_VALUE, NS_TEST_ASSERT_MSG_EQ_TOL, NUM_VALUES, two-ray-to-three-gpp-ch-calibration::sigma, and TOLERANCE.
|
private |
Compute the average of the FTR squared norm.
[in] | ftrParams | The FTR parameters. |
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().
|
constexprprivate |
Compute the expected mean of the FTR squared norm.
The expected mean can be computed as , where: is the variance of the Gaussian distributed random variables which model the real and complex component of the specular terms and and are the constant amplitudes of the reflected components.รน In turn, this equals to .
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.
[in] | sigma | The sigma parameter of the FTR model. |
[in] | k | The k parameter of the FTR model. |
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().
|
staticconstexprprivate |
Maximum value for the m parameter.
Definition at line 111 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
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().
|
staticconstexprprivate |
Number of different values for each FTR parameter.
Definition at line 108 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
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().