Test case for the TwoRaySpectrumPropagationLossModel class. More...
Public Member Functions | |
FtrFadingModelAverageTest () | |
Constructor. | |
~FtrFadingModelAverageTest () override | |
Destructor. | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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 | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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. | |
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 FtrSquaredNormAverage(), FtrSquaredNormExpectedMean(), MAX_M_VALUE, NS_TEST_ASSERT_MSG_EQ_TOL, NUM_VALUES, 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, and NS_LOG_FUNCTION.
Referenced by DoRun().
|
constexprprivate |
Compute the expected mean of the FTR squared norm.
The expected mean
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.
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().