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> 45 : m_shadowingValue (shadowingValue), m_receiver (receiver)
53 return (m_shadowingValue);
65 static TypeId tid =
TypeId (
"ns3::BuildingsPropagationLossModel")
68 .SetGroupName (
"Buildings")
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));
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel.
double m_shadowingSigmaOutdoor
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
Ptr< NormalRandomVariable > m_randVariable
double EvaluateSigma(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
BuildingsPropagationLossModel()
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
Ptr< MobilityModel > GetReceiver(void) const
double m_shadowingSigmaIndoor
std::map< Ptr< MobilityModel >, std::map< Ptr< MobilityModel >, ShadowingLoss > > m_shadowingLossMap
static TypeId GetTypeId(void)
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Models the propagation loss through a transmission medium.
mobility buildings information (to be used by mobility models)
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
double m_shadowingSigmaExtWalls
double m_lossInternalWall
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...