ns3::SatGroupHelper Class Reference

This helper is used to create groups of UTs. More...

#include "satellite-group-helper.h"

+ Inheritance diagram for ns3::SatGroupHelper:
+ Collaboration diagram for ns3::SatGroupHelper:

Public Member Functions

 SatGroupHelper ()
 Default constructor for SatGroupHelper. More...
 
virtual ~SatGroupHelper ()
 Destructor for SatGroupHelper. More...
 
void AddNodeToGroupAfterScenarioCreation (uint32_t groupId, Ptr< Node > node)
 Schedule a node to be added to a group when scenario creation is finished. More...
 
void AddUtNodesToGroup (uint32_t groupId, NodeContainer nodes)
 Add several nodes to a group. More...
 
void AddUtNodeToGroup (uint32_t groupId, Ptr< Node > node)
 Add a node to a group. More...
 
void CreateGroupFromPosition (uint32_t groupId, NodeContainer nodes, GeoCoordinate center, uint32_t radius)
 Create a new group using a central position and a radius. More...
 
void CreateGroupsUniformly (std::vector< uint32_t > groupIds, NodeContainer nodes)
 Create several groups and distribute nodes among them. More...
 
void CreateUtNodesFromPosition (uint32_t groupId, uint32_t nb, GeoCoordinate center, uint32_t radius)
 Create a new group using a central position and a radius, and create UT nodes inside this area. More...
 
virtual void DoDispose ()
 Dispose of this class instance. More...
 
std::vector< std::pair< GeoCoordinate, uint32_t > > GetAdditionalNodesPerBeam ()
 Get the position of nodes to add to the scenario. More...
 
std::list< uint32_t > GetGroups ()
 Get the list of groups created. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the type ID of instance. More...
 
uint32_t GetN ()
 Count the number of groups created. More...
 
NodeContainer GetUtNodes (uint32_t groupId) const
 
void Init (NodeContainer uts)
 Initialize the helper. More...
 
void SetSatConstellationEnabled ()
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

uint32_t GetGroupId (Ptr< Node > node) const
 Get the group to which a node belongs. More...
 
NodeContainer GetNodesNotAddedFromPosition (NodeContainer nodes)
 Get list of nodes not created from position by group helper. More...
 
bool IsGroupExisting (uint32_t groupId) const
 Tells if the groupId is already existing in the database. More...
 

Private Attributes

std::vector< std::pair< GeoCoordinate, uint32_t > > m_additionalNodesPerBeam
 Nodes created by position to add to scenario. More...
 
std::list< uint32_t > m_groupsList
 List of group ID created. More...
 
std::map< uint32_t, std::set< Ptr< Node > > > m_groupsMap
 Container to associate nodes to the groups. More...
 
std::map< Ptr< Node >, uint32_t > m_nodesToAdd
 
bool m_satConstellationEnabled
 Use a constellation of satellites. More...
 
bool m_scenarioCreated
 
NodeContainer m_uts
 The list of all the UTs in the simulation. More...
 

Detailed Description

This helper is used to create groups of UTs.

Definition at line 47 of file satellite-group-helper.h.

Constructor & Destructor Documentation

◆ SatGroupHelper()

ns3::SatGroupHelper::SatGroupHelper ( )

Default constructor for SatGroupHelper.

Definition at line 51 of file satellite-group-helper.cc.

◆ ~SatGroupHelper()

virtual ns3::SatGroupHelper::~SatGroupHelper ( )
inlinevirtual

Destructor for SatGroupHelper.

Definition at line 70 of file satellite-group-helper.h.

Member Function Documentation

◆ AddNodeToGroupAfterScenarioCreation()

void ns3::SatGroupHelper::AddNodeToGroupAfterScenarioCreation ( uint32_t  groupId,
Ptr< Node >  node 
)

Schedule a node to be added to a group when scenario creation is finished.

This should not be used in a user scenario, only in intern calls.

Parameters
groupIdThe ID of created group. Cannot be an already existing group
nodeThe associated node

Definition at line 241 of file satellite-group-helper.cc.

References m_nodesToAdd.

◆ AddUtNodesToGroup()

void ns3::SatGroupHelper::AddUtNodesToGroup ( uint32_t  groupId,
NodeContainer  nodes 
)

Add several nodes to a group.

Parameters
groupIdThe group ID where the nodes are added
nodesThe nodes to add

Definition at line 116 of file satellite-group-helper.cc.

References AddUtNodeToGroup(), and m_scenarioCreated.

+ Here is the call graph for this function:

◆ AddUtNodeToGroup()

void ns3::SatGroupHelper::AddUtNodeToGroup ( uint32_t  groupId,
Ptr< Node >  node 
)

Add a node to a group.

Parameters
groupIdThe group ID where the node is added
nodeThe node to add

Definition at line 83 of file satellite-group-helper.cc.

References GetGroupId(), IsGroupExisting(), m_groupsList, m_groupsMap, m_satConstellationEnabled, and m_scenarioCreated.

Referenced by AddUtNodesToGroup(), CreateGroupFromPosition(), CreateGroupsUniformly(), and Init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateGroupFromPosition()

void ns3::SatGroupHelper::CreateGroupFromPosition ( uint32_t  groupId,
NodeContainer  nodes,
GeoCoordinate  center,
uint32_t  radius 
)

Create a new group using a central position and a radius.

Parameters
groupIdThe ID of created group. Cannot be an already existing group
nodesThe input nodes, used to determine if each one belong to the group or not
centerThe center of the circle
radiusThe radius of the circle in meters

Definition at line 133 of file satellite-group-helper.cc.

References AddUtNodeToGroup(), GetN(), GetNodesNotAddedFromPosition(), GetUtNodes(), m_scenarioCreated, and ns3::GeoCoordinate::ToVector().

+ Here is the call graph for this function:

◆ CreateGroupsUniformly()

void ns3::SatGroupHelper::CreateGroupsUniformly ( std::vector< uint32_t >  groupIds,
NodeContainer  nodes 
)

Create several groups and distribute nodes among them.

Parameters
groupIdsThe list of group IDs to create. They all must be empty
nodesThe nodes to distribute in the groups

Definition at line 173 of file satellite-group-helper.cc.

References AddUtNodeToGroup(), GetN(), GetNodesNotAddedFromPosition(), GetUtNodes(), and m_scenarioCreated.

+ Here is the call graph for this function:

◆ CreateUtNodesFromPosition()

void ns3::SatGroupHelper::CreateUtNodesFromPosition ( uint32_t  groupId,
uint32_t  nb,
GeoCoordinate  center,
uint32_t  radius 
)

Create a new group using a central position and a radius, and create UT nodes inside this area.

Parameters
groupIdThe ID of created group. Cannot be an already existing group
nbThe number of nodes to create in this circle
centerThe center of the circle
radiusThe radius of the circle in meters

Definition at line 205 of file satellite-group-helper.cc.

References m_additionalNodesPerBeam, m_groupsList, and m_scenarioCreated.

◆ DoDispose()

void ns3::SatGroupHelper::DoDispose ( )
virtual

Dispose of this class instance.

Definition at line 59 of file satellite-group-helper.cc.

References m_groupsMap.

◆ GetAdditionalNodesPerBeam()

std::vector< std::pair< GeoCoordinate, uint32_t > > ns3::SatGroupHelper::GetAdditionalNodesPerBeam ( )

Get the position of nodes to add to the scenario.

Returns
The vector of points and group IDs

Definition at line 249 of file satellite-group-helper.cc.

References m_additionalNodesPerBeam.

◆ GetGroupId()

uint32_t ns3::SatGroupHelper::GetGroupId ( Ptr< Node >  node) const
private

Get the group to which a node belongs.

Parameters
nodeThe node to analyse
Returns
The groupID where the node is registered. Return 0 if no group is found

Definition at line 329 of file satellite-group-helper.cc.

References m_groupsMap.

Referenced by AddUtNodeToGroup().

+ Here is the caller graph for this function:

◆ GetGroups()

std::list< uint32_t > ns3::SatGroupHelper::GetGroups ( )

Get the list of groups created.

Returns
The list of groups created

Definition at line 311 of file satellite-group-helper.cc.

References m_groupsList.

◆ GetInstanceTypeId()

TypeId ns3::SatGroupHelper::GetInstanceTypeId ( void  ) const
virtual

Get the type ID of instance.

Returns
the object TypeId

Definition at line 44 of file satellite-group-helper.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetN()

uint32_t ns3::SatGroupHelper::GetN ( )

Count the number of groups created.

Returns
The number of groups

Definition at line 303 of file satellite-group-helper.cc.

References m_groupsMap.

Referenced by CreateGroupFromPosition(), and CreateGroupsUniformly().

+ Here is the caller graph for this function:

◆ GetNodesNotAddedFromPosition()

NodeContainer ns3::SatGroupHelper::GetNodesNotAddedFromPosition ( NodeContainer  nodes)
private

Get list of nodes not created from position by group helper.

Parameters
nodesThe list of nodes to filter
Returns
The list of nodes not created from position by group helper

Definition at line 344 of file satellite-group-helper.cc.

References m_nodesToAdd.

Referenced by CreateGroupFromPosition(), and CreateGroupsUniformly().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SatGroupHelper::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 36 of file satellite-group-helper.cc.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ GetUtNodes()

NodeContainer ns3::SatGroupHelper::GetUtNodes ( uint32_t  groupId) const
Parameters
groupIdThe group ID
Returns
container having all UT nodes associated to a group

Definition at line 257 of file satellite-group-helper.cc.

References IsGroupExisting(), m_groupsMap, and m_uts.

Referenced by CreateGroupFromPosition(), and CreateGroupsUniformly().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Init()

void ns3::SatGroupHelper::Init ( NodeContainer  uts)

Initialize the helper.

Should be call only by SatHelper internally

Parameters
utsThe list of all UTs in the simulation

Definition at line 67 of file satellite-group-helper.cc.

References AddUtNodeToGroup(), m_nodesToAdd, m_scenarioCreated, and m_uts.

+ Here is the call graph for this function:

◆ IsGroupExisting()

bool ns3::SatGroupHelper::IsGroupExisting ( uint32_t  groupId) const
private

Tells if the groupId is already existing in the database.

Parameters
groupIdThe group to test
Returns
true if the group already exists

Definition at line 323 of file satellite-group-helper.cc.

References m_groupsMap.

Referenced by AddUtNodeToGroup(), and GetUtNodes().

+ Here is the caller graph for this function:

◆ SetSatConstellationEnabled()

void ns3::SatGroupHelper::SetSatConstellationEnabled ( )

Definition at line 317 of file satellite-group-helper.cc.

References m_satConstellationEnabled.

Member Data Documentation

◆ m_additionalNodesPerBeam

std::vector<std::pair<GeoCoordinate, uint32_t> > ns3::SatGroupHelper::m_additionalNodesPerBeam
private

Nodes created by position to add to scenario.

vector: <position, group ID>

Definition at line 203 of file satellite-group-helper.h.

Referenced by CreateUtNodesFromPosition(), and GetAdditionalNodesPerBeam().

◆ m_groupsList

std::list<uint32_t> ns3::SatGroupHelper::m_groupsList
private

List of group ID created.

Definition at line 198 of file satellite-group-helper.h.

Referenced by AddUtNodeToGroup(), CreateUtNodesFromPosition(), and GetGroups().

◆ m_groupsMap

std::map<uint32_t, std::set<Ptr<Node> > > ns3::SatGroupHelper::m_groupsMap
private

Container to associate nodes to the groups.

Definition at line 193 of file satellite-group-helper.h.

Referenced by AddUtNodeToGroup(), DoDispose(), GetGroupId(), GetN(), GetUtNodes(), and IsGroupExisting().

◆ m_nodesToAdd

std::map<Ptr<Node>, uint32_t> ns3::SatGroupHelper::m_nodesToAdd
private

◆ m_satConstellationEnabled

bool ns3::SatGroupHelper::m_satConstellationEnabled
private

Use a constellation of satellites.

Definition at line 219 of file satellite-group-helper.h.

Referenced by AddUtNodeToGroup(), and SetSatConstellationEnabled().

◆ m_scenarioCreated

bool ns3::SatGroupHelper::m_scenarioCreated
private

◆ m_uts

NodeContainer ns3::SatGroupHelper::m_uts
private

The list of all the UTs in the simulation.

Definition at line 188 of file satellite-group-helper.h.

Referenced by GetUtNodes(), and Init().


The documentation for this class was generated from the following files: