5G-LENA nr-v3.3-161-gad18933f
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-system-test-schedulers-tdma-rr.cc
Go to the documentation of this file.
1// Copyright (c) 2020 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 NrSystemTestSchedulerTdmaRrDlSuite : public TestSuite
33{
34 public:
38 NrSystemTestSchedulerTdmaRrDlSuite();
39};
40
41NrSystemTestSchedulerTdmaRrDlSuite::NrSystemTestSchedulerTdmaRrDlSuite()
42 : TestSuite("nr-system-test-schedulers-tdma-rr-dl", Type::SYSTEM)
43{
44 std::list<std::string> subdivision = {
45 "Tdma",
46 };
47 std::list<std::string> scheds = {"RR"};
48 std::list<std::string> mode = {
49 "DL",
50 };
51 std::list<uint32_t> uesPerBeamList = {1, 2, 4, 8};
52 std::map<uint32_t, Duration> durationForUesPerBeam = {
53 {1, Duration::QUICK},
54 {2, Duration::QUICK},
55 {4, Duration::EXTENSIVE},
56 {8, Duration::EXTENSIVE},
57 };
58 std::list<uint32_t> beams = {1, 2};
59 std::list<uint32_t> numerologies = {
60 0,
61 1,
62 }; // Test only num 0 and 1
63
64 for (const auto& num : numerologies)
65 {
66 for (const auto& subType : subdivision)
67 {
68 for (const auto& sched : scheds)
69 {
70 for (const auto& modeType : mode)
71 {
72 for (const auto& uesPerBeam : uesPerBeamList)
73 {
74 for (const auto& beam : beams)
75 {
76 std::stringstream ss;
77 std::stringstream schedName;
78 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
79 << sched << ", " << uesPerBeam << " UE per beam, " << beam
80 << " beam";
81 const bool isDl = modeType == "DL" || modeType == "DL_UL";
82 const bool isUl = modeType == "UL" || modeType == "DL_UL";
83
84 schedName << "ns3::NrMacScheduler" << subType << sched;
85
86 AddTestCase(new SystemSchedulerTest(ss.str(),
87 uesPerBeam,
88 beam,
89 num,
90 20e6,
91 isDl,
92 isUl,
93 schedName.str()),
94 durationForUesPerBeam.at(uesPerBeam));
95 }
96 }
97 }
98 }
99 }
100 }
101}
102
103static NrSystemTestSchedulerTdmaRrDlSuite nrSystemTestSchedulerTdmaRrDlSuite;
104
105// ----------------------------------------------------------------------------
106
117class NrSystemTestSchedulerTdmaRrUlSuite : public TestSuite
118{
119 public:
123 NrSystemTestSchedulerTdmaRrUlSuite();
124};
125
126NrSystemTestSchedulerTdmaRrUlSuite::NrSystemTestSchedulerTdmaRrUlSuite()
127 : TestSuite("nr-system-test-schedulers-tdma-rr-ul", Type::SYSTEM)
128{
129 std::list<std::string> subdivision = {
130 "Tdma",
131 };
132 std::list<std::string> scheds = {"RR"};
133 std::list<std::string> mode = {
134 "UL",
135 };
136 std::list<uint32_t> uesPerBeamList = {1, 2, 4, 8};
137 std::list<uint32_t> beams = {1, 2};
138 std::list<uint32_t> numerologies = {
139 0,
140 1,
141 }; // Test only num 0 and 1
142
143 for (const auto& num : numerologies)
144 {
145 for (const auto& subType : subdivision)
146 {
147 for (const auto& sched : scheds)
148 {
149 for (const auto& modeType : mode)
150 {
151 for (const auto& uesPerBeam : uesPerBeamList)
152 {
153 for (const auto& beam : beams)
154 {
155 std::stringstream ss;
156 std::stringstream schedName;
157 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
158 << sched << ", " << uesPerBeam << " UE per beam, " << beam
159 << " beam";
160 const bool isDl = modeType == "DL" || modeType == "DL_UL";
161 const bool isUl = modeType == "UL" || modeType == "DL_UL";
162
163 schedName << "ns3::NrMacScheduler" << subType << sched;
164
165 AddTestCase(new SystemSchedulerTest(ss.str(),
166 uesPerBeam,
167 beam,
168 num,
169 20e6,
170 isDl,
171 isUl,
172 schedName.str()),
173 Duration::QUICK);
174 }
175 }
176 }
177 }
178 }
179 }
180}
181
182static NrSystemTestSchedulerTdmaRrUlSuite nrSystemTestSchedulerTdmaRrUlSuite;
183
184// ----------------------------------------------------------------------------
185
196class NrSystemTestSchedulerTdmaRrDlUlSuite : public TestSuite
197{
198 public:
202 NrSystemTestSchedulerTdmaRrDlUlSuite();
203};
204
205NrSystemTestSchedulerTdmaRrDlUlSuite::NrSystemTestSchedulerTdmaRrDlUlSuite()
206 : TestSuite("nr-system-test-schedulers-tdma-rr-dl-ul", Type::SYSTEM)
207{
208 std::list<std::string> subdivision = {
209 "Tdma",
210 };
211 std::list<std::string> scheds = {"RR"};
212 std::list<std::string> mode = {
213 "DL_UL",
214 };
215 std::list<uint32_t> uesPerBeamList = {8};
216 std::list<uint32_t> beams = {
217 2,
218 };
219 std::list<uint32_t> numerologies = {
220 0,
221 }; // Test only num 0 and 1
222
223 for (const auto& num : numerologies)
224 {
225 for (const auto& subType : subdivision)
226 {
227 for (const auto& sched : scheds)
228 {
229 for (const auto& modeType : mode)
230 {
231 for (const auto& uesPerBeam : uesPerBeamList)
232 {
233 for (const auto& beam : beams)
234 {
235 std::stringstream ss;
236 std::stringstream schedName;
237 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
238 << sched << ", " << uesPerBeam << " UE per beam, " << beam
239 << " beam";
240 const bool isDl = modeType == "DL" || modeType == "DL_UL";
241 const bool isUl = modeType == "UL" || modeType == "DL_UL";
242
243 schedName << "ns3::NrMacScheduler" << subType << sched;
244
245 AddTestCase(new SystemSchedulerTest(ss.str(),
246 uesPerBeam,
247 beam,
248 num,
249 20e6,
250 isDl,
251 isUl,
252 schedName.str()),
253 Duration::QUICK);
254 }
255 }
256 }
257 }
258 }
259 }
260}
261
262static NrSystemTestSchedulerTdmaRrDlUlSuite nrSystemTestSchedulerTdmaRrDlUlSuite;
263
264// ----------------------------------------------------------------------------
Main class for testing a scheduler, system-wise.
This test case checks if the throughput obtained per UE is as expected for the specified scheduling l...