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. 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< PositionAllocator > | m_memberPosition |
Position allocator for use as member position allocator. More... | |
Ptr< MobilityModel > | m_referenceMobility |
Reference mobility model. More... | |
Ptr< PositionAllocator > | m_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... | |
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.
ns3::GroupMobilityHelper::GroupMobilityHelper | ( | ) |
Construct a group mobility helper.
Definition at line 39 of file group-mobility-helper.cc.
ns3::GroupMobilityHelper::~GroupMobilityHelper | ( | ) |
Destroy a group mobility helper.
Definition at line 43 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 214 of file group-mobility-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Object::GetObject(), third::mobility, 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 206 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 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().
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 199 of file group-mobility-helper.cc.
References Install().
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.
type | the type of mobility model to use. |
n1 | the name of the attribute to set in the mobility model. |
v1 | the value of the attribute to set in the mobility model. |
n2 | the name of the attribute to set in the mobility model. |
v2 | the value of the attribute to set in the mobility model. |
n3 | the name of the attribute to set in the mobility model. |
v3 | the value of the attribute to set in the mobility model. |
n4 | the name of the attribute to set in the mobility model. |
v4 | the value of the attribute to set in the mobility model. |
n5 | the name of the attribute to set in the mobility model. |
v5 | the value of the attribute to set in the mobility model. |
n6 | the name of the attribute to set in the mobility model. |
v6 | the value of the attribute to set in the mobility model. |
n7 | the name of the attribute to set in the mobility model. |
v7 | the value of the attribute to set in the mobility model. |
n8 | the name of the attribute to set in the mobility model. |
v8 | the value of the attribute to set in the mobility model. |
n9 | the name of the attribute to set in the mobility model. |
v9 | the 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().
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 81 of file group-mobility-helper.cc.
References m_memberPosition.
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.
type | the type of mobility model to use. |
n1 | the name of the attribute to set in the mobility model. |
v1 | the value of the attribute to set in the mobility model. |
n2 | the name of the attribute to set in the mobility model. |
v2 | the value of the attribute to set in the mobility model. |
n3 | the name of the attribute to set in the mobility model. |
v3 | the value of the attribute to set in the mobility model. |
n4 | the name of the attribute to set in the mobility model. |
v4 | the value of the attribute to set in the mobility model. |
n5 | the name of the attribute to set in the mobility model. |
v5 | the value of the attribute to set in the mobility model. |
n6 | the name of the attribute to set in the mobility model. |
v6 | the value of the attribute to set in the mobility model. |
n7 | the name of the attribute to set in the mobility model. |
v7 | the value of the attribute to set in the mobility model. |
n8 | the name of the attribute to set in the mobility model. |
v8 | the value of the attribute to set in the mobility model. |
n9 | the name of the attribute to set in the mobility model. |
v9 | the 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().
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 114 of file group-mobility-helper.cc.
References m_referenceMobility, and third::mobility.
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.
type | the type of mobility model to use. |
n1 | the name of the attribute to set in the mobility model. |
v1 | the value of the attribute to set in the mobility model. |
n2 | the name of the attribute to set in the mobility model. |
v2 | the value of the attribute to set in the mobility model. |
n3 | the name of the attribute to set in the mobility model. |
v3 | the value of the attribute to set in the mobility model. |
n4 | the name of the attribute to set in the mobility model. |
v4 | the value of the attribute to set in the mobility model. |
n5 | the name of the attribute to set in the mobility model. |
v5 | the value of the attribute to set in the mobility model. |
n6 | the name of the attribute to set in the mobility model. |
v6 | the value of the attribute to set in the mobility model. |
n7 | the name of the attribute to set in the mobility model. |
v7 | the value of the attribute to set in the mobility model. |
n8 | the name of the attribute to set in the mobility model. |
v8 | the value of the attribute to set in the mobility model. |
n9 | the name of the attribute to set in the mobility model. |
v9 | the 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().
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 48 of file group-mobility-helper.cc.
References m_referencePosition.
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.
type | the type of mobility model to use. |
n1 | the name of the attribute to set in the mobility model. |
v1 | the value of the attribute to set in the mobility model. |
n2 | the name of the attribute to set in the mobility model. |
v2 | the value of the attribute to set in the mobility model. |
n3 | the name of the attribute to set in the mobility model. |
v3 | the value of the attribute to set in the mobility model. |
n4 | the name of the attribute to set in the mobility model. |
v4 | the value of the attribute to set in the mobility model. |
n5 | the name of the attribute to set in the mobility model. |
v5 | the value of the attribute to set in the mobility model. |
n6 | the name of the attribute to set in the mobility model. |
v6 | the value of the attribute to set in the mobility model. |
n7 | the name of the attribute to set in the mobility model. |
v7 | the value of the attribute to set in the mobility model. |
n8 | the name of the attribute to set in the mobility model. |
v8 | the value of the attribute to set in the mobility model. |
n9 | the name of the attribute to set in the mobility model. |
v9 | the 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().
|
private |
Object factory to create member mobility models.
Definition at line 283 of file group-mobility-helper.h.
Referenced by Install(), and SetMemberMobilityModel().
|
private |
Position allocator for use as member position allocator.
Definition at line 284 of file group-mobility-helper.h.
Referenced by Install(), and SetMemberPositionAllocator().
|
private |
Reference mobility model.
Definition at line 281 of file group-mobility-helper.h.
Referenced by Install(), and SetReferenceMobilityModel().
|
private |
Position allocator for use as reference position allocator.
Definition at line 282 of file group-mobility-helper.h.
Referenced by Install(), and SetReferencePositionAllocator().
|
private |
flag for avoiding multiple SetPosition calls on the reference model
Definition at line 280 of file group-mobility-helper.h.
Referenced by Install().