25 #include <ns3/object.h>
26 #include <ns3/spectrum-interference.h>
27 #include <ns3/spectrum-error-model.h>
30 #include <ns3/simulator.h>
31 #include <ns3/packet.h>
34 #include "ns3/radio-bearer-stats-calculator.h"
35 #include <ns3/buildings-mobility-model.h>
36 #include <ns3/buildings-propagation-loss-model.h>
37 #include <ns3/eps-bearer.h>
38 #include <ns3/node-container.h>
39 #include <ns3/mobility-helper.h>
40 #include <ns3/net-device-container.h>
41 #include <ns3/lte-ue-net-device.h>
42 #include <ns3/lte-enb-net-device.h>
43 #include <ns3/lte-ue-rrc.h>
44 #include <ns3/lte-helper.h>
45 #include "ns3/string.h"
46 #include "ns3/double.h"
47 #include <ns3/lte-enb-phy.h>
48 #include <ns3/lte-ue-phy.h>
49 #include <ns3/boolean.h>
50 #include <ns3/rr-ff-mac-scheduler.h>
51 #include <ns3/pf-ff-mac-scheduler.h>
52 #include <ns3/pointer.h>
55 #include "lte-test-mimo.h"
63 LenaTestMimoSuite::LenaTestMimoSuite ()
64 : TestSuite (
"lte-mimo", SYSTEM)
73 std::vector<uint32_t> estThrDl;
74 estThrDl.push_back (119100);
75 estThrDl.push_back (183600);
76 estThrDl.push_back (193400);
77 AddTestCase (
new LenaMimoTestCase(300, estThrDl,
"ns3::RrFfMacScheduler",
true), TestCase::QUICK);
78 AddTestCase (
new LenaMimoTestCase(300, estThrDl,
"ns3::PfFfMacScheduler",
true), TestCase::QUICK);
79 AddTestCase (
new LenaMimoTestCase(300, estThrDl,
"ns3::RrFfMacScheduler",
false), TestCase::QUICK);
80 AddTestCase (
new LenaMimoTestCase(300, estThrDl,
"ns3::PfFfMacScheduler",
false), TestCase::QUICK);
84 static LenaTestMimoSuite lenaTestMimoSuite;
87 LenaMimoTestCase::BuildNameString (uint16_t dist, std::string schedulerType,
bool useIdealRrc)
89 std::ostringstream oss;
90 oss <<
" UE distance " << dist <<
" m" <<
" Scheduler " << schedulerType;
102 LenaMimoTestCase::LenaMimoTestCase (uint16_t dist, std::vector<uint32_t> estThrDl, std::string schedulerType,
bool useIdealRrc)
103 : TestCase (BuildNameString (dist, schedulerType, useIdealRrc)),
105 m_estThrDl (estThrDl),
106 m_schedulerType (schedulerType),
107 m_useIdealRrc (useIdealRrc)
111 LenaMimoTestCase::~LenaMimoTestCase ()
135 lteHelper->SetAttribute (
"PathlossModel",
StringValue (
"ns3::HybridBuildingsPropagationLossModel"));
136 lteHelper->SetPathlossModelAttribute (
"ShadowSigmaOutdoor",
DoubleValue (0.0));
137 lteHelper->SetPathlossModelAttribute (
"ShadowSigmaIndoor",
DoubleValue (0.0));
138 lteHelper->SetPathlossModelAttribute (
"ShadowSigmaExtWalls",
DoubleValue (0.0));
158 lteHelper->SetSchedulerType (m_schedulerType);
159 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
160 ueDevs = lteHelper->InstallUeDevice (ueNodes);
163 lteHelper->Attach (ueDevs, enbDevs.
Get (0));
168 lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
173 enbPhy->SetAttribute (
"TxPower",
DoubleValue (46.0));
174 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
176 mmenb->SetPosition (
Vector (0.0, 0.0, 30.0));
180 mmue->SetPosition (
Vector (m_dist, 0.0, 1.0));
183 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
184 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
187 lteHelper->EnableRlcTraces ();
188 lteHelper->EnableMacTraces ();
189 double simulationTime = 0.6;
190 double tolerance = 0.1;
196 enbNetDev->GetAttribute (
"FfMacScheduler", ptrval);
199 if (m_schedulerType.compare (
"ns3::RrFfMacScheduler") == 0)
209 else if (m_schedulerType.compare (
"ns3::PfFfMacScheduler") == 0)
230 double sampleTime = 0.199999;
231 for (uint8_t j = 0; j < m_estThrDl.size (); j ++)
233 NS_LOG_INFO (
"\t test with user at distance " << m_dist <<
" time " << sampleTime);
246 for (uint8_t i = 0; i < m_estThrDl.size (); i++)
248 NS_LOG_INFO (
"interval " << i + 1 <<
": bytes rxed " << (
double)m_dlDataRxed.at (i) <<
" ref " << m_estThrDl.at (i));
249 NS_TEST_ASSERT_MSG_EQ_TOL ((
double)m_dlDataRxed.at (i) , m_estThrDl.at (i), m_estThrDl.at (i) * tolerance,
" Unfair Throughput!");
258 m_dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Implements the SCHED SAP and CSCHED SAP for a Proportional Fair scheduler.
#define NS_LOG_COMPONENT_DEFINE(name)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
#define NS_FATAL_ERROR(msg)
fatal error handling
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
hold variables of type 'enum'
hold objects of type ns3::Time
Buildings mobility model.
holds a vector of ns3::NetDevice pointers
static void Destroy(void)
void SetDefault(std::string name, const AttributeValue &value)
keep track of a set of node pointers.
hold objects of type Ptr<T>
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
Helper class used to assign positions and mobility models to nodes.
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler.
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
virtual void DoRun(void)
Implementation to actually run this test case.
std::string GetName(void) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Hold an floating point type.
Ptr< T > GetObject(void) const