|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/core-module.h"
22 #include "ns3/network-module.h"
23 #include "ns3/mobility-module.h"
24 #include "ns3/lte-module.h"
25 #include "ns3/config-store.h"
26 #include <ns3/buildings-propagation-loss-model.h>
27 #include <ns3/buildings-helper.h>
28 #include <ns3/radio-environment-map-helper.h>
38 main (
int argc,
char *argv[])
41 cmd.Parse (argc, argv);
46 cmd.Parse (argc, argv);
50 double nodeHeight = 1.5;
51 double roomHeight = 3;
52 double roomLength = 500;
55 uint32_t nEnb = nRooms*nRooms + 4;
66 vector < NodeContainer > ueNodes;
68 oneSectorNodes.
Create (nEnb-3);
69 threeSectorNodes.
Create (3);
71 enbNodes.
Add (oneSectorNodes);
72 enbNodes.
Add (threeSectorNodes);
74 for (uint32_t i = 0; i < nEnb; i++)
78 ueNodes.push_back (ueNode);
82 vector<Vector> enbPosition;
85 building = Create<Building> ();
87 0.0, nRooms * roomLength,
94 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
97 uint32_t plantedEnb = 0;
98 for (uint32_t row = 0; row < nRooms; row++)
100 for (uint32_t column = 0; column < nRooms; column++, plantedEnb++)
102 Vector v (roomLength * (column + 0.5),
103 roomLength * (row + 0.5),
105 positionAlloc->
Add (v);
106 enbPosition.push_back (v);
113 Vector v (500, 3000, nodeHeight);
114 positionAlloc->
Add (v);
115 enbPosition.push_back (v);
116 mobility.Install (ueNodes.at(plantedEnb));
120 for (uint32_t index = 0; index < 3; index++, plantedEnb++)
122 Vector v (500, 2000, nodeHeight);
123 positionAlloc->
Add (v);
124 enbPosition.push_back (v);
125 mobility.Install (ueNodes.at(plantedEnb));
129 mobility.SetPositionAllocator (positionAlloc);
133 for (uint32_t i = 0; i < nEnb; i++)
141 positionAlloc = CreateObject<ListPositionAllocator> ();
142 for (uint32_t j = 0; j < nUe; j++)
146 positionAlloc->
Add (Vector (enbPosition.at(i).x + 10, enbPosition.at(i).y, nodeHeight));
148 else if ( i == nEnb - 2 )
150 positionAlloc->
Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y + std::sqrt (10), nodeHeight));
152 else if ( i == nEnb - 1 )
154 positionAlloc->
Add (Vector (enbPosition.at(i).x - std::sqrt (10), enbPosition.at(i).y - std::sqrt (10), nodeHeight));
160 mobility.SetPositionAllocator (positionAlloc);
168 vector < NetDeviceContainer > ueDevs;
197 for (uint32_t i = 0; i < nEnb; i++)
200 ueDevs.push_back (ueDev);
201 lteHelper->
Attach (ueDev, enbDevs.
Get (i));
holds a vector of ns3::NetDevice pointers
Parse command-line arguments.
void Add(Vector v)
Add a position to the list of positions.
void SetExtWallsType(Building::ExtWallsType_t t)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
void SetPosition(const Vector &position)
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void SetNRoomsX(uint16_t nroomx)
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.
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
void SetBuildingType(Building::BuildingType_t t)
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
void SetBoundaries(Box box)
Set the boundaries of the building.
Introspection did not find any typical Config paths.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetNRoomsY(uint16_t nroomy)
void ConfigureDefaults(void)
Configure the default values.
static void Run(void)
Run the simulation.
Hold variables of type string.
This class contains the specification of EPS Bearers.
Time Seconds(double value)
Construct a Time in the indicated unit.
@ GBR_CONV_VOICE
GBR Conversational Voice.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
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...
void SetDefault(std::string name, const AttributeValue &value)
void Install()
Deploy the RemSpectrumPhy objects that generate the map according to the specified settings.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Helper class used to assign positions and mobility models to nodes.
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
void SetNFloors(uint16_t nfloors)