5G-LENA nr-v3.0-32-g83aee33
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/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
8
9#include "ns3/test.h"
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::list<uint32_t> beams = {1, 2};
53 std::list<uint32_t> numerologies = {
54 0,
55 1,
56 }; // Test only num 0 and 1
57
58 for (const auto& num : numerologies)
59 {
60 for (const auto& subType : subdivision)
61 {
62 for (const auto& sched : scheds)
63 {
64 for (const auto& modeType : mode)
65 {
66 for (const auto& uesPerBeam : uesPerBeamList)
67 {
68 for (const auto& beam : beams)
69 {
70 std::stringstream ss;
71 std::stringstream schedName;
72 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
73 << sched << ", " << uesPerBeam << " UE per beam, " << beam
74 << " beam";
75 const bool isDl = modeType == "DL" || modeType == "DL_UL";
76 const bool isUl = modeType == "UL" || modeType == "DL_UL";
77
78 schedName << "ns3::NrMacScheduler" << subType << sched;
79
80 AddTestCase(new SystemSchedulerTest(ss.str(),
81 uesPerBeam,
82 beam,
83 num,
84 20e6,
85 isDl,
86 isUl,
87 schedName.str()),
88 Duration::QUICK);
89 }
90 }
91 }
92 }
93 }
94 }
95}
96
97static NrSystemTestSchedulerTdmaRrDlSuite nrSystemTestSchedulerTdmaRrDlSuite;
98
99// ----------------------------------------------------------------------------
100
111class NrSystemTestSchedulerTdmaRrUlSuite : public TestSuite
112{
113 public:
117 NrSystemTestSchedulerTdmaRrUlSuite();
118};
119
120NrSystemTestSchedulerTdmaRrUlSuite::NrSystemTestSchedulerTdmaRrUlSuite()
121 : TestSuite("nr-system-test-schedulers-tdma-rr-ul", Type::SYSTEM)
122{
123 std::list<std::string> subdivision = {
124 "Tdma",
125 };
126 std::list<std::string> scheds = {"RR"};
127 std::list<std::string> mode = {
128 "UL",
129 };
130 std::list<uint32_t> uesPerBeamList = {1, 2, 4, 8};
131 std::list<uint32_t> beams = {1, 2};
132 std::list<uint32_t> numerologies = {
133 0,
134 1,
135 }; // Test only num 0 and 1
136
137 for (const auto& num : numerologies)
138 {
139 for (const auto& subType : subdivision)
140 {
141 for (const auto& sched : scheds)
142 {
143 for (const auto& modeType : mode)
144 {
145 for (const auto& uesPerBeam : uesPerBeamList)
146 {
147 for (const auto& beam : beams)
148 {
149 std::stringstream ss;
150 std::stringstream schedName;
151 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
152 << sched << ", " << uesPerBeam << " UE per beam, " << beam
153 << " beam";
154 const bool isDl = modeType == "DL" || modeType == "DL_UL";
155 const bool isUl = modeType == "UL" || modeType == "DL_UL";
156
157 schedName << "ns3::NrMacScheduler" << subType << sched;
158
159 AddTestCase(new SystemSchedulerTest(ss.str(),
160 uesPerBeam,
161 beam,
162 num,
163 20e6,
164 isDl,
165 isUl,
166 schedName.str()),
167 Duration::QUICK);
168 }
169 }
170 }
171 }
172 }
173 }
174}
175
176static NrSystemTestSchedulerTdmaRrUlSuite nrSystemTestSchedulerTdmaRrUlSuite;
177
178// ----------------------------------------------------------------------------
179
190class NrSystemTestSchedulerTdmaRrDlUlSuite : public TestSuite
191{
192 public:
196 NrSystemTestSchedulerTdmaRrDlUlSuite();
197};
198
199NrSystemTestSchedulerTdmaRrDlUlSuite::NrSystemTestSchedulerTdmaRrDlUlSuite()
200 : TestSuite("nr-system-test-schedulers-tdma-rr-dl-ul", Type::SYSTEM)
201{
202 std::list<std::string> subdivision = {
203 "Tdma",
204 };
205 std::list<std::string> scheds = {"RR"};
206 std::list<std::string> mode = {
207 "DL_UL",
208 };
209 std::list<uint32_t> uesPerBeamList = {8};
210 std::list<uint32_t> beams = {
211 2,
212 };
213 std::list<uint32_t> numerologies = {
214 0,
215 }; // Test only num 0 and 1
216
217 for (const auto& num : numerologies)
218 {
219 for (const auto& subType : subdivision)
220 {
221 for (const auto& sched : scheds)
222 {
223 for (const auto& modeType : mode)
224 {
225 for (const auto& uesPerBeam : uesPerBeamList)
226 {
227 for (const auto& beam : beams)
228 {
229 std::stringstream ss;
230 std::stringstream schedName;
231 ss << ", Num " << num << ", " << modeType << ", " << subType << " "
232 << sched << ", " << uesPerBeam << " UE per beam, " << beam
233 << " beam";
234 const bool isDl = modeType == "DL" || modeType == "DL_UL";
235 const bool isUl = modeType == "UL" || modeType == "DL_UL";
236
237 schedName << "ns3::NrMacScheduler" << subType << sched;
238
239 AddTestCase(new SystemSchedulerTest(ss.str(),
240 uesPerBeam,
241 beam,
242 num,
243 20e6,
244 isDl,
245 isUl,
246 schedName.str()),
247 Duration::QUICK);
248 }
249 }
250 }
251 }
252 }
253 }
254}
255
256static NrSystemTestSchedulerTdmaRrDlUlSuite nrSystemTestSchedulerTdmaRrDlUlSuite;
257
258// ----------------------------------------------------------------------------
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...