11#include "ns3/pointer.h"
12#include "ns3/simulator.h"
25 TypeId(
"ns3::HierarchicalMobilityModel")
27 .SetGroupName(
"Mobility")
29 .AddAttribute(
"Child",
30 "The child mobility model.",
35 .AddAttribute(
"Parent",
36 "The parent mobility model.",
61 m_child->TraceDisconnectWithoutContext(
66 m_child->TraceConnectWithoutContext(
91 m_parent->TraceDisconnectWithoutContext(
98 m_parent->TraceConnectWithoutContext(
156 m_child->SetPosition(position);
Hierarchical mobility model.
Ptr< MobilityModel > m_child
pointer to child mobility model
Ptr< MobilityModel > GetChild() const
Vector DoGetVelocity() const override
void ChildChanged(Ptr< const MobilityModel > model)
Callback for when child mobility model course change occurs.
Ptr< MobilityModel > m_parent
pointer to parent mobility model
void DoSetPosition(const Vector &position) override
void SetParent(Ptr< MobilityModel > model)
Sets the parent mobility model to a new one, possibly replacing an existing one.
HierarchicalMobilityModel()
Vector DoGetPosition() const override
static TypeId GetTypeId()
Register this type with the TypeId system.
Ptr< MobilityModel > GetParent() const
void DoInitialize() override
Initialize() implementation.
void SetChild(Ptr< MobilityModel > model)
Sets the child mobility model to a new one, possibly replacing an existing one.
void ParentChanged(Ptr< const MobilityModel > model)
Callback for when parent mobility model course change occurs.
int64_t DoAssignStreams(int64_t) override
The default implementation does nothing but return the passed-in parameter.
Keep track of the current position and velocity of an object.
Vector GetPosition() const
void SetPosition(const Vector &position)
void NotifyCourseChange() const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)