mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-09 02:23:57 +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)
|
||||
{
|
||||
|
|
|
@ -29,11 +29,18 @@ public:
|
|||
|
||||
/**
|
||||
*
|
||||
* \param wpFile path to latitude longitude file
|
||||
* \param file path to latitude longitude file
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
*/
|
||||
NodeContainer Install (const std::string &file);
|
||||
|
||||
/**
|
||||
*
|
||||
* \param numNodes a number of nodes to uniformly distribute accross earth
|
||||
* \returns a node container containing nodes using the specified attributes
|
||||
*/
|
||||
NodeContainer Install (uint64_t numNodes);
|
||||
|
||||
/**
|
||||
*
|
||||
* \param location1 first location
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue