5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-system-test-schedulers-tdma-pf.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
5
6#include "ns3/test.h"
7
8#include <map>
9
10using namespace ns3;
11
31class NrSystemTestSchedulerTdmaPfSuite : public TestSuite
32{
33 public:
37 NrSystemTestSchedulerTdmaPfSuite();
38};
39
40NrSystemTestSchedulerTdmaPfSuite::NrSystemTestSchedulerTdmaPfSuite()
41 : TestSuite("nr-system-test-schedulers-tdma-pf", Type::SYSTEM)
42{
43 enum TxMode
44 {
45 DL,
46 UL,
47 DL_UL
48 };
49
50 std::list<std::string> subdivision = {
51 "Tdma",
52 };
53 std::list<std::string> scheds = {"PF"};
54 std::list<TxMode> mode = {DL, UL, DL_UL};
55 std::list<uint32_t> uesPerBeamList = {1, 2, 4, 8};
56 std::map<uint32_t, Duration> durationForUesPerBeam = {
57 {1, Duration::QUICK},
58 {2, Duration::QUICK},
59 {4, Duration::EXTENSIVE},
60 {8, Duration::EXTENSIVE},
61 };
62 std::list<uint32_t> beams = {1, 2};
63 std::list<uint32_t> numerologies = {
64 0,
65 1,
66 }; // Test only num 0 and 1
67
68 for (const auto& num : numerologies)
69 {
70 for (const auto& subType : subdivision)
71 {
72 for (const auto& sched : scheds)
73 {
74 for (const auto& modeType : mode)
75 {
76 for (const auto& uesPerBeam : uesPerBeamList)
77 {
78 for (const auto& beam : beams)
79 {
80 std::stringstream ss;
81 std::stringstream schedName;
82 if (modeType == DL)
83 {
84 ss << "DL";
85 }
86 else if (modeType == UL)
87 {
88 ss << "UL";
89 }
90 else
91 {
92 ss << "DL_UL";
93 }
94 ss << ", Num " << num << ", " << subType << " " << sched << ", "
95 << uesPerBeam << " UE per beam, " << beam << " beam";
96 const bool isDl = modeType == DL || modeType == DL_UL;
97 const bool isUl = modeType == UL || modeType == DL_UL;
98
99 schedName << "ns3::NrMacScheduler" << subType << sched;
100
101 AddTestCase(new SystemSchedulerTest(ss.str(),
102 uesPerBeam,
103 beam,
104 num,
105 20e6,
106 isDl,
107 isUl,
108 schedName.str()),
109 durationForUesPerBeam.at(uesPerBeam));
110 }
111 }
112 }
113 }
114 }
115 }
116}
117
118// Do not forget to allocate an instance of this TestSuite
119static NrSystemTestSchedulerTdmaPfSuite 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...