5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-system-test-schedulers-ofdma-mr.cc
Go to the documentation of this file.
1// Copyright (c) 2018 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
6
7#include "ns3/test.h"
8
9#include <map>
10
11using namespace ns3;
12
32class NrSystemTestSchedulerOfdmaMrSuite : public TestSuite
33{
34 public:
38 NrSystemTestSchedulerOfdmaMrSuite();
39};
40
41NrSystemTestSchedulerOfdmaMrSuite::NrSystemTestSchedulerOfdmaMrSuite()
42 : TestSuite("nr-system-test-schedulers-ofdma-mr", Type::SYSTEM)
43{
44 enum TxMode
45 {
46 DL,
47 UL,
48 DL_UL
49 };
50
51 std::list<std::string> subdivision = {
52 "Ofdma",
53 };
54 std::list<std::string> scheds = {"MR"};
55 std::list<TxMode> mode = {DL, UL, DL_UL};
56 std::list<uint32_t> uesPerBeamList = {1, 2, 4, 8};
57 std::map<uint32_t, Duration> durationForUesPerBeam = {
58 {1, Duration::QUICK},
59 {2, Duration::QUICK},
60 {4, Duration::EXTENSIVE},
61 {8, Duration::EXTENSIVE},
62 };
63 std::list<uint32_t> beams = {1, 2};
64 std::list<uint32_t> numerologies = {
65 0,
66 1,
67 }; // Test only num 0 and 1
68
69 for (const auto& num : numerologies)
70 {
71 for (const auto& subType : subdivision)
72 {
73 for (const auto& sched : scheds)
74 {
75 for (const auto& modeType : mode)
76 {
77 for (const auto& uesPerBeam : uesPerBeamList)
78 {
79 for (const auto& beam : beams)
80 {
81 std::stringstream ss;
82 std::stringstream schedName;
83 if (modeType == DL)
84 {
85 ss << "DL";
86 }
87 else if (modeType == UL)
88 {
89 ss << "UL";
90 }
91 else
92 {
93 ss << "DL_UL";
94 }
95 ss << ", Num " << num << ", " << subType << " " << sched << ", "
96 << uesPerBeam << " UE per beam, " << beam << " beam";
97 const bool isDl = modeType == DL || modeType == DL_UL;
98 const bool isUl = modeType == UL || modeType == DL_UL;
99
100 schedName << "ns3::NrMacScheduler" << subType << sched;
101
102 AddTestCase(new SystemSchedulerTest(ss.str(),
103 uesPerBeam,
104 beam,
105 num,
106 20e6,
107 isDl,
108 isUl,
109 schedName.str()),
110 durationForUesPerBeam.at(uesPerBeam));
111 }
112 }
113 }
114 }
115 }
116 }
117}
118
119// Do not forget to allocate an instance of this TestSuite
120static NrSystemTestSchedulerOfdmaMrSuite mmwaveTestSuite;
Main class for testing a scheduler, system-wise.
@ DL
DL CTRL + DL DATA.
@ UL
UL DATA + UL CTRL.
This test case checks if the throughput obtained per UE is as expected for the specified scheduling l...