22 #include <ns3/abort.h>
23 #include <ns3/double.h>
24 #include <ns3/epc-helper.h>
26 #include <ns3/pointer.h>
51 TypeId(
"ns3::LteHexGridEnbTopologyHelper")
53 .AddConstructor<LteHexGridEnbTopologyHelper>()
54 .AddAttribute(
"InterSiteDistance",
55 "The distance [m] between nearby sites",
58 MakeDoubleChecker<double>())
59 .AddAttribute(
"SectorOffset",
60 "The offset [m] in the position for the node of each sector with respect "
61 "to the center of the three-sector site",
64 MakeDoubleChecker<double>())
65 .AddAttribute(
"SiteHeight",
66 "The height [m] of each site",
69 MakeDoubleChecker<double>())
71 "The x coordinate where the hex grid starts.",
74 MakeDoubleChecker<double>())
76 "The y coordinate where the hex grid starts.",
79 MakeDoubleChecker<double>())
82 "The number of sites in even rows (odd rows will have one additional site).",
85 MakeUintegerChecker<uint32_t>());
108 const double xydfactor = std::sqrt(0.75);
109 double yd = xydfactor *
m_d;
110 for (uint32_t n = 0; n < c.
GetN(); ++n)
112 uint32_t currentSite = n / 3;
115 uint32_t rowIndex = biRowIndex * 2;
116 uint32_t colIndex = biRowRemainder;
122 NS_LOG_LOGIC(
"node " << n <<
" site " << currentSite <<
" rowIndex " << rowIndex
123 <<
" colIndex " << colIndex <<
" biRowIndex " << biRowIndex
124 <<
" biRowRemainder " << biRowRemainder);
125 double y =
m_yMin + yd * rowIndex;
127 double antennaOrientation;
128 if ((rowIndex % 2) == 0)
140 antennaOrientation = 0;
146 antennaOrientation = 120;
153 antennaOrientation = -120;
164 NS_LOG_LOGIC(
"node " << n <<
" at " << pos <<
" antennaOrientation " << antennaOrientation);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
void DoDispose() override
Destructor implementation.
~LteHexGridEnbTopologyHelper() override
static TypeId GetTypeId()
Register this type.
double m_d
The distance [m] between nearby sites.
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.
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.
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.
A base class which provides memory management and object aggregation.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
virtual void DoDispose()
Destructor implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
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 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 ",...
#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.