mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-07-31 19:20:07 +02:00
Add helper for uniform gw distribution
This commit is contained in:
parent
ab7c9881f6
commit
1c96f7d2f6
3 changed files with 31 additions and 6 deletions
|
@ -5,6 +5,8 @@
|
|||
#include "ns3/log.h"
|
||||
#include "ns3/config.h"
|
||||
#include "ns3/waypoint.h"
|
||||
#include "ns3/double.h"
|
||||
#include "ns3/mobility-helper.h"
|
||||
|
||||
#include "ground-node-helper.h"
|
||||
|
||||
|
@ -55,6 +57,24 @@ LeoGndNodeHelper::Install (const std::string &file)
|
|||
return nodes;
|
||||
}
|
||||
|
||||
NodeContainer
|
||||
LeoGndNodeHelper::Install (uint64_t numNodes)
|
||||
{
|
||||
NodeContainer nodes;
|
||||
for (uint64_t i = 0; i < numNodes; i++)
|
||||
{
|
||||
nodes.Add (m_gndNodeFactory.Create<Node> ());
|
||||
}
|
||||
MobilityHelper mobility;
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.SetPositionAllocator ("ns3::LeoPolarPositionAllocator",
|
||||
"Step", DoubleValue (360.0 * 180.0 / numNodes));
|
||||
|
||||
mobility.Install (nodes);
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
Vector3D
|
||||
LeoGndNodeHelper::GetEarthPosition (const LeoLatLong &loc)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue