22 #include "ns3/simulator.h"
24 #include "ns3/string.h"
25 #include "ns3/double.h"
27 #include "ns3/boolean.h"
29 #include "ns3/mobility-helper.h"
30 #include "ns3/lte-helper.h"
32 #include "ns3/lte-ue-phy.h"
33 #include "ns3/lte-ue-net-device.h"
34 #include "ns3/lte-enb-phy.h"
35 #include "ns3/lte-enb-net-device.h"
36 #include "ns3/ff-mac-scheduler.h"
38 #include "ns3/lte-global-pathloss-database.h"
51 static std::string BuildNameString (
double orientationDegrees,
double beamwidthDegrees,
double x,
double y);
52 LteEnbAntennaTestCase (
double orientationDegrees,
double beamwidthDegrees,
double x,
double y,
double antennaGainDb);
57 virtual void DoRun (
void);
71 std::ostringstream oss;
72 oss <<
"o=" << orientationDegrees
73 <<
", bw=" << beamwidthDegrees
81 :
TestCase (BuildNameString (orientationDegrees, beamwidthDegrees, x, y)),
82 m_orientationDegrees (orientationDegrees),
83 m_beamwidthDegrees (beamwidthDegrees),
86 m_antennaGainDb (antennaGainDb)
121 positionAlloc->
Add (
Vector (0.0, 0.0, 0.0));
142 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
166 MakeCallback (&DownlinkLteGlobalPathlossDatabase::UpdatePathloss, &dlPathlossDb));
168 MakeCallback (&UplinkLteGlobalPathlossDatabase::UpdatePathloss, &ulPathlossDb));
170 Simulator::Stop (
Seconds (0.035));
173 const double enbTxPowerDbm = 30;
174 const double ueTxPowerDbm = 10;
175 const double ktDbm = -174;
176 const double noisePowerDbm = ktDbm + 10 * std::log10 (25 * 180000);
177 const double ueNoiseFigureDb = 9.0;
178 const double enbNoiseFigureDb = 5.0;
183 double expectedSinrDl = enbTxPowerDbm +
m_antennaGainDb - noisePowerDbm + ueNoiseFigureDb;
184 if (expectedSinrDl > 0)
186 double calculatedSinrDbDl = -INFINITY;
187 if (testDlSinr->GetSinr () != 0)
189 calculatedSinrDbDl = 10.0 * std::log10 (testDlSinr->GetSinr ()->operator[] (0));
192 double calculatedAntennaGainDbDl = - (enbTxPowerDbm - calculatedSinrDbDl - noisePowerDbm - ueNoiseFigureDb);
195 double expectedSinrUl = ueTxPowerDbm +
m_antennaGainDb - noisePowerDbm + enbNoiseFigureDb;
196 if (expectedSinrUl > 0)
198 double calculatedSinrDbUl = -INFINITY;
199 if (testUlSinr->GetSinr () != 0)
201 calculatedSinrDbUl = 10.0 * std::log10 (testUlSinr->GetSinr ()->operator[] (0));
203 double calculatedAntennaGainDbUl = - (ueTxPowerDbm - calculatedSinrDbUl - noisePowerDbm - enbNoiseFigureDb);
209 double measuredLossDl = dlPathlossDb.
GetPathloss (1, 1);
211 double measuredLossUl = ulPathlossDb.
GetPathloss (1, 1);
215 Simulator::Destroy ();
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the pathloss model to be created
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
virtual ~LteEnbAntennaTestCase()
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
double m_beamwidthDegrees
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
void Connect(std::string path, const CallbackBase &cb)
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
void SetSchedulerType(std::string type)
This class contains the specification of EPS Bearers.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
hold variables of type 'enum'
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
set an attribute for the scheduler to be created
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
void SetEnbAntennaModelType(std::string type)
double m_orientationDegrees
void SetDefault(std::string name, const AttributeValue &value)
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())
static std::string BuildNameString(double orientationDegrees, double beamwidthDegrees, double x, double y)
double GetPathloss(uint16_t cellId, uint64_t imsi)
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.
static LteAntennaTestSuite lteAntennaTestSuite
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the eNBs
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
Hold a floating point type.
void SetAttribute(std::string name, const AttributeValue &value)
The eNodeB device implementation.
Ptr< T > GetObject(void) const
The LtePhy models the physical layer of LTE.
The LteUeNetDevice class implements the UE net device.