20 #include "ns3/config-store.h"
21 #include "ns3/core-module.h"
22 #include "ns3/lte-module.h"
23 #include "ns3/mobility-module.h"
24 #include "ns3/network-module.h"
25 #include <ns3/buildings-helper.h>
26 #include <ns3/buildings-propagation-loss-model.h>
27 #include <ns3/radio-environment-map-helper.h>
37 main(
int argc,
char* argv[])
40 cmd.Parse(argc, argv);
45 cmd.Parse(argc, argv);
49 double nodeHeight = 1.5;
50 double roomHeight = 3;
51 double roomLength = 500;
54 uint32_t nEnb = nRooms * nRooms + 4;
65 std::vector<NodeContainer> ueNodes;
67 oneSectorNodes.
Create(nEnb - 3);
68 threeSectorNodes.
Create(3);
70 enbNodes.
Add(oneSectorNodes);
71 enbNodes.
Add(threeSectorNodes);
73 for (uint32_t i = 0; i < nEnb; i++)
77 ueNodes.push_back(ueNode);
81 std::vector<Vector> enbPosition;
84 building = Create<Building>();
85 building->SetBoundaries(
86 Box(0.0, nRooms * roomLength, 0.0, nRooms * roomLength, 0.0, roomHeight));
89 building->SetNFloors(1);
90 building->SetNRoomsX(nRooms);
91 building->SetNRoomsY(nRooms);
92 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
95 uint32_t plantedEnb = 0;
96 for (uint32_t row = 0; row < nRooms; row++)
98 for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
100 Vector v(roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
101 positionAlloc->Add(v);
102 enbPosition.push_back(v);
109 Vector v(500, 3000, nodeHeight);
110 positionAlloc->Add(v);
111 enbPosition.push_back(v);
112 mobility.Install(ueNodes.at(plantedEnb));
116 for (uint32_t index = 0; index < 3; index++, plantedEnb++)
118 Vector v(500, 2000, nodeHeight);
119 positionAlloc->Add(v);
120 enbPosition.push_back(v);
121 mobility.Install(ueNodes.at(plantedEnb));
124 mobility.SetPositionAllocator(positionAlloc);
128 for (uint32_t i = 0; i < nEnb; i++)
136 positionAlloc = CreateObject<ListPositionAllocator>();
137 for (uint32_t j = 0; j < nUe; j++)
142 Vector(enbPosition.at(i).x + 10, enbPosition.at(i).y, nodeHeight));
144 else if (i == nEnb - 2)
146 positionAlloc->Add(Vector(enbPosition.at(i).x - std::sqrt(10),
147 enbPosition.at(i).y + std::sqrt(10),
150 else if (i == nEnb - 1)
152 positionAlloc->Add(Vector(enbPosition.at(i).x - std::sqrt(10),
153 enbPosition.at(i).y - std::sqrt(10),
160 mobility.SetPositionAllocator(positionAlloc);
168 std::vector<NetDeviceContainer> ueDevs;
196 for (uint32_t i = 0; i < nEnb; i++)
199 ueDevs.push_back(ueDev);
200 lteHelper->
Attach(ueDev, enbDevs.
Get(i));
210 remHelper->SetAttribute(
"ChannelPath",
StringValue(
"/ChannelList/0"));
211 remHelper->SetAttribute(
"OutputFile",
StringValue(
"rem.out"));
212 remHelper->SetAttribute(
"XMin",
DoubleValue(-2000.0));
213 remHelper->SetAttribute(
"XMax",
DoubleValue(+2000.0));
214 remHelper->SetAttribute(
"YMin",
DoubleValue(-500.0));
215 remHelper->SetAttribute(
"YMax",
DoubleValue(+3500.0));
217 remHelper->Install();
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.
Parse command-line arguments.
Introspection did not find any typical Config paths.
void ConfigureDefaults()
Configure the default values.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
This class contains the specification of EPS Bearers.
@ GBR_CONV_VOICE
GBR Conversational Voice.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
void SetDefault(std::string name, const AttributeValue &value)
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.