23 #include "ns3/simulator.h"
25 #include "ns3/string.h"
26 #include "ns3/double.h"
28 #include "ns3/boolean.h"
29 #include <ns3/pointer.h>
30 #include "ns3/mobility-helper.h"
31 #include "ns3/lte-helper.h"
32 #include "ns3/ff-mac-scheduler.h"
34 #include "ns3/lte-enb-phy.h"
35 #include "ns3/lte-enb-net-device.h"
37 #include "ns3/lte-ue-phy.h"
38 #include "ns3/lte-ue-net-device.h"
42 #include <ns3/lte-chunk-processor.h>
45 #include "ns3/spectrum-value.h"
46 #include "ns3/lte-spectrum-value-helper.h"
60 :
TestSuite (
"lte-interference-fr", SYSTEM)
87 m_expectedDlSinrDb (10 * std::log10 (dlSinr))
133 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
135 positionAlloc->
Add (Vector (0.0,
m_d1, 0.0));
136 positionAlloc->
Add (Vector (
m_d2, 0.0, 0.0));
138 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
139 mobility.SetPositionAllocator (positionAlloc);
164 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
165 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
180 testDlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
186 testUlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
194 testDlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
200 testUlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
204 Simulator::Stop (
Seconds (0.200));
208 for (uint32_t i = 0; i < 12; i++)
210 double dlSinr1 = dlSinr1Catcher.
GetValue ()->operator[] (i);
211 double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
215 double dlSinr2 = dlSinr2Catcher.
GetValue ()->operator[] (i);
219 for (uint32_t i = 12; i < 24; i++)
221 double dlSinr1 = dlSinr1Catcher.
GetValue ()->operator[] (i);
224 double dlSinr2 = dlSinr2Catcher.
GetValue ()->operator[] (i);
225 double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
238 Simulator::Destroy ();
242 double commonDlSinr,
double commonUlSinr,
double edgeDlSinr,
double edgeUlSinr,
243 uint32_t rspqThreshold)
247 m_commonDlSinrDb (10 * std::log10 (commonDlSinr)),
248 m_edgeDlSinrDb (10 * std::log10 (edgeDlSinr)),
249 m_rspqThreshold (rspqThreshold)
251 NS_LOG_INFO (
"Creating LteInterferenceFrTestCase");
301 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
304 positionAlloc->
Add (Vector (0.0,
m_d1, 0.0));
305 positionAlloc->
Add (Vector (0.5 *
m_d2, 0.0, 0.0));
307 positionAlloc->
Add (Vector (
m_d2, 0.0, 0.0));
308 positionAlloc->
Add (Vector (0.5 *
m_d2,
m_d1, 0.0));
311 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
312 mobility.SetPositionAllocator (positionAlloc);
340 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
341 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
356 testDlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
362 testUlSinr1->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
370 testDlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
376 testUlSinr2->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
380 Simulator::Stop (
Seconds (2.000));
384 for (uint32_t i = 0; i < 12; i++)
386 double dlSinr1 = dlSinr1Catcher.
GetValue ()->operator[] (i);
387 double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
391 double dlSinr2 = dlSinr2Catcher.
GetValue ()->operator[] (i);
392 double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
396 for (uint32_t i = 12; i < 18; i++)
398 double dlSinr1 = dlSinr1Catcher.
GetValue ()->operator[] (i);
399 double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
403 double dlSinr2 = dlSinr2Catcher.
GetValue ()->operator[] (i);
407 for (uint32_t i = 18; i < 24; i++)
409 double dlSinr1 = dlSinr1Catcher.
GetValue ()->operator[] (i);
412 double dlSinr2 = dlSinr2Catcher.
GetValue ()->operator[] (i);
413 double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
427 Simulator::Destroy ();