Test case for the ThreeGppChannelModel class. More...
Public Member Functions | |
ThreeGppChannelMatrixComputationTest (uint32_t txAntennaElements=2, uint32_t rxAntennaElements=2, uint32_t txPorts=1, uint32_t rxPorts=1) | |
Constructor. More... | |
~ThreeGppChannelMatrixComputationTest () 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 | DoComputeNorm (Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > txAntenna, Ptr< PhasedArrayModel > rxAntenna) |
Compute the Frobenius norm of the channel matrix and stores it in m_normVector. More... | |
void | DoRun () override |
Build the test scenario. More... | |
Private Attributes | |
std::vector< double > | m_normVector |
each element is the norm of a channel realization More... | |
uint32_t | m_rxAntennaElements {4} |
number of rows and columns of rx antenna array More... | |
uint32_t | m_rxPorts {1} |
number of horizontal and vertical ports of rx antenna array More... | |
uint32_t | m_txAntennaElements {4} |
number of rows and columns of tx antenna array More... | |
uint32_t | m_txPorts {1} |
number of horizontal and vertical ports of tx antenna array 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 ThreeGppChannelModel class.
1) check if the channel matrix has the correct dimensions 2) check if the channel matrix is correctly normalized
Definition at line 54 of file three-gpp-channel-test-suite.cc.
ThreeGppChannelMatrixComputationTest::ThreeGppChannelMatrixComputationTest | ( | uint32_t | txAntennaElements = 2 , |
uint32_t | rxAntennaElements = 2 , |
||
uint32_t | txPorts = 1 , |
||
uint32_t | rxPorts = 1 |
||
) |
Constructor.
txAntennaElements | the number of rows and columns of the antenna array of the transmitter |
rxAntennaElements | the number of rows and columns of the antenna array of |
txPorts | the number of vertical and horizontal ports of the antenna array of the transmitter |
rxPorts | the number of vertical and horizontal ports of the antenna array of the receiver |
Definition at line 104 of file three-gpp-channel-test-suite.cc.
References m_rxAntennaElements, m_rxPorts, m_txAntennaElements, and m_txPorts.
|
override |
Destructor.
Definition at line 117 of file three-gpp-channel-test-suite.cc.
|
private |
Compute the Frobenius norm of the channel matrix and stores it in m_normVector.
channelModel | the ThreeGppChannelModel object used to generate the channel matrix |
txMob | the mobility model of the first node |
rxMob | the mobility model of the second node |
txAntenna | the antenna object associated to the first node |
rxAntenna | the antenna object associated to the second node |
Definition at line 122 of file three-gpp-channel-test-suite.cc.
References ns3::PhasedArrayModel::GetNumElems(), ns3::ValArray< T >::GetNumPages(), ns3::MatrixBasedChannelModel::ChannelMatrix::m_channel, and m_normVector.
Referenced by DoRun().
|
overrideprivatevirtual |
Build the test scenario.
Implements ns3::TestCase.
Definition at line 153 of file three-gpp-channel-test-suite.cc.
References ns3::Node::AddDevice(), ns3::Object::AggregateObject(), ns3::NodeContainer::Create(), DoComputeNorm(), ns3::NodeContainer::Get(), ns3::ValArray< T >::GetNumCols(), ns3::ValArray< T >::GetNumRows(), ns3::MatrixBasedChannelModel::ChannelMatrix::m_channel, m_normVector, m_rxAntennaElements, m_rxPorts, m_txAntennaElements, m_txPorts, ns3::MilliSeconds(), nodes, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_EQ_TOL, and ns3::MobilityModel::SetPosition().
|
private |
each element is the norm of a channel realization
Definition at line 97 of file three-gpp-channel-test-suite.cc.
Referenced by DoComputeNorm(), and DoRun().
|
private |
number of rows and columns of rx antenna array
Definition at line 99 of file three-gpp-channel-test-suite.cc.
Referenced by ThreeGppChannelMatrixComputationTest(), and DoRun().
|
private |
number of horizontal and vertical ports of rx antenna array
Definition at line 101 of file three-gpp-channel-test-suite.cc.
Referenced by ThreeGppChannelMatrixComputationTest(), and DoRun().
|
private |
number of rows and columns of tx antenna array
Definition at line 98 of file three-gpp-channel-test-suite.cc.
Referenced by ThreeGppChannelMatrixComputationTest(), and DoRun().
|
private |
number of horizontal and vertical ports of tx antenna array
Definition at line 100 of file three-gpp-channel-test-suite.cc.
Referenced by ThreeGppChannelMatrixComputationTest(), and DoRun().