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)
112 NS_ASSERT (m_roomX <= building->GetNRoomsX ());
114 NS_ASSERT (m_roomY <= building->GetNRoomsY ());
116 NS_ASSERT (m_nFloor <= building->GetNFloors ());
132 NS_ASSERT (m_roomX <= m_myBuilding->GetNRoomsX ());
134 NS_ASSERT (m_roomY <= m_myBuilding->GetNRoomsY ());
136 NS_ASSERT (m_nFloor <= m_myBuilding->GetNFloors ());
184 NS_LOG_LOGIC (
"checking building " << (*bit)->GetId () <<
" with boundaries " << (*bit)->GetBoundaries ());
185 if ((*bit)->IsInside (pos))
187 NS_LOG_LOGIC (
"MobilityBuildingInfo " <<
this <<
" pos " << pos <<
" falls inside building " << (*bit)->GetId ());
188 NS_ABORT_MSG_UNLESS (found ==
false,
" MobilityBuildingInfo already inside another building!");
190 uint16_t floor = (*bit)->GetFloor (pos);
191 uint16_t roomX = (*bit)->GetRoomX (pos);
192 uint16_t roomY = (*bit)->GetRoomY (pos);
198 NS_LOG_LOGIC (
"MobilityBuildingInfo " <<
this <<
" pos " << pos <<
" is outdoor");
#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.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetOutdoor()
Mark this MobilityBuildingInfo instance as outdoor.
uint8_t m_nFloor
The floor number at which the MobilityBuildingInfo instance is located.
static Iterator End(void)
uint8_t m_roomY
The room number along y-axis at which the MobilityBuildingInfo instance is located.
uint8_t m_roomX
The room number along x-axis at which the MobilityBuildingInfo instance is located.
static Iterator Begin(void)
uint8_t GetFloorNumber(void)
Get the floor number at which the MobilityBuildingInfo instance is located.
uint8_t GetRoomNumberX(void)
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
bool IsIndoor(void)
Is indoor method.
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
Mark this MobilityBuildingInfo instance as indoor.
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
Ptr< Building > m_myBuilding
Building.
std::vector< Ptr< Building > >::const_iterator Iterator
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoInitialize()
Initialize() implementation.
NS_DEPRECATED_3_31 bool IsOutdoor(void)
Is outdoor function.
static TypeId GetTypeId(void)
Get the type ID.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Vector GetPosition(void) const
Ptr< Building > GetBuilding()
Get the building in which the MobilityBuildingInfo instance is located.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
mobility buildings information (to be used by mobility models)
A base class which provides memory management and object aggregation.
void MakeConsistent(Ptr< MobilityModel > mm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
bool m_indoor
Node position (indoor/outdoor) ?
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint8_t GetRoomNumberY(void)
Get the room number along y-axis at which the MobilityBuildingInfo instance is located.