15#include "ns3/double.h"
18#include "ns3/mobility-model.h"
19#include "ns3/pointer.h"
20#include "ns3/propagation-loss-model.h"
37 : m_shadowingValue(shadowingValue),
46 return m_shadowingValue;
59 TypeId(
"ns3::BuildingsPropagationLossModel")
62 .SetGroupName(
"Buildings")
66 "Standard deviation of the normal distribution used to calculate the shadowing for "
74 "Standard deviation of the normal distribution used to calculate the shadowing for "
80 "ShadowSigmaExtWalls",
81 "Standard deviation of the normal distribution used to calculate the shadowing due "
87 .AddAttribute(
"InternalWallLoss",
88 "Additional loss for each internal wall [dB]",
130 int nfloors = node->GetFloorNumber() - 1;
131 loss = -2 * (nfloors);
140 double dx = std::abs(a->GetRoomNumberX() - b->GetRoomNumberX());
141 double dy = std::abs(a->GetRoomNumberY() - b->GetRoomNumberY());
150 NS_ASSERT_MSG(a1 && b1,
"BuildingsPropagationLossModel only works with MobilityBuildingInfo");
155 auto bit = ait->second.find(b);
156 if (bit != ait->second.end())
158 return bit->second.GetLoss();
165 double shadowingValue =
m_randVariable->GetValue(0.0, (sigma * sigma));
167 return ait->second[b].GetLoss();
175 double shadowingValue =
m_randVariable->GetValue(0.0, (sigma * sigma));
185 bool isAIndoor = a->IsIndoor();
186 bool isBIndoor = b->IsIndoor();
This model allows the computation of shadowing loss.
Ptr< MobilityModel > GetReceiver() const
double m_shadowingValue
Shadowing value.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
std::map< Ptr< MobilityModel >, std::map< Ptr< MobilityModel >, ShadowingLoss > > m_shadowingLossMap
Map of the shadowng loss.
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Calculate the shadowing loss.
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
Calculate the height loss.
double m_shadowingSigmaOutdoor
Standard deviation of the normal distribution used to calculate the shadowing for outdoor nodes.
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
double m_shadowingSigmaExtWalls
Standard deviation of the normal distribution used to calculate the shadowing due to ext walls.
double m_shadowingSigmaIndoor
Standard deviation of the normal distribution used to calculate the shadowing for indoor nodes.
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Calculate the external wall loss.
BuildingsPropagationLossModel()
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId()
Get the type ID.
double m_lossInternalWall
loss from internal walls (in dBm)
double EvaluateSigma(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the Standard deviation of the normal distribution used to calculate the shadowing.
Ptr< NormalRandomVariable > m_randVariable
Random variable.
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the internal wall loss.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
mobility buildings information (to be used by mobility models)
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)