21 #include "ns3/simulator.h"
25 #include "ns3/spectrum-test.h"
27 #include "ns3/lte-phy-tag.h"
28 #include "ns3/lte-test-ue-phy.h"
29 #include "ns3/lte-sinr-chunk-processor.h"
31 #include "ns3/lte-test-fading.h"
32 #include <ns3/buildings-propagation-loss-model.h>
33 #include <ns3/node-container.h>
34 #include <ns3/mobility-helper.h>
35 #include <ns3/lte-helper.h>
36 #include <ns3/single-model-spectrum-channel.h>
37 #include "ns3/string.h"
38 #include "ns3/double.h"
39 #include <ns3/building.h>
41 #include <ns3/net-device-container.h>
42 #include <ns3/lte-ue-net-device.h>
43 #include <ns3/lte-enb-net-device.h>
44 #include <ns3/lte-ue-rrc.h>
45 #include <ns3/lte-helper.h>
46 #include <ns3/lte-enb-phy.h>
47 #include <ns3/lte-ue-phy.h>
81 lteHelper->SetAttribute (
"PathlossModel",
StringValue (
"ns3::BuildingsPropagationLossModel"));
105 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
106 ueDevs = lteHelper->InstallUeDevice (ueNodes);
107 henbDevs = lteHelper->InstallEnbDevice (henbNodes);
108 hueDevs = lteHelper->InstallUeDevice (hueNodes);
112 lteHelper->Attach (ueDevs, enbDevs.
Get (0));
113 lteHelper->Attach (hueDevs, henbDevs.
Get (0));
117 double distance = 2000;
122 mm1->SetPosition (
Vector (0.0, 0.0, hb));
125 mm2->SetPosition (
Vector (distance, 0.0, hm));
140 :
TestCase (
"FADING calculation: " + name),
190 m_fadingModule->SetAttribute(
"TraceFilename",
StringValue(
"../../../src/lte/model/fading-traces/fading_trace_EPA_3kmph.fad"));
222 double samplingInterval = 0.001;
226 Time t = Seconds (time);
228 time += samplingInterval;
236 std::vector<double> sum (rbNum);
237 std::vector<double> sumSquared (rbNum);
238 for (
int i = 0; i < rbNum; i++)
241 sumSquared.at (i) = 0.;
246 time += samplingInterval;
247 for (
int j = 0; j < rbNum; j++)
255 for (
int i = 0; i < rbNum; i++)
258 double sigma = sqrt(sumSquared.at (i)/
m_fadingSamples.size () - (mean*mean));
259 NS_LOG_INFO (
" Mean " << mean <<
" sigma " << sigma);
277 bands.push_back (bi);
282 bands.push_back (bi);
284 sm = Create<SpectrumModel> (bands);
294 (*outPsd1)[0] = (10 * std::log10 (180000*(*outPsd1)[0])) - (10 * std::log10 (180000*(*inPsd1)[0]));
295 (*outPsd1)[1] = (10 * std::log10 (180000*(*outPsd1)[1])) - (10 * std::log10 (180000*(*inPsd1)[1]));
NS_LOG_COMPONENT_DEFINE("LteFadingTest")
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
LteFadingTestCase(Ptr< BuildingsMobilityModel > m1, Ptr< BuildingsMobilityModel > m2, double refValue, std::string name)
Ptr< BuildingsMobilityModel > m_node2
Ptr< BuildingsMobilityModel > m_node1
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
std::vector< BandInfo > Bands
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
double fc
center frequency
virtual ~LteFadingTestCase()
holds a vector of ns3::NetDevice pointers
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::vector< SpectrumValue > m_fadingSamples
static void Destroy(void)
double fl
lower limit of subband
keep track of a set of node pointers.
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 child TestCase case to this TestCase.
Helper class used to assign positions and mobility models to nodes.
static LteFadingTestSuite lteFadingTestSuite
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
std::string GetName(void) const
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
double fh
upper limit of subband
Ptr< T > GetObject(void) const
void LogComponentEnable(char const *name, enum LogLevel level)
Ptr< TraceFadingLossModel > m_fadingModule