|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include "ns3/group-mobility-helper.h"
24 #include "ns3/mobility-model.h"
25 #include "ns3/position-allocator.h"
26 #include "ns3/hierarchical-mobility-model.h"
28 #include "ns3/pointer.h"
29 #include "ns3/config.h"
30 #include "ns3/simulator.h"
31 #include "ns3/names.h"
32 #include "ns3/string.h"
187 NS_ABORT_MSG_IF (child ==
nullptr,
"Member mobility factory did not produce a MobilityModel");
193 hierarchical->SetChild (child);
201 Ptr<Node> node = Names::Find<Node> (nodeName);
216 int64_t currentStream = stream;
218 bool firstNode =
true;
231 currentStream +=
mobility->GetParent ()->AssignStreams (currentStream);
234 currentStream +=
mobility->GetChild ()->AssignStreams (currentStream);
236 return (currentStream - stream);
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetReferenceMobilityModel(Ptr< MobilityModel > mobility)
Set the reference mobility model which will be installed as the parent mobility model during GroupMob...
Hierarchical mobility model.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Install(Ptr< Node > node)
Install and configure a hierarchical mobility model to the given node, based on the configured refere...
ObjectFactory m_memberMobilityFactory
Object factory to create member mobility models.
void SetMemberPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of the member mobility...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold a value for an Attribute.
void SetPosition(const Vector &position)
bool IsTypeIdSet(void) const
Check if the ObjectFactory has been configured with a TypeId.
Ptr< MobilityModel > m_referenceMobility
Reference mobility model.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Instantiate subclasses of ns3::Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void SetReferencePositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of the reference mobil...
Ptr< PositionAllocator > m_memberPosition
Position allocator for use as member position allocator.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
GroupMobilityHelper()
Construct a group mobility helper.
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 Grou...
Ptr< PositionAllocator > m_referencePosition
Position allocator for use as reference position allocator.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
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 t...
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
bool m_referencePositionSet
flag for avoiding multiple SetPosition calls on the reference model
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Allocate a set of positions.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Keep track of the current position and velocity of an object.
keep track of a set of node pointers.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
~GroupMobilityHelper()
Destroy a group mobility helper.