A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
mobility-model.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006,2007 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef MOBILITY_MODEL_H
21
#define MOBILITY_MODEL_H
22
23
#include "ns3/vector.h"
24
#include "ns3/object.h"
25
#include "ns3/traced-callback.h"
26
27
namespace
ns3
{
28
39
class
MobilityModel
:
public
Object
40
{
41
public
:
46
static
TypeId
GetTypeId
(
void
);
47
MobilityModel
();
48
virtual
~MobilityModel
() = 0;
49
53
Vector
GetPosition
(
void
)
const
;
65
Vector
GetPositionWithReference
(
const
Vector &referencePosition)
const
;
69
void
SetPosition
(
const
Vector &position);
73
Vector
GetVelocity
(
void
)
const
;
78
double
GetDistanceFrom
(
Ptr<const MobilityModel>
position)
const
;
83
double
GetRelativeSpeed
(
Ptr<const MobilityModel>
other)
const
;
92
int64_t
AssignStreams
(int64_t stream);
93
99
typedef
void (*
TracedCallback
)(
Ptr<const MobilityModel>
model);
100
101
protected
:
106
void
NotifyCourseChange
(
void
)
const
;
107
private
:
114
virtual
Vector
DoGetPosition
(
void
)
const
= 0;
122
virtual
Vector
DoGetPositionWithReference
(
const
Vector& referencePosition)
const
;
129
virtual
void
DoSetPosition
(
const
Vector &position) = 0;
136
virtual
Vector
DoGetVelocity
(
void
)
const
= 0;
144
virtual
int64_t
DoAssignStreams
(int64_t
start
);
145
150
ns3::TracedCallback<Ptr<const MobilityModel>
>
m_courseChangeTrace
;
151
152
};
153
154
}
// namespace ns3
155
156
#endif
/* MOBILITY_MODEL_H */
ns3::MobilityModel
Keep track of the current position and velocity of an object.
Definition:
mobility-model.h:40
ns3::MobilityModel::m_courseChangeTrace
ns3::TracedCallback< Ptr< const MobilityModel > > m_courseChangeTrace
Used to alert subscribers that a change in direction, velocity, or position has occurred.
Definition:
mobility-model.h:150
ns3::MobilityModel::~MobilityModel
virtual ~MobilityModel()=0
Definition:
mobility-model.cc:59
ns3::MobilityModel::GetPositionWithReference
Vector GetPositionWithReference(const Vector &referencePosition) const
This method may be used if the position returned may depend on some reference position provided.
Definition:
mobility-model.cc:69
ns3::MobilityModel::GetTypeId
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Definition:
mobility-model.cc:31
ns3::MobilityModel::GetDistanceFrom
double GetDistanceFrom(Ptr< const MobilityModel > position) const
Definition:
mobility-model.cc:94
ns3::MobilityModel::GetVelocity
Vector GetVelocity(void) const
Definition:
mobility-model.cc:82
ns3::MobilityModel::DoGetPosition
virtual Vector DoGetPosition(void) const =0
ns3::MobilityModel::GetRelativeSpeed
double GetRelativeSpeed(Ptr< const MobilityModel > other) const
Definition:
mobility-model.cc:102
ns3::MobilityModel::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
mobility-model.cc:114
ns3::MobilityModel::DoGetPositionWithReference
virtual Vector DoGetPositionWithReference(const Vector &referencePosition) const
Definition:
mobility-model.cc:76
ns3::MobilityModel::NotifyCourseChange
void NotifyCourseChange(void) const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
Definition:
mobility-model.cc:108
ns3::MobilityModel::DoSetPosition
virtual void DoSetPosition(const Vector &position)=0
ns3::MobilityModel::DoAssignStreams
virtual int64_t DoAssignStreams(int64_t start)
The default implementation does nothing but return the passed-in parameter.
Definition:
mobility-model.cc:121
ns3::MobilityModel::SetPosition
void SetPosition(const Vector &position)
Definition:
mobility-model.cc:88
ns3::MobilityModel::DoGetVelocity
virtual Vector DoGetVelocity(void) const =0
ns3::MobilityModel::GetPosition
Vector GetPosition(void) const
Definition:
mobility-model.cc:64
ns3::MobilityModel::MobilityModel
MobilityModel()
Definition:
mobility-model.cc:55
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:88
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:53
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
visualizer.core.start
def start()
Definition:
core.py:1853
src
mobility
model
mobility-model.h
Generated on Tue Feb 6 2024 19:21:24 for ns-3 by
1.9.1