|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include <ns3/object.h>
25 #include <ns3/spectrum-interference.h>
26 #include <ns3/spectrum-error-model.h>
29 #include <ns3/simulator.h>
30 #include <ns3/packet.h>
32 #include "ns3/radio-bearer-stats-calculator.h"
33 #include <ns3/mobility-building-info.h>
34 #include <ns3/buildings-propagation-loss-model.h>
35 #include <ns3/eps-bearer.h>
36 #include <ns3/node-container.h>
37 #include <ns3/mobility-helper.h>
38 #include <ns3/net-device-container.h>
39 #include <ns3/lte-ue-net-device.h>
40 #include <ns3/lte-enb-net-device.h>
41 #include <ns3/lte-ue-rrc.h>
42 #include <ns3/lte-helper.h>
43 #include "ns3/string.h"
44 #include "ns3/double.h"
45 #include <ns3/lte-enb-phy.h>
46 #include <ns3/lte-ue-phy.h>
47 #include <ns3/boolean.h>
48 #include <ns3/rr-ff-mac-scheduler.h>
49 #include <ns3/pf-ff-mac-scheduler.h>
50 #include <ns3/pointer.h>
52 #include <ns3/buildings-helper.h>
70 std::vector<uint32_t> estThrDl;
71 estThrDl.push_back (119100);
72 estThrDl.push_back (183600);
73 estThrDl.push_back (193400);
86 std::ostringstream oss;
87 oss <<
" UE distance " << dist <<
" m" <<
" Scheduler " << schedulerType;
100 :
TestCase (BuildNameString (dist, schedulerType, useIdealRrc)),
102 m_estThrDl (estThrDl),
103 m_schedulerType (schedulerType),
104 m_useIdealRrc (useIdealRrc)
154 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
156 BuildingsHelper::Install (enbNodes);
157 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
159 BuildingsHelper::Install (ueNodes);
169 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
179 enbPhy->SetAttribute (
"TxPower",
DoubleValue (46.0));
180 enbPhy->SetAttribute (
"NoiseFigure",
DoubleValue (5.0));
189 uePhy->SetAttribute (
"TxPower",
DoubleValue (23.0));
190 uePhy->SetAttribute (
"NoiseFigure",
DoubleValue (9.0));
195 double simulationTime = 0.6;
196 double tolerance = 0.1;
202 enbNetDev->
GetCcMap()[0]->GetAttribute (
"FfMacScheduler", ptrval);
212 Simulator::Schedule (
Seconds (0.2), &RrFfMacScheduler::TransmissionModeConfigurationUpdate, rrsched, rnti, 1);
213 Simulator::Schedule (
Seconds (0.4), &RrFfMacScheduler::TransmissionModeConfigurationUpdate, rrsched, rnti, 2);
223 Simulator::Schedule (
Seconds (0.2), &PfFfMacScheduler::TransmissionModeConfigurationUpdate, pfsched, rnti, 1);
224 Simulator::Schedule (
Seconds (0.4), &PfFfMacScheduler::TransmissionModeConfigurationUpdate, pfsched, rnti, 2);
236 double sampleTime = 0.199999;
237 for (uint8_t j = 0; j <
m_estThrDl.size (); j ++)
239 NS_LOG_INFO (
"\t test with user at distance " <<
m_dist <<
" time " << sampleTime);
247 Simulator::Stop (
Seconds (simulationTime));
249 Simulator::Destroy ();
252 for (uint8_t i = 0; i <
m_estThrDl.size (); i++)
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
LenaMimoTestCase(uint16_t dist, std::vector< uint32_t > estThrDl, std::string schedulerType, bool useIdealRrc)
Constructor.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Ptr< LteUePhy > GetPhy(void) const
Get the Phy.
AttributeValue implementation for Boolean.
static std::string BuildNameString(uint16_t dist, std::string schedulerType, bool useIdealRrc)
Builds the test name string based on provided parameter values.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~LenaMimoTestCase()
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
static LenaTestMimoSuite lenaTestMimoSuite
std::vector< uint32_t > m_estThrDl
estimated throughput DL
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
std::string m_schedulerType
the scheduler type
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
std::string GetName(void) const
void SetPosition(const Vector &position)
Hold objects of type Ptr<T>.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > GetCcMap(void) const
virtual void DoRun(void)
Implementation to actually run this TestCase.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Hold variables of type enum.
Implements the SCHED SAP and CSCHED SAP for a Proportional Fair scheduler.
Ptr< LteEnbPhy > GetPhy(void) const
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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...
The LteUeNetDevice class implements the UE net device.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
bool m_useIdealRrc
whether to use the ideal RRC
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Simulation virtual time values and global simulation resolution.
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
std::vector< uint64_t > m_dlDataRxed
DL data received.
Hold variables of type string.
This class contains the specification of EPS Bearers.
Time Seconds(double value)
Construct a Time in the indicated unit.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Keep track of the current position and velocity of an object.
keep track of a set of node pointers.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
This system test program creates different test cases with a single eNB and single UE.
void SetDefault(std::string name, const AttributeValue &value)
void GetRlcBufferSample(Ptr< RadioBearerStatsCalculator > rlcStats, uint64_t imsi, uint8_t rnti)
Get RLC buffer sample.
uint64_t GetDlRxData(uint64_t imsi, uint8_t lcid)
Gets the number of received downlink data bytes.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
uint16_t m_dist
the distance
The eNodeB device implementation.
Helper class used to assign positions and mobility models to nodes.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.