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-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>
48 #include "lte-test-sinr-chunk-processor.h"
111 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
112 lteHelper->
Attach (hueDevs, henbDevs.
Get (0));
116 double distance = 2000;
121 mm1->SetPosition (Vector (0.0, 0.0, hb));
124 mm2->SetPosition (Vector (distance, 0.0, hm));
139 :
TestCase (
"FADING calculation: " + name),
221 double samplingInterval = 0.001;
227 time += samplingInterval;
229 Simulator::Stop (
Seconds (10.1));
231 Simulator::Destroy ();
235 std::vector<double> sum (rbNum);
236 std::vector<double> sumSquared (rbNum);
237 for (
int i = 0; i < rbNum; i++)
240 sumSquared.at (i) = 0.;
242 for (std::vector<SpectrumValue>::size_type i = 0; i !=
m_fadingSamples.size (); i++)
245 time += samplingInterval;
246 for (
int j = 0; j < rbNum; j++)
254 for (
int i = 0; i < rbNum; i++)
257 double sigma = sqrt(sumSquared.at (i)/
m_fadingSamples.size () - (mean*mean));
258 NS_LOG_INFO (
" Mean " << mean <<
" sigma " << sigma);
276 bands.push_back (bi);
281 bands.push_back (bi);
283 sm = Create<SpectrumModel> (bands);
293 (*outPsd1)[0] = (10 * std::log10 (180000*(*outPsd1)[0])) - (10 * std::log10 (180000*(*inPsd1)[0]));
294 (*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 eNodeB devices.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
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.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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()
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.
Time Seconds(double value)
Construct a Time in the indicated unit.
const double m2
Second component modulus, 232 - 22853.
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
const double m1
First component modulus, 232 - 209.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
The building block of a SpectrumModel.