|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/pointer.h"
23 #include "ns3/simulator.h"
34 static TypeId tid =
TypeId (
"ns3::HierarchicalMobilityModel")
36 .SetGroupName (
"Mobility")
38 .AddAttribute (
"Child",
"The child mobility model.",
42 MakePointerChecker<MobilityModel> ())
43 .AddAttribute (
"Parent",
"The parent mobility model.",
47 MakePointerChecker<MobilityModel> ())
132 return Vector (parentPosition.x + childPosition.x,
133 parentPosition.y + childPosition.y,
134 parentPosition.z + childPosition.z);
149 Vector childPosition (position.x - parentPosition.x,
150 position.y - parentPosition.y,
151 position.z - parentPosition.z);
166 Vector speed (parentSpeed.x + childSpeed.x,
167 parentSpeed.y + childSpeed.y,
168 parentSpeed.z + childSpeed.z);
204 int64_t streamsAllocated = 0;
207 return streamsAllocated;
virtual Vector DoGetPosition(void) const
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Hierarchical mobility model.
void SetParent(Ptr< MobilityModel > model)
Sets the parent mobility model to a new one, possibly replacing an existing one.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected without a context.
void NotifyCourseChange(void) const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
void SetPosition(const Vector &position)
Hold objects of type Ptr<T>.
HierarchicalMobilityModel()
Ptr< MobilityModel > GetChild(void) const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void SetChild(Ptr< MobilityModel > model)
Sets the child mobility model to a new one, possibly replacing an existing one.
Ptr< MobilityModel > GetParent(void) const
Ptr< MobilityModel > m_child
pointer to child mobility model
void ParentChanged(Ptr< const MobilityModel > model)
Callback for when parent mobility model course change occurs.
Vector GetVelocity(void) const
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual int64_t DoAssignStreams(int64_t)
The default implementation does nothing but return the passed-in parameter.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual Vector DoGetVelocity(void) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void ChildChanged(Ptr< const MobilityModel > model)
Callback for when child mobility model course change occurs.
#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.
virtual void DoSetPosition(const Vector &position)
virtual void DoInitialize(void)
Initialize() implementation.
Vector GetPositionWithReference(const Vector &referencePosition) const
This method may be used if the position returned may depend on some reference position provided.
static TypeId GetTypeId(void)
Register this type with the TypeId system.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Vector GetPosition(void) const
Ptr< MobilityModel > m_parent
pointer to parent mobility model
bool IsInitialized(void) const
Check if the object has been initialized.