23 #include <ns3/double.h>
25 #include <ns3/abort.h>
26 #include <ns3/pointer.h>
27 #include <ns3/epc-helper.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> ())
70 .AddAttribute (
"MinX",
"The x coordinate where the hex grid starts.",
73 MakeDoubleChecker<double> ())
74 .AddAttribute (
"MinY",
"The y coordinate where the hex grid starts.",
77 MakeDoubleChecker<double> ())
78 .AddAttribute (
"GridWidth",
"The number of sites in even rows (odd rows will have one additional site).",
81 MakeUintegerChecker<uint32_t> ())
106 const double xydfactor = std::sqrt (0.75);
107 double yd = xydfactor*
m_d;
108 for (uint32_t n = 0; n < c.
GetN (); ++n)
110 uint32_t currentSite = n / 3;
113 uint32_t rowIndex = biRowIndex*2;
114 uint32_t colIndex = biRowRemainder;
121 <<
" rowIndex " << rowIndex
122 <<
" colIndex " << colIndex
123 <<
" biRowIndex " << biRowIndex
124 <<
" biRowRemainder " << biRowRemainder);
125 double y =
m_yMin + yd * rowIndex;
127 double antennaOrientation;
128 if ((rowIndex % 2) == 0)
130 x =
m_xMin + m_d * colIndex;
140 antennaOrientation = 0;
146 antennaOrientation = 120;
153 antennaOrientation = -120;
164 NS_LOG_LOGIC (
"node " << n <<
" at " << pos <<
" antennaOrientation " << antennaOrientation);
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void SetLteHelper(Ptr< LteHelper > h)
Set the LteHelper to be used to actually create the EnbNetDevices.
NetDeviceContainer SetPositionAndInstallEnbDevice(NodeContainer c)
Position the nodes on a hex grid and install the corresponding EnbNetDevices with antenna boresight c...
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
LteHexGridEnbTopologyHelper(void)
Keep track of the current position and velocity of an object.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
virtual ~LteHexGridEnbTopologyHelper(void)
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
keep track of a set of node pointers.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Ptr< LteHelper > m_lteHelper
void SetPosition(const Vector &position)
static TypeId GetTypeId(void)
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the eNBs
a base class which provides memory management and object aggregation
Hold a floating point type.
Ptr< T > GetObject(void) const
a unique identifier for an interface.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
set an attribute for the FFR algorithm to be created
TypeId SetParent(TypeId tid)