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,
150 bool usePdcchForCqiGeneration,
153 :
TestCase(
"Downlink Power Control: " + name),
228 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
229 positionAlloc->Add(Vector(1000, 0.0, 0.0));
230 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
231 positionAlloc->Add(Vector(500, 0.0, 0.0));
233 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
234 mobility.SetPositionAllocator(positionAlloc);
262 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
263 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
271 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
274 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
277 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
280 Config::Connect(
"/NodeList/1/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
283 Simulator::Stop(
Seconds(1.100));
286 Simulator::Destroy();
294 :
TestCase(
"Downlink Power Control: " + name),
371 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
372 positionAlloc->Add(Vector(1000, 0.0, 0.0));
373 positionAlloc->Add(Vector(500.0, 0.0, 0.0));
374 positionAlloc->Add(Vector(500, 0.0, 0.0));
375 positionAlloc->Add(Vector(1050, 0.0, 0.0));
377 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
378 mobility.SetPositionAllocator(positionAlloc);
401 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs1.
Get(0));
402 lteUeMac = lteUeDev->GetMac();
403 lteUeMac->AssignStreams(1);
404 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs2.
Get(0));
405 lteUeMac = lteUeDev->GetMac();
406 lteUeMac->AssignStreams(1);
407 lteUeDev = DynamicCast<LteUeNetDevice>(ueDevs2.
Get(1));
408 lteUeMac = lteUeDev->GetMac();
409 lteUeMac->AssignStreams(2);
412 lteHelper->
Attach(ueDevs1, enbDevs.
Get(0));
413 lteHelper->
Attach(ueDevs2, enbDevs.
Get(1));
422 enbDevs.
Get(0)->GetAttribute(
"LteFfrAlgorithm", tmp);
430 enbDevs.
Get(1)->GetAttribute(
"LteFfrAlgorithm", tmp);
438 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
441 Config::Connect(
"/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
444 Simulator::Stop(
Seconds(1.100));
447 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.
AttributeValue implementation for Boolean.
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.
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)
static LteCqiGenerationTestSuite lteCqiGenerationTestSuite
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
PdschConfigDedicated structure.