src/buildings/model/buildings-mobility-model.cc
changeset 8768 e5607ee90a49
parent 8556 f859539f5dd3
child 8769 292e9e8345cf
equal deleted inserted replaced
8767:76e71d929a3f 8768:e5607ee90a49
    22 #include <ns3/simulator.h>
    22 #include <ns3/simulator.h>
    23 #include <ns3/position-allocator.h>
    23 #include <ns3/position-allocator.h>
    24 #include <ns3/buildings-mobility-model.h>
    24 #include <ns3/buildings-mobility-model.h>
    25 #include <ns3/pointer.h>
    25 #include <ns3/pointer.h>
    26 #include <ns3/log.h>
    26 #include <ns3/log.h>
       
    27 #include <ns3/assert.h>
    27 
    28 
    28 NS_LOG_COMPONENT_DEFINE ("BuildingsMobilityModel");
    29 NS_LOG_COMPONENT_DEFINE ("BuildingsMobilityModel");
    29 
    30 
    30 namespace ns3 {
    31 namespace ns3 {
    31 
    32 
   109   m_myBuilding = building;
   110   m_myBuilding = building;
   110   m_nFloor = nfloor;
   111   m_nFloor = nfloor;
   111   m_roomX = nroomx;
   112   m_roomX = nroomx;
   112   m_roomY = nroomy;
   113   m_roomY = nroomy;
   113   
   114   
   114   if (!building->IsInside (m_helper.GetCurrentPosition ()))
   115   NS_ASSERT_MSG (building->IsInside (m_helper.GetCurrentPosition ()), "Position of the node is outside of building bounds");
   115     {
   116   NS_ASSERT (m_roomX > 0);
   116       NS_FATAL_ERROR ("Position of the node is inconsistent with building bounds");
   117   NS_ASSERT (m_roomX <= building->GetNRoomsX ());
   117     }
   118   NS_ASSERT (m_roomY > 0);
       
   119   NS_ASSERT (m_roomY <= building->GetNRoomsY ());
       
   120   NS_ASSERT (m_nFloor > 0);
       
   121   NS_ASSERT (m_nFloor <= building->GetNFloors ());
       
   122 
   118 }
   123 }
   119 
   124 
   120 
   125 
   121 void
   126 void
   122 BuildingsMobilityModel::SetOutdoor (void)
   127 BuildingsMobilityModel::SetOutdoor (void)