23 #include "ns3/propagation-loss-model.h"
25 #include "ns3/mobility-model.h"
26 #include "ns3/double.h"
27 #include "ns3/pointer.h"
30 #include <ns3/mobility-building-info.h>
46 : m_shadowingValue (shadowingValue), m_receiver (receiver)
54 return (m_shadowingValue);
66 static TypeId tid =
TypeId (
"ns3::BuildingsPropagationLossModel")
71 .AddAttribute (
"ShadowSigmaOutdoor",
72 "Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
75 MakeDoubleChecker<double> ())
77 .AddAttribute (
"ShadowSigmaIndoor",
78 "Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
81 MakeDoubleChecker<double> ())
82 .AddAttribute (
"ShadowSigmaExtWalls",
83 "Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
86 MakeDoubleChecker<double> ())
88 .AddAttribute (
"InternalWallLoss",
89 "Additional loss for each internal wall [dB]",
92 MakeDoubleChecker<double> ());
132 int nfloors = node->GetFloorNumber () - 1;
133 loss = -2 * (nfloors);
141 double dx = std::abs (a->GetRoomNumberX () - b->GetRoomNumberX ());
142 double dy = std::abs (a->GetRoomNumberY () - b->GetRoomNumberY ());
154 NS_ASSERT_MSG ((a1 != 0) && (b1 != 0),
"BuildingsPropagationLossModel only works with MobilityBuildingInfo");
159 std::map<Ptr<MobilityModel>,
ShadowingLoss>::iterator bit = ait->second.find (b);
160 if (bit != ait->second.end ())
162 return (bit->second.GetLoss ());
169 double shadowingValue =
m_randVariable->GetValue (0.0, (sigma*sigma));
171 return (ait->second[b].GetLoss ());
179 double shadowingValue =
m_randVariable->GetValue (0.0, (sigma*sigma));
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
double m_shadowingSigmaOutdoor
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Ptr< NormalRandomVariable > m_randVariable
NS_LOG_COMPONENT_DEFINE("BuildingsPropagationLossModel")
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
BuildingsPropagationLossModel()
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
double m_shadowingSigmaIndoor
std::map< Ptr< MobilityModel >, std::map< Ptr< MobilityModel >, ShadowingLoss > > m_shadowingLossMap
static TypeId GetTypeId(void)
double EvaluateSigma(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
#define NS_ASSERT_MSG(condition, message)
Modelize the propagation loss through a transmission medium.
mobility buildings information (to be used by mobility models)
Ptr< MobilityModel > GetReceiver(void) const
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Hold a floating point type.
Ptr< T > GetObject(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
double m_shadowingSigmaExtWalls
double m_lossInternalWall
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...