23 #include <ns3/node-list.h>
24 #include <ns3/building.h>
25 #include <ns3/building-list.h>
26 #include <ns3/mobility-model.h>
27 #include <ns3/mobility-building-info.h>
28 #include <ns3/abort.h>
72 NS_ABORT_MSG_UNLESS (0 != bmm,
"node " << (*nit)->GetId () <<
" has a MobilityModel that does not have a MobilityBuildingInfo");
85 NS_LOG_LOGIC (
"checking building " << (*bit)->GetId () <<
" with boundaries " << (*bit)->GetBoundaries ());
87 if ((*bit)->IsInside (pos))
89 NS_LOG_LOGIC (
"MobilityBuildingInfo " << bmm <<
" pos " << mm->
GetPosition () <<
" falls inside building " << (*bit)->GetId ());
90 NS_ABORT_MSG_UNLESS (found ==
false,
" MobilityBuildingInfo already inside another building!");
92 uint16_t floor = (*bit)->GetFloor (pos);
93 uint16_t roomX = (*bit)->GetRoomX (pos);
94 uint16_t roomY = (*bit)->GetRoomY (pos);
95 bmm->SetIndoor (*bit, floor, roomX, roomY);
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Vector GetPosition(void) const
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
static Iterator End(void)
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static Iterator Begin(void)
static void MakeConsistent(Ptr< MobilityModel > bmm)
Make the given mobility model consistent, by determining whether its position falls inside any of the...
Keep track of the current position and velocity of an object.
static void MakeMobilityModelConsistent()
This method goes through the whole NodeList and, for each node in the list, calls BuildingsHelper::Ma...
static Iterator End(void)
std::vector< Ptr< Building > >::const_iterator Iterator
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
uint32_t GetId(void) const
static Iterator Begin(void)
mobility buildings information (to be used by mobility models)
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.