25 #include "ns3/ff-mac-scheduler.h"
26 #include "ns3/lte-helper.h"
27 #include "ns3/lte-rrc-sap.h"
28 #include "ns3/mobility-helper.h"
29 #include <ns3/boolean.h>
30 #include <ns3/callback.h>
31 #include <ns3/config.h>
32 #include <ns3/double.h>
35 #include <ns3/lte-ue-mac.h>
36 #include <ns3/lte-ue-net-device.h>
37 #include <ns3/pointer.h>
38 #include <ns3/simulator.h>
39 #include <ns3/string.h>
63 testcase->
UlScheduling(frameNo, subframeNo, rnti, mcs, sizeTb);
82 uint8_t componentCarrierId)
84 testcase->
UlScheduling(frameNo, subframeNo, rnti, mcs, sizeTb);
104 LteRrcSap::PdschConfigDedicated::dB0,
105 LteRrcSap::PdschConfigDedicated::dB0,
110 LteRrcSap::PdschConfigDedicated::dB0,
111 LteRrcSap::PdschConfigDedicated::dB_3,
116 LteRrcSap::PdschConfigDedicated::dB0,
117 LteRrcSap::PdschConfigDedicated::dB_6,
122 LteRrcSap::PdschConfigDedicated::dB1,
123 LteRrcSap::PdschConfigDedicated::dB_6,
128 LteRrcSap::PdschConfigDedicated::dB2,
129 LteRrcSap::PdschConfigDedicated::dB_6,
134 LteRrcSap::PdschConfigDedicated::dB3,
135 LteRrcSap::PdschConfigDedicated::dB_6,
140 LteRrcSap::PdschConfigDedicated::dB3,
141 LteRrcSap::PdschConfigDedicated::dB0,
154 bool usePdcchForCqiGeneration,
157 :
TestCase(
"Downlink Power Control: " + name),
232 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
233 positionAlloc->Add(Vector(1000, 0.0, 0.0));
234 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
235 positionAlloc->Add(Vector(500, 0.0, 0.0));
237 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
238 mobility.SetPositionAllocator(positionAlloc);
266 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
267 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
275 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
278 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
281 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
284 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
287 Simulator::Stop(
Seconds(1.100));
290 Simulator::Destroy();
298 :
TestCase(
"Downlink Power Control: " + name),
375 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
376 positionAlloc->Add(Vector(1000, 0.0, 0.0));
377 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
378 positionAlloc->Add(Vector(500, 0.0, 0.0));
379 positionAlloc->Add(Vector(1050, 0.0, 0.0));
381 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
382 mobility.SetPositionAllocator(positionAlloc);
405 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs1.
Get(0));
406 lteUeMac = lteUeDev->GetMac();
407 lteUeMac->AssignStreams(1);
408 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs2.
Get(0));
409 lteUeMac = lteUeDev->GetMac();
410 lteUeMac->AssignStreams(1);
411 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs2.
Get(1));
412 lteUeMac = lteUeDev->GetMac();
413 lteUeMac->AssignStreams(2);
416 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
417 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
426 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
434 enbDevs.
Get(1)->GetAttribute(
"LteFfrAlgorithm", tmp);
442 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
445 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
448 Simulator::Stop(
Seconds(1.100));
451 Simulator::Destroy();
This test is very similar to LteCqiGenerationTestCase.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_cell0Pa
cell #0 PA
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
LteCqiGenerationDlPowerControlTestCase(std::string name, uint8_t cell0Pa, uint8_t cell1Pa, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
~LteCqiGenerationDlPowerControlTestCase() override
uint16_t m_ulMcs
the UL MCS
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
uint16_t m_dlMcs
the DL MCS
uint8_t m_cell1Pa
cell #1 PA
This is the test case for testing different configuration of CQI generation.
void UlScheduling(uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
UL Scheduling function.
~LteCqiGenerationTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_ulMcs
the UL MCS
bool m_usePdschForCqiGeneration
use PDCCH for CQI generation
void DlScheduling(DlSchedulingCallbackInfo dlInfo)
DL Scheduling function.
uint16_t m_dlMcs
the DL MCS
LteCqiGenerationTestCase(std::string name, bool usePdcchForCqiGeneration, uint16_t dlMcs, uint16_t ulMcs)
Constructor.
Lte Cqi Generation Test Suite.
LteCqiGenerationTestSuite()
TestSuite.
Hold variables of type enum.
This class contains the specification of EPS Bearers.
void ChangePdschConfigDedicated(bool change)
Callback function that is used to be connected to trace ChangePdschConfigDedicated.
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Set PDSCH config dedicated function.
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Hold objects of type Ptr<T>.
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
void Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static LteCqiGenerationTestSuite lteCqiGenerationTestSuite
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void LteTestUlSchedulingCallback(LteCqiGenerationTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t ccId)
void LteTestUlSchedulingCallback2(LteCqiGenerationDlPowerControlTestCase *testcase, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb, uint8_t componentCarrierId)
void LteTestDlSchedulingCallback2(LteCqiGenerationDlPowerControlTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
void LteTestDlSchedulingCallback(LteCqiGenerationTestCase *testcase, std::string path, DlSchedulingCallbackInfo dlInfo)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
PdschConfigDedicated structure.