14#include "ns3/double.h"
15#include "ns3/hexagonal-wraparound-model.h"
17#include "ns3/pointer.h"
42 TypeId(
"ns3::LteHexGridEnbTopologyHelper")
44 .AddConstructor<LteHexGridEnbTopologyHelper>()
45 .AddAttribute(
"InterSiteDistance",
46 "The distance [m] between nearby sites",
50 .AddAttribute(
"SectorOffset",
51 "The offset [m] in the position for the node of each sector with respect "
52 "to the center of the three-sector site",
56 .AddAttribute(
"SiteHeight",
57 "The height [m] of each site",
62 "The x coordinate where the hex grid starts.",
67 "The y coordinate where the hex grid starts.",
73 "The number of sites in even rows (odd rows will have one additional site).",
77 .AddAttribute(
"EnableWraparound",
78 "Enable hexagonal wraparound model.",
108 wraparoundModel->SetSiteDistance(
m_d);
109 wraparoundModel->SetNumSites(c.
GetN() / 3);
111 const double xydfactor = std::sqrt(0.75);
112 double yd = xydfactor *
m_d;
125 NS_LOG_LOGIC(
"node " << n <<
" site " << currentSite <<
" rowIndex " << rowIndex
126 <<
" colIndex " << colIndex <<
" biRowIndex " << biRowIndex
127 <<
" biRowRemainder " << biRowRemainder);
128 double y =
m_yMin + yd * rowIndex;
130 double antennaOrientation;
131 if ((rowIndex % 2) == 0)
143 antennaOrientation = 0;
149 antennaOrientation = 120;
156 antennaOrientation = -120;
167 NS_LOG_LOGIC(
"node " << n <<
" at " << pos <<
" antennaOrientation " << antennaOrientation);
173 wraparoundModel->AddSitePosition(mm->GetPosition());
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
This helper class allows to easily create a topology with eNBs grouped in three-sector sites laid out...
void DoDispose() override
Destructor implementation.
~LteHexGridEnbTopologyHelper() override
bool m_installWraparound
Boolean flag indicating whether to install or not wraparound model.
static TypeId GetTypeId()
Register this type.
double m_d
The distance [m] between nearby sites.
Ptr< WraparoundModel > GetWraparoundModel() const
Get the configured wraparound model.
double m_xMin
The x coordinate where the hex grid starts.
Ptr< LteHelper > m_lteHelper
Pointer to LteHelper object.
LteHexGridEnbTopologyHelper()
double m_yMin
The y coordinate where the hex grid starts.
uint32_t m_gridWidth
The number of sites in even rows (odd rows will have one additional site)
NetDeviceContainer SetPositionAndInstallEnbDevice(NodeContainer c)
Position the nodes on a hex grid and install the corresponding EnbNetDevices with antenna boresight c...
double m_offset
The offset [m] in the position for the node of each sector with respect to the center of the three-se...
void SetLteHelper(Ptr< LteHelper > h)
Set the LteHelper to be used to actually create the EnbNetDevices.
uint32_t m_siteHeight
The height [m] of each site.
Ptr< WraparoundModel > m_wraparoundModel
Wraparound model pointer.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
keep track of a set of node pointers.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
virtual void DoDispose()
Destructor implementation.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.