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>
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),
222 double samplingInterval = 0.001;
226 Time t = Seconds (time);
228 time += samplingInterval;
230 Simulator::Stop (Seconds (10.1));
232 Simulator::Destroy ();
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]));
Simulation virtual time values and global simulation resolution.
Ptr< BuildingsMobilityModel > m_node2
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
std::vector< SpectrumValue > m_fadingSamples
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
std::vector< BandInfo > Bands
Ptr< TraceFadingLossModel > m_fadingModule
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
static LteFadingTestSuite lteFadingTestSuite
virtual void DoRun(void)
Implementation to actually run this TestCase.
double fc
center frequency
LteFadingTestSuite()
Test 1.1 Fading compound test.
holds a vector of ns3::NetDevice pointers
Ptr< SpectrumValue > CalcRxPowerSpectralDensity(Ptr< const SpectrumValue > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method is to be called to calculate.
double fl
lower limit of subband
keep track of a set of node pointers.
Ptr< BuildingsMobilityModel > m_node1
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())
virtual ~LteFadingTestCase()
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
NetDeviceContainer InstallUeDevice(NodeContainer c)
create a set of UE devices
Helper class used to assign positions and mobility models to nodes.
Ptr< Node > 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)
TestCase.
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
void SetAttribute(std::string name, const AttributeValue &value)
The building block of a SpectrumModel.
Ptr< T > GetObject(void) const
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.