A Discrete-Event Network Simulator
API
ns3::GroupMobilityHelper Class Reference

Helper class used to assign positions and mobility models to nodes for a group mobility configuration. More...

#include "group-mobility-helper.h"

+ Collaboration diagram for ns3::GroupMobilityHelper:

Public Member Functions

 GroupMobilityHelper ()
 Construct a group mobility helper. More...
 
 ~GroupMobilityHelper ()
 Destroy a group mobility helper. More...
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by the mobility models on these nodes. More...
 
void Install (NodeContainer container)
 Install and configure a hierarchical mobility model to all nodes in the container, based on the configured reference and member models. More...
 
void Install (Ptr< Node > node)
 Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models. More...
 
void Install (std::string nodeName)
 Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models. More...
 
void SetMemberMobilityModel (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
 Configure the mobility model which will be installed as the member (child) mobility model during GroupMobilityModel::Install. More...
 
void SetMemberPositionAllocator (Ptr< PositionAllocator > allocator)
 Set the position allocator which will be used to allocate the initial position of the member mobility models. More...
 
void SetMemberPositionAllocator (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
 Configure the position allocator which will be used to allocate the initial position of the member mobility models. More...
 
void SetReferenceMobilityModel (Ptr< MobilityModel > mobility)
 Set the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install. More...
 
void SetReferenceMobilityModel (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
 Configure the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install. More...
 
void SetReferencePositionAllocator (Ptr< PositionAllocator > allocator)
 Set the position allocator which will be used to allocate the initial position of the reference mobility model. More...
 
void SetReferencePositionAllocator (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
 Configure the position allocator which will be used to allocate the initial position of the reference mobility model. More...
 

Private Attributes

ObjectFactory m_memberMobilityFactory
 Object factory to create member mobility models. More...
 
Ptr< PositionAllocatorm_memberPosition
 Position allocator for use as member position allocator. More...
 
Ptr< MobilityModelm_referenceMobility
 Reference mobility model. More...
 
Ptr< PositionAllocatorm_referencePosition
 Position allocator for use as reference position allocator. More...
 
bool m_referencePositionSet {false}
 flag for avoiding multiple SetPosition calls on the reference model More...
 

Detailed Description

Helper class used to assign positions and mobility models to nodes for a group mobility configuration.

This helper can be used for group mobility configuration and installation onto a group of nodes, in which there is a reference (parent) mobility model that is the same for all nodes, and similarly configured (but distinct) child mobility models.

Definition at line 46 of file group-mobility-helper.h.

Constructor & Destructor Documentation

◆ GroupMobilityHelper()

ns3::GroupMobilityHelper::GroupMobilityHelper ( )

Construct a group mobility helper.

Definition at line 39 of file group-mobility-helper.cc.

◆ ~GroupMobilityHelper()

ns3::GroupMobilityHelper::~GroupMobilityHelper ( )

Destroy a group mobility helper.

Definition at line 43 of file group-mobility-helper.cc.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::GroupMobilityHelper::AssignStreams ( NodeContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by the mobility models on these nodes.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Note
If the PositionAllocator used contains random variables, they will not be affected by this call to AssignStreams because they are used earlier during Install() time. If the user needs to assign a fixed stream number to a PositionAllocator used with this helper, the user should instantiate it outside of the helper, call AssignStreams() on it, and then pass the pointer of it to this helper.
Parameters
cNodeContainer of the set of nodes containing the MobilityModels that should be modified to use a fixed stream
streamfirst stream index to use
Returns
the number of stream indices assigned by this helper

Definition at line 214 of file group-mobility-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Object::GetObject(), third::mobility, and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ Install() [1/3]

void ns3::GroupMobilityHelper::Install ( NodeContainer  container)

Install and configure a hierarchical mobility model to all nodes in the container, based on the configured reference and member models.

If position allocators are configured, they will be invoked to set the initial positions.

Parameters
containerThe set of nodes to configure

Definition at line 206 of file group-mobility-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().

+ Here is the call graph for this function:

◆ Install() [2/3]

void ns3::GroupMobilityHelper::Install ( Ptr< Node node)

Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models.

If position allocators are configured, they will be invoked to set the initial position.

Parameters
nodeThe node to configure

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

References ns3::Object::AggregateObject(), ns3::ObjectFactory::Create(), ns3::Object::GetObject(), ns3::ObjectFactory::IsTypeIdSet(), m_memberMobilityFactory, m_memberPosition, m_referenceMobility, m_referencePosition, m_referencePositionSet, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_LOG_DEBUG, and ns3::MobilityModel::SetPosition().

Referenced by Install().

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

◆ Install() [3/3]

void ns3::GroupMobilityHelper::Install ( std::string  nodeName)

Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models.

If position allocators are configured, they will be invoked to set the initial position.

Parameters
nodeNameThe name of the node to configure

Definition at line 199 of file group-mobility-helper.cc.

References Install().

+ Here is the call graph for this function:

◆ SetMemberMobilityModel()

void ns3::GroupMobilityHelper::SetMemberMobilityModel ( std::string  type,
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue (),
std::string  n8 = "",
const AttributeValue v8 = EmptyAttributeValue (),
std::string  n9 = "",
const AttributeValue v9 = EmptyAttributeValue () 
)

Configure the mobility model which will be installed as the member (child) mobility model during GroupMobilityModel::Install.

Parameters
typethe type of mobility model to use.
n1the name of the attribute to set in the mobility model.
v1the value of the attribute to set in the mobility model.
n2the name of the attribute to set in the mobility model.
v2the value of the attribute to set in the mobility model.
n3the name of the attribute to set in the mobility model.
v3the value of the attribute to set in the mobility model.
n4the name of the attribute to set in the mobility model.
v4the value of the attribute to set in the mobility model.
n5the name of the attribute to set in the mobility model.
v5the value of the attribute to set in the mobility model.
n6the name of the attribute to set in the mobility model.
v6the value of the attribute to set in the mobility model.
n7the name of the attribute to set in the mobility model.
v7the value of the attribute to set in the mobility model.
n8the name of the attribute to set in the mobility model.
v8the value of the attribute to set in the mobility model.
n9the name of the attribute to set in the mobility model.
v9the value of the attribute to set in the mobility model.

Calls to MobilityHelper::Install will create an instance of a matching mobility model for each node.

Definition at line 148 of file group-mobility-helper.cc.

References m_memberMobilityFactory, NS_LOG_FUNCTION, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ SetMemberPositionAllocator() [1/2]

void ns3::GroupMobilityHelper::SetMemberPositionAllocator ( Ptr< PositionAllocator allocator)

Set the position allocator which will be used to allocate the initial position of the member mobility models.

Parameters
allocatorallocate initial member mobility model positions

Definition at line 81 of file group-mobility-helper.cc.

References m_memberPosition.

◆ SetMemberPositionAllocator() [2/2]

void ns3::GroupMobilityHelper::SetMemberPositionAllocator ( std::string  type,
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue (),
std::string  n8 = "",
const AttributeValue v8 = EmptyAttributeValue (),
std::string  n9 = "",
const AttributeValue v9 = EmptyAttributeValue () 
)

Configure the position allocator which will be used to allocate the initial position of the member mobility models.

Parameters
typethe type of mobility model to use.
n1the name of the attribute to set in the mobility model.
v1the value of the attribute to set in the mobility model.
n2the name of the attribute to set in the mobility model.
v2the value of the attribute to set in the mobility model.
n3the name of the attribute to set in the mobility model.
v3the value of the attribute to set in the mobility model.
n4the name of the attribute to set in the mobility model.
v4the value of the attribute to set in the mobility model.
n5the name of the attribute to set in the mobility model.
v5the value of the attribute to set in the mobility model.
n6the name of the attribute to set in the mobility model.
v6the value of the attribute to set in the mobility model.
n7the name of the attribute to set in the mobility model.
v7the value of the attribute to set in the mobility model.
n8the name of the attribute to set in the mobility model.
v8the value of the attribute to set in the mobility model.
n9the name of the attribute to set in the mobility model.
v9the value of the attribute to set in the mobility model.

Definition at line 87 of file group-mobility-helper.cc.

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_memberPosition, NS_ABORT_MSG_IF, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ SetReferenceMobilityModel() [1/2]

void ns3::GroupMobilityHelper::SetReferenceMobilityModel ( Ptr< MobilityModel mobility)

Set the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install.

Parameters
mobilityreference mobility model

Definition at line 114 of file group-mobility-helper.cc.

References m_referenceMobility, and third::mobility.

◆ SetReferenceMobilityModel() [2/2]

void ns3::GroupMobilityHelper::SetReferenceMobilityModel ( std::string  type,
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue (),
std::string  n8 = "",
const AttributeValue v8 = EmptyAttributeValue (),
std::string  n9 = "",
const AttributeValue v9 = EmptyAttributeValue () 
)

Configure the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install.

Parameters
typethe type of mobility model to use.
n1the name of the attribute to set in the mobility model.
v1the value of the attribute to set in the mobility model.
n2the name of the attribute to set in the mobility model.
v2the value of the attribute to set in the mobility model.
n3the name of the attribute to set in the mobility model.
v3the value of the attribute to set in the mobility model.
n4the name of the attribute to set in the mobility model.
v4the value of the attribute to set in the mobility model.
n5the name of the attribute to set in the mobility model.
v5the value of the attribute to set in the mobility model.
n6the name of the attribute to set in the mobility model.
v6the value of the attribute to set in the mobility model.
n7the name of the attribute to set in the mobility model.
v7the value of the attribute to set in the mobility model.
n8the name of the attribute to set in the mobility model.
v8the value of the attribute to set in the mobility model.
n9the name of the attribute to set in the mobility model.
v9the value of the attribute to set in the mobility model.

Definition at line 120 of file group-mobility-helper.cc.

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_referenceMobility, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ SetReferencePositionAllocator() [1/2]

void ns3::GroupMobilityHelper::SetReferencePositionAllocator ( Ptr< PositionAllocator allocator)

Set the position allocator which will be used to allocate the initial position of the reference mobility model.

Parameters
allocatorallocate initial reference mobility model position

Definition at line 48 of file group-mobility-helper.cc.

References m_referencePosition.

◆ SetReferencePositionAllocator() [2/2]

void ns3::GroupMobilityHelper::SetReferencePositionAllocator ( std::string  type,
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue (),
std::string  n5 = "",
const AttributeValue v5 = EmptyAttributeValue (),
std::string  n6 = "",
const AttributeValue v6 = EmptyAttributeValue (),
std::string  n7 = "",
const AttributeValue v7 = EmptyAttributeValue (),
std::string  n8 = "",
const AttributeValue v8 = EmptyAttributeValue (),
std::string  n9 = "",
const AttributeValue v9 = EmptyAttributeValue () 
)

Configure the position allocator which will be used to allocate the initial position of the reference mobility model.

Parameters
typethe type of mobility model to use.
n1the name of the attribute to set in the mobility model.
v1the value of the attribute to set in the mobility model.
n2the name of the attribute to set in the mobility model.
v2the value of the attribute to set in the mobility model.
n3the name of the attribute to set in the mobility model.
v3the value of the attribute to set in the mobility model.
n4the name of the attribute to set in the mobility model.
v4the value of the attribute to set in the mobility model.
n5the name of the attribute to set in the mobility model.
v5the value of the attribute to set in the mobility model.
n6the name of the attribute to set in the mobility model.
v6the value of the attribute to set in the mobility model.
n7the name of the attribute to set in the mobility model.
v7the value of the attribute to set in the mobility model.
n8the name of the attribute to set in the mobility model.
v8the value of the attribute to set in the mobility model.
n9the name of the attribute to set in the mobility model.
v9the value of the attribute to set in the mobility model.

Definition at line 54 of file group-mobility-helper.cc.

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_referencePosition, NS_ABORT_MSG_IF, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_memberMobilityFactory

ObjectFactory ns3::GroupMobilityHelper::m_memberMobilityFactory
private

Object factory to create member mobility models.

Definition at line 283 of file group-mobility-helper.h.

Referenced by Install(), and SetMemberMobilityModel().

◆ m_memberPosition

Ptr<PositionAllocator> ns3::GroupMobilityHelper::m_memberPosition
private

Position allocator for use as member position allocator.

Definition at line 284 of file group-mobility-helper.h.

Referenced by Install(), and SetMemberPositionAllocator().

◆ m_referenceMobility

Ptr<MobilityModel> ns3::GroupMobilityHelper::m_referenceMobility
private

Reference mobility model.

Definition at line 281 of file group-mobility-helper.h.

Referenced by Install(), and SetReferenceMobilityModel().

◆ m_referencePosition

Ptr<PositionAllocator> ns3::GroupMobilityHelper::m_referencePosition
private

Position allocator for use as reference position allocator.

Definition at line 282 of file group-mobility-helper.h.

Referenced by Install(), and SetReferencePositionAllocator().

◆ m_referencePositionSet

bool ns3::GroupMobilityHelper::m_referencePositionSet {false}
private

flag for avoiding multiple SetPosition calls on the reference model

Definition at line 280 of file group-mobility-helper.h.

Referenced by Install().


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