src/buildings/model/buildings-propagation-loss-model.cc
changeset 9063 32755d0516f4
parent 9014 9bcea2a55b9b
child 10080 1b36e2276e15
equal deleted inserted replaced
9062:d14e2430213d 9063:32755d0516f4
   135 
   135 
   136 double
   136 double
   137 BuildingsPropagationLossModel::InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel>b) const
   137 BuildingsPropagationLossModel::InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel>b) const
   138 {
   138 {
   139   // approximate the number of internal walls with the Manhattan distance in "rooms" units
   139   // approximate the number of internal walls with the Manhattan distance in "rooms" units
   140   double dx = abs (a->GetRoomNumberX () - b->GetRoomNumberX ());
   140   double dx = std::abs (a->GetRoomNumberX () - b->GetRoomNumberX ());
   141   double dy = abs (a->GetRoomNumberY () - b->GetRoomNumberY ());    
   141   double dy = std::abs (a->GetRoomNumberY () - b->GetRoomNumberY ());    
   142   return m_lossInternalWall * (dx+dy);
   142   return m_lossInternalWall * (dx+dy);
   143 }
   143 }
   144 
   144 
   145 
   145 
   146 
   146 
   193         {
   193         {
   194           return (m_shadowingSigmaOutdoor);
   194           return (m_shadowingSigmaOutdoor);
   195         }
   195         }
   196       else
   196       else
   197         {
   197         {
   198           double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
   198           double sigma = std::sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
   199           return (sigma);
   199           return (sigma);
   200         }
   200         }
   201     }
   201     }
   202   else
   202   else
   203   if (b->IsIndoor ())
   203   if (b->IsIndoor ())
   204     {
   204     {
   205       return (m_shadowingSigmaIndoor);
   205       return (m_shadowingSigmaIndoor);
   206     }
   206     }
   207   else
   207   else
   208     {
   208     {
   209       double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
   209       double sigma = std::sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
   210       return (sigma);
   210       return (sigma);
   211     }
   211     }
   212 }
   212 }
   213 
   213 
   214 
   214