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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Marco Miozzo <marco.miozzo@cttc.es>
7 *
8 */
9#ifndef MOBILITY_BUILDING_INFO_H
10#define MOBILITY_BUILDING_INFO_H
11
12#include "building.h"
13
14#include <ns3/box.h>
15#include <ns3/constant-velocity-helper.h>
16#include <ns3/mobility-model.h>
17#include <ns3/object.h>
18#include <ns3/ptr.h>
19#include <ns3/simple-ref-count.h>
20
21#include <map>
22
23namespace ns3
24{
25
26/**
27 * \ingroup buildings
28 * \ingroup mobility
29
30 * \brief mobility buildings information (to be used by mobility models)
31 *
32 * This model implements the management of scenarios where users might be
33 * either indoor (e.g., houses, offices, etc.) and outdoor.
34 *
35 */
37{
38 public:
39 /**
40 * \brief Get the type ID.
41 *
42 * \return the object TypeId
43 */
44 static TypeId GetTypeId();
46
47 /**
48 * \brief Parameterized constructor
49 *
50 * \param building The building in which the MobilityBuildingInfo instance would be placed
51 */
53
54 /**
55 * \brief Is indoor method.
56 *
57 * \return true if the MobilityBuildingInfo instance is indoor, false otherwise
58 */
59 bool IsIndoor();
60
61 /**
62 * \brief Mark this MobilityBuildingInfo instance as indoor
63 *
64 * \param building the building into which the MobilityBuildingInfo instance is located
65 * \param nfloor the floor number 1...nFloors at which the MobilityBuildingInfo instance
66 * is located
67 * \param nroomx the X room number 1...nRoomsX at which the MobilityBuildingInfo instance
68 * is located
69 * \param nroomy the Y room number 1...nRoomsY at which the MobilityBuildingInfo instance
70 * is located
71 */
72 void SetIndoor(Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
73
74 /**
75 * \brief Mark this MobilityBuildingInfo instance as indoor
76 *
77 * \param nfloor the floor number 1...nFloors at which the MobilityBuildingInfo instance
78 * is located
79 * \param nroomx the X room number 1...nRoomsX at which the MobilityBuildingInfo instance
80 * is located
81 * \param nroomy the Y room number 1...nRoomsY at which the MobilityBuildingInfo instance
82 * is located
83 */
84
85 void SetIndoor(uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
86
87 /**
88 * \brief Mark this MobilityBuildingInfo instance as outdoor
89 */
90 void SetOutdoor();
91
92 /**
93 * \brief Get the floor number at which the MobilityBuildingInfo instance is located
94 *
95 * \return The floor number
96 */
97 uint8_t GetFloorNumber();
98
99 /**
100 * \brief Get the room number along x-axis at which the MobilityBuildingInfo instance is located
101 *
102 * \return The room number
103 */
104 uint8_t GetRoomNumberX();
105
106 /**
107 * \brief Get the room number along y-axis at which the MobilityBuildingInfo instance is located
108 *
109 * \return The room number
110 */
111 uint8_t GetRoomNumberY();
112
113 /**
114 * \brief Get the building in which the MobilityBuildingInfo instance is located
115 *
116 * \return The building in which the MobilityBuildingInfo instance is located
117 */
119 /**
120 * \brief Make the given mobility model consistent, by determining whether
121 * its position falls inside any of the building in BuildingList, and
122 * updating accordingly the BuildingInfo aggregated with the MobilityModel.
123 *
124 * \param mm the mobility model to be made consistent
125 */
127
128 protected:
129 // inherited from Object
130 void DoInitialize() override;
131
132 private:
134 bool m_indoor; ///< Node position (indoor/outdoor) ?
135 uint8_t m_nFloor; ///< The floor number at which the MobilityBuildingInfo instance is located
136 uint8_t m_roomX; ///< The room number along x-axis at which the MobilityBuildingInfo instance is
137 ///< located
138 uint8_t m_roomY; ///< The room number along y-axis at which the MobilityBuildingInfo instance is
139 ///< located
140 Vector
141 m_cachedPosition; ///< The node position cached after making its mobility model consistent
142};
143
144} // namespace ns3
145
146#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:78
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.