Test case for the TwoRaySpectrumPropagationLossModel class. More...
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 |
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 | |
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. | |
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 40 of file two-ray-splm-test-suite.cc.
FtrFadingModelAverageTest::FtrFadingModelAverageTest | ( | ) |
Constructor.
Definition at line 103 of file two-ray-splm-test-suite.cc.
|
override |
Destructor.
Definition at line 109 of file two-ray-splm-test-suite.cc.
|
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.
|
private |
Compute the average of the FTR squared norm.
[in] | ftrParams | The FTR parameters. |
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().
|
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 130 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
staticconstexprprivate |
Maximum value for the m parameter.
Definition at line 100 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().
|
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().
|
staticconstexprprivate |
Number of different values for each FTR parameter.
Definition at line 97 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 94 of file two-ray-splm-test-suite.cc.
Referenced by DoRun().