A Discrete-Event Network Simulator
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
34namespace 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 */
48{
49 public:
50 /**
51 * \brief Get the type ID.
52 *
53 * \return the object TypeId
54 */
55 static TypeId GetTypeId();
57
58 /**
59 * \brief Parameterized constructor
60 *
61 * \param building The building in which the MobilityBuildingInfo instance would be placed
62 */
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 */
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 */
138
139 protected:
140 // inherited from Object
141 void DoInitialize() override;
142
143 private:
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
mobility buildings information (to be used by mobility models)
uint8_t GetFloorNumber()
Get the floor number at which the MobilityBuildingInfo instance is located.
bool IsIndoor()
Is indoor method.
Ptr< Building > GetBuilding()
Get the building in which the MobilityBuildingInfo instance is located.
uint8_t m_roomX
The room number along x-axis at which the MobilityBuildingInfo instance is located.
Ptr< Building > m_myBuilding
Building.
uint8_t m_roomY
The room number along y-axis at which the MobilityBuildingInfo instance is located.
static TypeId GetTypeId()
Get the type ID.
bool m_indoor
Node position (indoor/outdoor) ?
void DoInitialize() override
Initialize() implementation.
uint8_t GetRoomNumberX()
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
uint8_t GetRoomNumberY()
Get the room number along y-axis at which the MobilityBuildingInfo instance is located.
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
Mark this MobilityBuildingInfo instance as indoor.
uint8_t m_nFloor
The floor number at which the MobilityBuildingInfo instance is located.
void SetOutdoor()
Mark this MobilityBuildingInfo instance as outdoor.
void MakeConsistent(Ptr< MobilityModel > mm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.