Helper class used to assign positions and mobility models to nodes for a group mobility configuration. More...
#include "group-mobility-helper.h"
Public Member Functions | |
GroupMobilityHelper () | |
Construct a group mobility helper. | |
~GroupMobilityHelper () | |
Destroy a group mobility helper. | |
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. | |
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. | |
void | Install (Ptr< Node > node) |
Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models. | |
void | Install (std::string nodeName) |
Install and configure a hierarchical mobility model to the given node, based on the configured reference and member models. | |
template<typename... Ts> | |
void | SetMemberMobilityModel (std::string type, Ts &&... args) |
Configure the mobility model which will be installed as the member (child) mobility model during GroupMobilityModel::Install. | |
void | SetMemberPositionAllocator (Ptr< PositionAllocator > allocator) |
Set the position allocator which will be used to allocate the initial position of the member mobility models. | |
template<typename... Ts> | |
void | SetMemberPositionAllocator (std::string type, Ts &&... args) |
Configure the position allocator which will be used to allocate the initial position of the member mobility models. | |
void | SetReferenceMobilityModel (Ptr< MobilityModel > mobility) |
Set the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install. | |
template<typename... Ts> | |
void | SetReferenceMobilityModel (std::string type, Ts &&... args) |
Configure the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install. | |
void | SetReferencePositionAllocator (Ptr< PositionAllocator > allocator) |
Set the position allocator which will be used to allocate the initial position of the reference mobility model. | |
template<typename... Ts> | |
void | SetReferencePositionAllocator (std::string type, Ts &&... args) |
Configure the position allocator which will be used to allocate the initial position of the reference mobility model. | |
Private Attributes | |
ObjectFactory | m_memberMobilityFactory |
Object factory to create member mobility models. | |
Ptr< PositionAllocator > | m_memberPosition |
Position allocator for use as member position allocator. | |
Ptr< MobilityModel > | m_referenceMobility |
Reference mobility model. | |
Ptr< PositionAllocator > | m_referencePosition |
Position allocator for use as reference position allocator. | |
bool | m_referencePositionSet |
flag for avoiding multiple SetPosition calls on the reference model | |
NS_LOG_TEMPLATE_DECLARE | |
the log component | |
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 36 of file group-mobility-helper.h.
ns3::GroupMobilityHelper::GroupMobilityHelper | ( | ) |
Construct a group mobility helper.
Definition at line 30 of file group-mobility-helper.cc.
ns3::GroupMobilityHelper::~GroupMobilityHelper | ( | ) |
Destroy a group mobility helper.
Definition at line 35 of file group-mobility-helper.cc.
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.
c | NodeContainer of the set of nodes containing the MobilityModels that should be modified to use a fixed stream |
stream | first stream index to use |
Definition at line 100 of file group-mobility-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and NS_FATAL_ERROR.
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.
container | The set of nodes to configure |
Definition at line 91 of file group-mobility-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().
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.
node | The node to configure |
Definition at line 58 of file group-mobility-helper.cc.
References ns3::ObjectFactory::Create(), ns3::CreateObject(), ns3::Object::GetObject(), ns3::ObjectFactory::IsTypeIdSet(), m_memberMobilityFactory, m_memberPosition, m_referenceMobility, m_referencePosition, m_referencePositionSet, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, and NS_LOG_DEBUG.
Referenced by Install(), and Install().
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.
nodeName | The name of the node to configure |
Definition at line 84 of file group-mobility-helper.cc.
References ns3::Names::Find(), and Install().
void ns3::GroupMobilityHelper::SetMemberMobilityModel | ( | std::string | type, |
Ts &&... | args ) |
Configure the mobility model which will be installed as the member (child) mobility model during GroupMobilityModel::Install.
Calls to MobilityHelper::Install will create an instance of a matching mobility model for each node.
Ts | [deduced] Argument types |
type | the type of mobility model to use. | |
[in] | args | Name and AttributeValue pairs to set. |
Definition at line 220 of file group-mobility-helper.h.
References m_memberMobilityFactory, NS_LOG_FUNCTION, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
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.
allocator | allocate initial member mobility model positions |
Definition at line 46 of file group-mobility-helper.cc.
References m_memberPosition.
void ns3::GroupMobilityHelper::SetMemberPositionAllocator | ( | std::string | type, |
Ts &&... | args ) |
Configure the position allocator which will be used to allocate the initial position of the member mobility models.
Ts | [deduced] Argument types |
type | the type of position allocator to use. | |
[in] | args | Name and AttributeValue pairs to set. |
Definition at line 201 of file group-mobility-helper.h.
References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_memberPosition, and NS_ABORT_MSG_IF.
void ns3::GroupMobilityHelper::SetReferenceMobilityModel | ( | Ptr< MobilityModel > | mobility | ) |
Set the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install.
mobility | reference mobility model |
Definition at line 52 of file group-mobility-helper.cc.
References m_referenceMobility.
void ns3::GroupMobilityHelper::SetReferenceMobilityModel | ( | std::string | type, |
Ts &&... | args ) |
Configure the reference mobility model which will be installed as the parent mobility model during GroupMobilityModel::Install.
Ts | [deduced] Argument types |
type | the type of mobility model to use. | |
[in] | args | Name and AttributeValue pairs to set. |
Definition at line 210 of file group-mobility-helper.h.
References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_referenceMobility, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
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.
allocator | allocate initial reference mobility model position |
Definition at line 40 of file group-mobility-helper.cc.
References m_referencePosition.
void ns3::GroupMobilityHelper::SetReferencePositionAllocator | ( | std::string | type, |
Ts &&... | args ) |
Configure the position allocator which will be used to allocate the initial position of the reference mobility model.
Ts | [deduced] Argument types |
type | the type of position allocator to use. | |
[in] | args | Name and AttributeValue pairs to set. |
Definition at line 192 of file group-mobility-helper.h.
References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_referencePosition, and NS_ABORT_MSG_IF.
|
private |
Object factory to create member mobility models.
Definition at line 181 of file group-mobility-helper.h.
Referenced by Install(), and SetMemberMobilityModel().
|
private |
Position allocator for use as member position allocator.
Definition at line 183 of file group-mobility-helper.h.
Referenced by Install(), SetMemberPositionAllocator(), and SetMemberPositionAllocator().
|
private |
Reference mobility model.
Definition at line 178 of file group-mobility-helper.h.
Referenced by Install(), SetReferenceMobilityModel(), and SetReferenceMobilityModel().
|
private |
Position allocator for use as reference position allocator.
Definition at line 180 of file group-mobility-helper.h.
Referenced by Install(), SetReferencePositionAllocator(), and SetReferencePositionAllocator().
|
private |
flag for avoiding multiple SetPosition calls on the reference model
Definition at line 176 of file group-mobility-helper.h.
Referenced by Install().
|
private |
the log component
Definition at line 174 of file group-mobility-helper.h.