|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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");
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static Iterator Begin(void)
static TypeId GetTypeId(void)
Get the type ID.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
uint8_t GetRoomNumberX(void)
Get the room number along x-axis at which the MobilityBuildingInfo instance is located.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Iterator End(void)
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< Building > m_myBuilding
Building.
std::vector< Ptr< Building > >::const_iterator Iterator
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.
mobility buildings information (to be used by mobility models)
A base class which provides memory management and object aggregation.
Ptr< Building > GetBuilding()
Get the building in which the MobilityBuildingInfo instance is located.
uint8_t GetRoomNumberY(void)
Get 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.
#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_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
uint8_t m_roomY
The room number along y-axis at which the MobilityBuildingInfo instance is located.
Vector m_cachedPosition
The node position cached after making its mobility model consistent.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
void SetOutdoor()
Mark this MobilityBuildingInfo instance as outdoor.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
bool IsIndoor(void)
Is indoor method.
Vector GetPosition(void) const
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
Mark this MobilityBuildingInfo instance as indoor.
bool m_indoor
Node position (indoor/outdoor) ?
virtual void DoInitialize()
Initialize() implementation.
uint8_t m_nFloor
The floor number at which the MobilityBuildingInfo instance is located.