22 #include "ns3/double.h"
23 #include "ns3/radio-bearer-stats-calculator.h"
24 #include "ns3/string.h"
25 #include <ns3/boolean.h>
26 #include <ns3/buildings-helper.h>
27 #include <ns3/buildings-propagation-loss-model.h>
29 #include <ns3/eps-bearer.h>
31 #include <ns3/lte-enb-net-device.h>
32 #include <ns3/lte-enb-phy.h>
33 #include <ns3/lte-helper.h>
34 #include <ns3/lte-ue-net-device.h>
35 #include <ns3/lte-ue-phy.h>
36 #include <ns3/lte-ue-rrc.h>
37 #include <ns3/mobility-building-info.h>
38 #include <ns3/mobility-helper.h>
39 #include <ns3/net-device-container.h>
40 #include <ns3/node-container.h>
41 #include <ns3/object.h>
42 #include <ns3/packet.h>
43 #include <ns3/pf-ff-mac-scheduler.h>
44 #include <ns3/pointer.h>
46 #include <ns3/rr-ff-mac-scheduler.h>
47 #include <ns3/simulator.h>
48 #include <ns3/spectrum-error-model.h>
49 #include <ns3/spectrum-interference.h>
70 std::vector<uint32_t> estThrDl;
71 estThrDl.push_back(119100);
72 estThrDl.push_back(183600);
73 estThrDl.push_back(193400);
93 std::ostringstream oss;
94 oss <<
" UE distance " << dist <<
" m"
95 <<
" Scheduler " << schedulerType;
108 std::vector<uint32_t> estThrDl,
109 std::string schedulerType,
111 :
TestCase(BuildNameString(dist, schedulerType, useIdealRrc)),
113 m_estThrDl(estThrDl),
114 m_schedulerType(schedulerType),
115 m_useIdealRrc(useIdealRrc)
153 StringValue(
"ns3::HybridBuildingsPropagationLossModel"));
168 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
170 BuildingsHelper::Install(enbNodes);
171 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
173 BuildingsHelper::Install(ueNodes);
183 lteHelper->
Attach(ueDevs, enbDevs.
Get(0));
192 enbPhy->SetAttribute(
"TxPower",
DoubleValue(46.0));
193 enbPhy->SetAttribute(
"NoiseFigure",
DoubleValue(5.0));
203 uePhy->SetAttribute(
"NoiseFigure",
DoubleValue(9.0));
208 double simulationTime = 0.6;
209 double tolerance = 0.1;
215 enbNetDev->
GetCcMap()[0]->GetAttribute(
"FfMacScheduler", ptrval);
225 Simulator::Schedule(
Seconds(0.2),
226 &RrFfMacScheduler::TransmissionModeConfigurationUpdate,
230 Simulator::Schedule(
Seconds(0.4),
231 &RrFfMacScheduler::TransmissionModeConfigurationUpdate,
244 Simulator::Schedule(
Seconds(0.2),
245 &PfFfMacScheduler::TransmissionModeConfigurationUpdate,
249 Simulator::Schedule(
Seconds(0.4),
250 &PfFfMacScheduler::TransmissionModeConfigurationUpdate,
264 double sampleTime = 0.199999;
265 for (std::size_t j = 0; j <
m_estThrDl.size(); j++)
267 NS_LOG_INFO(
"\t test with user at distance " <<
m_dist <<
" time " << sampleTime);
275 Simulator::Stop(
Seconds(simulationTime));
277 Simulator::Destroy();
280 for (std::size_t i = 0; i <
m_estThrDl.size(); i++)
287 " Unfair Throughput!");
296 m_dlDataRxed.push_back(rlcStats->GetDlRxData(imsi, lcId));
This system test program creates different test cases with a single eNB and single UE.
void DoRun() override
Implementation to actually run this TestCase.
~LenaMimoTestCase() override
void GetRlcBufferSample(Ptr< RadioBearerStatsCalculator > rlcStats, uint64_t imsi, uint8_t rnti)
Get RLC buffer sample.
std::string m_schedulerType
the scheduler type
LenaMimoTestCase(uint16_t dist, std::vector< uint32_t > estThrDl, std::string schedulerType, bool useIdealRrc)
Constructor.
bool m_useIdealRrc
whether to use the ideal RRC
std::vector< uint64_t > m_dlDataRxed
DL data received.
std::vector< uint32_t > m_estThrDl
estimated throughput DL
uint16_t m_dist
the distance
static std::string BuildNameString(uint16_t dist, std::string schedulerType, bool useIdealRrc)
Builds the test name string based on provided parameter values.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
This class contains the specification of EPS Bearers.
The eNodeB device implementation.
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > GetCcMap() const
Ptr< LteEnbPhy > GetPhy() const
Ptr< RadioBearerStatsCalculator > GetRlcStats()
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
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 SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
void EnableRlcTraces()
Enable trace sinks for RLC layer.
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.
void EnableMacTraces()
Enable trace sinks for MAC layer.
The LteUeNetDevice class implements the UE net device.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
holds a vector of ns3::NetDevice pointers
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.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Implements the SCHED SAP and CSCHED SAP for a Proportional Fair scheduler.
Hold objects of type Ptr<T>.
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
std::string GetName() const
Simulation virtual time values and global simulation resolution.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static LenaTestMimoSuite lenaTestMimoSuite
Static variable for test initialization.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.