21 #include "ns3/simulator.h" 23 #include "ns3/spectrum-test.h" 24 #include "ns3/lte-phy-tag.h" 25 #include "ns3/lte-test-ue-phy.h" 26 #include "ns3/lte-chunk-processor.h" 27 #include "ns3/lte-test-fading.h" 28 #include <ns3/buildings-propagation-loss-model.h> 29 #include <ns3/node-container.h> 30 #include <ns3/mobility-helper.h> 31 #include <ns3/lte-helper.h> 32 #include <ns3/single-model-spectrum-channel.h> 33 #include "ns3/string.h" 34 #include "ns3/double.h" 35 #include <ns3/building.h> 37 #include <ns3/net-device-container.h> 38 #include <ns3/lte-ue-net-device.h> 39 #include <ns3/lte-enb-net-device.h> 40 #include <ns3/lte-ue-rrc.h> 41 #include <ns3/lte-enb-phy.h> 42 #include <ns3/lte-ue-phy.h> 43 #include "lte-test-sinr-chunk-processor.h" 86 mobility.SetMobilityModel (
"ns3::BuildingsMobilityModel");
103 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
104 lteHelper->
Attach (hueDevs, henbDevs.
Get (0));
108 double distance = 2000;
113 mm1->SetPosition (Vector (0.0, 0.0, hb));
116 mm2->SetPosition (Vector (distance, 0.0, hm));
131 :
TestCase (
"FADING calculation: " + name),
213 double samplingInterval = 0.001;
219 time += samplingInterval;
221 Simulator::Stop (
Seconds (10.1));
223 Simulator::Destroy ();
227 std::vector<double> sum (rbNum);
228 std::vector<double> sumSquared (rbNum);
229 for (
int i = 0; i < rbNum; i++)
232 sumSquared.at (i) = 0.;
234 for (std::vector<SpectrumValue>::size_type i = 0; i !=
m_fadingSamples.size (); i++)
237 time += samplingInterval;
238 for (
int j = 0; j < rbNum; j++)
246 for (
int i = 0; i < rbNum; i++)
249 double sigma = sqrt(sumSquared.at (i)/
m_fadingSamples.size () - (mean*mean));
250 NS_LOG_INFO (
" Mean " << mean <<
" sigma " << sigma);
268 bands.push_back (bi);
273 bands.push_back (bi);
275 sm = Create<SpectrumModel> (bands);
285 (*outPsd1)[0] = (10 * std::log10 (180000*(*outPsd1)[0])) - (10 * std::log10 (180000*(*inPsd1)[0]));
286 (*outPsd1)[1] = (10 * std::log10 (180000*(*outPsd1)[1])) - (10 * std::log10 (180000*(*inPsd1)[1]));
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Simulation virtual time values and global simulation resolution.
Ptr< BuildingsMobilityModel > m_node2
building mobility model #2
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Hold variables of type string.
std::vector< SpectrumValue > m_fadingSamples
fading samples
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.
const double m1
First component modulus, 232 - 209.
std::vector< BandInfo > Bands
Container of BandInfo.
Ptr< TraceFadingLossModel > m_fadingModule
fading loss model
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
static LteFadingTestSuite lteFadingTestSuite
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
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< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
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
building mobility model #1
Fading test case is checking if the pathloss between macro and UE is equal to the theoretical value w...
virtual ~LteFadingTestCase()
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
std::string GetName(void) const
Ptr< SpectrumValue > CalcRxPowerSpectralDensity(Ptr< const SpectrumValue > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method is to be called to calculate.
Time Seconds(double value)
Construct a Time in the indicated unit.
LteFadingTestCase(Ptr< BuildingsMobilityModel > m1, Ptr< BuildingsMobilityModel > m2, double refValue, std::string name)
Lte Fading Test Case function.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
const double m2
Second component modulus, 232 - 22853.
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)
Set a single attribute, raising fatal errors if unsuccessful.
The building block of a SpectrumModel.
double m_lossRef
loss reference