From 700b02acd406591607b2fff3a124a89bdebdeb87 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Mon, 19 Jun 2017 16:32:05 +0300 Subject: [PATCH] lte: Add variable number of component carriers to LteSecondaryCellSelectionTestCase --- .../test/lte-test-secondary-cell-selection.cc | 17 ++++++++++------- .../test/lte-test-secondary-cell-selection.h | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lte/test/lte-test-secondary-cell-selection.cc b/src/lte/test/lte-test-secondary-cell-selection.cc index 7ab334356..2fdbee179 100644 --- a/src/lte/test/lte-test-secondary-cell-selection.cc +++ b/src/lte/test/lte-test-secondary-cell-selection.cc @@ -55,11 +55,13 @@ LteSecondaryCellSelectionTestSuite::LteSecondaryCellSelectionTestSuite () { // REAL RRC PROTOCOL - AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, real RRC, RngRun=1", false, 1), TestCase::QUICK); + AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, real RRC, RngRun=1", false, 1, 2), TestCase::QUICK); + AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, real RRC, RngRun=1", false, 1, 4), TestCase::QUICK); // IDEAL RRC PROTOCOL - AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, ideal RRC, RngRun=1", true, 1), TestCase::QUICK); + AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, ideal RRC, RngRun=1", true, 1, 2), TestCase::QUICK); + AddTestCase (new LteSecondaryCellSelectionTestCase ("EPC, ideal RRC, RngRun=1", true, 1, 4), TestCase::QUICK); } // end of LteSecondaryCellSelectionTestSuite::LteSecondaryCellSelectionTestSuite () @@ -70,10 +72,11 @@ static LteSecondaryCellSelectionTestSuite g_lteSecondaryCellSelectionTestSuite; */ LteSecondaryCellSelectionTestCase::LteSecondaryCellSelectionTestCase ( - std::string name, bool isIdealRrc, int64_t rngRun) + std::string name, bool isIdealRrc, int64_t rngRun, uint8_t numberOfComponentCarriers) : TestCase (name), m_isIdealRrc (isIdealRrc), - m_rngRun (rngRun) + m_rngRun (rngRun), + m_numberOfComponentCarriers (numberOfComponentCarriers) { NS_LOG_FUNCTION (this << GetName ()); } @@ -95,7 +98,7 @@ LteSecondaryCellSelectionTestCase::DoRun () auto lteHelper = CreateObject (); lteHelper->SetAttribute ("PathlossModel", TypeIdValue (ns3::FriisSpectrumPropagationLossModel::GetTypeId ())); lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (m_isIdealRrc)); - lteHelper->SetAttribute ("NumberOfComponentCarriers", UintegerValue (2)); + lteHelper->SetAttribute ("NumberOfComponentCarriers", UintegerValue (m_numberOfComponentCarriers)); auto epcHelper = CreateObject (); lteHelper->SetEpcHelper (epcHelper); @@ -105,7 +108,7 @@ LteSecondaryCellSelectionTestCase::DoRun () cch->SetDlEarfcn (100); cch->SetUlBandwidth (25); cch->SetDlBandwidth (25); - cch->SetNumberOfComponentCarriers (2); + cch->SetNumberOfComponentCarriers (m_numberOfComponentCarriers); const auto ccm = cch->EquallySpacedCcs (); lteHelper->SetCcPhyParams (ccm); @@ -113,7 +116,7 @@ LteSecondaryCellSelectionTestCase::DoRun () // Create nodes. auto enbNode = CreateObject (); NodeContainer ueNodes; - ueNodes.Create (2); + ueNodes.Create (m_numberOfComponentCarriers); MobilityHelper mobility; mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); diff --git a/src/lte/test/lte-test-secondary-cell-selection.h b/src/lte/test/lte-test-secondary-cell-selection.h index 014c65b86..3ea7a94fc 100644 --- a/src/lte/test/lte-test-secondary-cell-selection.h +++ b/src/lte/test/lte-test-secondary-cell-selection.h @@ -60,8 +60,9 @@ public: * \param isIdealRrc if true, simulation uses Ideal RRC protocol, otherwise * simulation uses Real RRC protocol * \param rngRun the number of run to be used by the random number generator + * \param numberOfComponentCarriers number of component carriers */ - LteSecondaryCellSelectionTestCase (std::string name, bool isIdealRrc, int64_t rngRun); + LteSecondaryCellSelectionTestCase (std::string name, bool isIdealRrc, int64_t rngRun, uint8_t numberOfComponentCarriers); virtual ~LteSecondaryCellSelectionTestCase (); @@ -104,6 +105,7 @@ private: bool m_isIdealRrc; ///< whether the LTE is configured to use ideal RRC int64_t m_rngRun; ///< rng run + uint8_t m_numberOfComponentCarriers; ///< number of component carriers /// The current UE RRC state. std::map m_lastState;