A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
mobility-building-info.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Marco Miozzo <marco.miozzo@cttc.es>
18
*
19
*/
20
#ifndef MOBILITY_BUILDING_INFO_H
21
#define MOBILITY_BUILDING_INFO_H
22
23
#include "
building.h
"
24
25
#include <ns3/box.h>
26
#include <ns3/constant-velocity-helper.h>
27
#include <ns3/mobility-model.h>
28
#include <ns3/object.h>
29
#include <ns3/ptr.h>
30
#include <ns3/simple-ref-count.h>
31
32
#include <map>
33
34
namespace
ns3
35
{
36
37
/**
38
* \ingroup buildings
39
* \ingroup mobility
40
41
* \brief mobility buildings information (to be used by mobility models)
42
*
43
* This model implements the management of scenarios where users might be
44
* either indoor (e.g., houses, offices, etc.) and outdoor.
45
*
46
*/
47
class
MobilityBuildingInfo
:
public
Object
48
{
49
public
:
50
/**
51
* \brief Get the type ID.
52
*
53
* \return the object TypeId
54
*/
55
static
TypeId
GetTypeId
();
56
MobilityBuildingInfo
();
57
58
/**
59
* \brief Parameterized constructor
60
*
61
* \param building The building in which the MobilityBuildingInfo instance would be placed
62
*/
63
MobilityBuildingInfo
(
Ptr<Building>
building);
64
65
/**
66
* \brief Is indoor method.
67
*
68
* \return true if the MobilityBuildingInfo instance is indoor, false otherwise
69
*/
70
bool
IsIndoor
();
71
72
/**
73
* \brief Mark this MobilityBuildingInfo instance as indoor
74
*
75
* \param building the building into which the MobilityBuildingInfo instance is located
76
* \param nfloor the floor number 1...nFloors at which the MobilityBuildingInfo instance
77
* is located
78
* \param nroomx the X room number 1...nRoomsX at which the MobilityBuildingInfo instance
79
* is located
80
* \param nroomy the Y room number 1...nRoomsY at which the MobilityBuildingInfo instance
81
* is located
82
*/
83
void
SetIndoor
(
Ptr<Building>
building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
84
85
/**
86
* \brief Mark this MobilityBuildingInfo instance as indoor
87
*
88
* \param nfloor the floor number 1...nFloors at which the MobilityBuildingInfo instance
89
* is located
90
* \param nroomx the X room number 1...nRoomsX at which the MobilityBuildingInfo instance
91
* is located
92
* \param nroomy the Y room number 1...nRoomsY at which the MobilityBuildingInfo instance
93
* is located
94
*/
95
96
void
SetIndoor
(uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
97
98
/**
99
* \brief Mark this MobilityBuildingInfo instance as outdoor
100
*/
101
void
SetOutdoor
();
102
103
/**
104
* \brief Get the floor number at which the MobilityBuildingInfo instance is located
105
*
106
* \return The floor number
107
*/
108
uint8_t
GetFloorNumber
();
109
110
/**
111
* \brief Get the room number along x-axis at which the MobilityBuildingInfo instance is located
112
*
113
* \return The room number
114
*/
115
uint8_t
GetRoomNumberX
();
116
117
/**
118
* \brief Get the room number along y-axis at which the MobilityBuildingInfo instance is located
119
*
120
* \return The room number
121
*/
122
uint8_t
GetRoomNumberY
();
123
124
/**
125
* \brief Get the building in which the MobilityBuildingInfo instance is located
126
*
127
* \return The building in which the MobilityBuildingInfo instance is located
128
*/
129
Ptr<Building>
GetBuilding
();
130
/**
131
* \brief Make the given mobility model consistent, by determining whether
132
* its position falls inside any of the building in BuildingList, and
133
* updating accordingly the BuildingInfo aggregated with the MobilityModel.
134
*
135
* \param mm the mobility model to be made consistent
136
*/
137
void
MakeConsistent
(
Ptr<MobilityModel>
mm);
138
139
protected
:
140
// inherited from Object
141
void
DoInitialize
()
override
;
142
143
private
:
144
Ptr<Building>
m_myBuilding
;
///< Building
145
bool
m_indoor
;
///< Node position (indoor/outdoor) ?
146
uint8_t
m_nFloor
;
///< The floor number at which the MobilityBuildingInfo instance is located
147
uint8_t
m_roomX
;
///< The room number along x-axis at which the MobilityBuildingInfo instance is
148
///< located
149
uint8_t
m_roomY
;
///< The room number along y-axis at which the MobilityBuildingInfo instance is
150
///< located
151
Vector
152
m_cachedPosition
;
///< The node position cached after making its mobility model consistent
153
};
154
155
}
// namespace ns3
156
157
#endif
// MOBILITY_BUILDING_INFO_H
building.h
ns3::MobilityBuildingInfo
mobility buildings information (to be used by mobility models)
Definition:
mobility-building-info.h:48
ns3::MobilityBuildingInfo::GetFloorNumber
uint8_t GetFloorNumber()
Get the floor number at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.cc:139
ns3::MobilityBuildingInfo::IsIndoor
bool IsIndoor()
Is indoor method.
Definition:
mobility-building-info.cc:78
ns3::MobilityBuildingInfo::GetBuilding
Ptr< Building > GetBuilding()
Get the building in which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.cc:160
ns3::MobilityBuildingInfo::m_roomX
uint8_t m_roomX
The room number along x-axis at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.h:147
ns3::MobilityBuildingInfo::m_myBuilding
Ptr< Building > m_myBuilding
Building.
Definition:
mobility-building-info.h:144
ns3::MobilityBuildingInfo::m_roomY
uint8_t m_roomY
The room number along y-axis at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.h:149
ns3::MobilityBuildingInfo::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
mobility-building-info.cc:39
ns3::MobilityBuildingInfo::m_indoor
bool m_indoor
Node position (indoor/outdoor) ?
Definition:
mobility-building-info.h:145
ns3::MobilityBuildingInfo::MobilityBuildingInfo
MobilityBuildingInfo()
Definition:
mobility-building-info.cc:57
ns3::MobilityBuildingInfo::DoInitialize
void DoInitialize() override
Initialize() implementation.
Definition:
mobility-building-info.cc:50
ns3::MobilityBuildingInfo::GetRoomNumberX
uint8_t GetRoomNumberX()
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.cc:146
ns3::MobilityBuildingInfo::GetRoomNumberY
uint8_t GetRoomNumberY()
Get the room number along y-axis at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.cc:153
ns3::MobilityBuildingInfo::SetIndoor
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
Mark this MobilityBuildingInfo instance as indoor.
Definition:
mobility-building-info.cc:93
ns3::MobilityBuildingInfo::m_nFloor
uint8_t m_nFloor
The floor number at which the MobilityBuildingInfo instance is located.
Definition:
mobility-building-info.h:146
ns3::MobilityBuildingInfo::SetOutdoor
void SetOutdoor()
Mark this MobilityBuildingInfo instance as outdoor.
Definition:
mobility-building-info.cc:132
ns3::MobilityBuildingInfo::MakeConsistent
void MakeConsistent(Ptr< MobilityModel > mm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
Definition:
mobility-building-info.cc:167
ns3::MobilityBuildingInfo::m_cachedPosition
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
Definition:
mobility-building-info.h:152
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
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.
src
buildings
model
mobility-building-info.h
Generated on Tue May 28 2024 23:34:16 for ns-3 by
1.9.6