22 #include <ns3/simulator.h>
23 #include <ns3/position-allocator.h>
24 #include <ns3/building-list.h>
25 #include <ns3/mobility-building-info.h>
26 #include <ns3/pointer.h>
28 #include <ns3/assert.h>
41 .SetGroupName (
"Buildings")
68 : m_myBuilding (building)
104 NS_ASSERT (m_roomX <= building->GetNRoomsX ());
106 NS_ASSERT (m_roomY <= building->GetNRoomsY ());
108 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 ());
176 NS_LOG_LOGIC (
"checking building " << (*bit)->GetId () <<
" with boundaries " << (*bit)->GetBoundaries ());
177 if ((*bit)->IsInside (pos))
179 NS_LOG_LOGIC (
"MobilityBuildingInfo " <<
this <<
" pos " << pos <<
" falls inside building " << (*bit)->GetId ());
180 NS_ABORT_MSG_UNLESS (found ==
false,
" 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");
std::vector< Ptr< Building > >::const_iterator Iterator
Const Iterator.
static Iterator End(void)
static Iterator Begin(void)
mobility buildings information (to be used by mobility models)
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.
bool IsIndoor(void)
Is indoor method.
static TypeId GetTypeId(void)
Get the type ID.
bool m_indoor
Node position (indoor/outdoor) ?
uint8_t GetRoomNumberY(void)
Get the room number along y-axis at which the MobilityBuildingInfo instance is located.
virtual void DoInitialize()
Initialize() implementation.
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.
uint8_t GetRoomNumberX(void)
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
void MakeConsistent(Ptr< MobilityModel > mm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
uint8_t GetFloorNumber(void)
Get the floor number at which the MobilityBuildingInfo instance is located.
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
Vector GetPosition(void) 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.