25 #include <ns3/assert.h>
27 #include <ns3/pointer.h>
28 #include <ns3/position-allocator.h>
29 #include <ns3/simulator.h>
43 .SetGroupName(
"Buildings")
68 : m_myBuilding(building)
106 NS_ASSERT(m_roomX <= building->GetNRoomsX());
108 NS_ASSERT(m_roomY <= building->GetNRoomsY());
110 NS_ASSERT(m_nFloor <= building->GetNFloors());
124 NS_ASSERT(m_roomX <= m_myBuilding->GetNRoomsX());
126 NS_ASSERT(m_roomY <= m_myBuilding->GetNRoomsY());
128 NS_ASSERT(m_nFloor <= m_myBuilding->GetNFloors());
173 NS_LOG_LOGIC(
"checking building " << (*bit)->GetId() <<
" with boundaries "
174 << (*bit)->GetBoundaries());
175 if ((*bit)->IsInside(pos))
177 NS_LOG_LOGIC(
"MobilityBuildingInfo " <<
this <<
" pos " << pos
178 <<
" falls inside building " << (*bit)->GetId());
180 " MobilityBuildingInfo already inside another building!");
182 uint16_t floor = (*bit)->GetFloor(pos);
183 uint16_t roomX = (*bit)->GetRoomX(pos);
184 uint16_t roomY = (*bit)->GetRoomY(pos);
190 NS_LOG_LOGIC(
"MobilityBuildingInfo " <<
this <<
" pos " << pos <<
" is outdoor");
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.
Vector GetPosition() const
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.