23 #include <ns3/double.h>
25 #include <ns3/abort.h>
26 #include <ns3/pointer.h>
27 #include <ns3/epc-helper.h>
52 TypeId (
"ns3::LteHexGridEnbTopologyHelper")
54 .AddConstructor<LteHexGridEnbTopologyHelper> ()
55 .AddAttribute (
"InterSiteDistance",
56 "The distance [m] between nearby sites",
59 MakeDoubleChecker<double> ())
60 .AddAttribute (
"SectorOffset",
61 "The offset [m] in the position for the node of each sector with respect "
62 "to the center of the three-sector site",
65 MakeDoubleChecker<double> ())
66 .AddAttribute (
"SiteHeight",
67 "The height [m] of each site",
70 MakeDoubleChecker<double> ())
71 .AddAttribute (
"MinX",
"The x coordinate where the hex grid starts.",
74 MakeDoubleChecker<double> ())
75 .AddAttribute (
"MinY",
"The y coordinate where the hex grid starts.",
78 MakeDoubleChecker<double> ())
79 .AddAttribute (
"GridWidth",
"The number of sites in even rows (odd rows will have one additional site).",
82 MakeUintegerChecker<uint32_t> ())
107 const double xydfactor = std::sqrt (0.75);
108 double yd = xydfactor*
m_d;
109 for (uint32_t n = 0; n < c.
GetN (); ++n)
111 uint32_t currentSite = n / 3;
114 uint32_t rowIndex = biRowIndex*2;
115 uint32_t colIndex = biRowRemainder;
122 <<
" rowIndex " << rowIndex
123 <<
" colIndex " << colIndex
124 <<
" biRowIndex " << biRowIndex
125 <<
" biRowRemainder " << biRowRemainder);
126 double y =
m_yMin + yd * rowIndex;
128 double antennaOrientation;
129 if ((rowIndex % 2) == 0)
131 x =
m_xMin + m_d * colIndex;
141 antennaOrientation = 0;
146 antennaOrientation = 120;
152 antennaOrientation = -120;
162 NS_LOG_LOGIC (
"node " << n <<
" at " << pos <<
" antennaOrientation " << antennaOrientation);
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
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)
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.
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.
TypeId SetParent(TypeId tid)
NS_LOG_COMPONENT_DEFINE("LteHexGridEnbTopologyHelper")