26 #include "ns3/double.h"
29 #include "ns3/mobility-model.h"
30 #include "ns3/pointer.h"
31 #include "ns3/propagation-loss-model.h"
48 : m_shadowingValue(shadowingValue),
57 return m_shadowingValue;
70 TypeId(
"ns3::BuildingsPropagationLossModel")
73 .SetGroupName(
"Buildings")
77 "Standard deviation of the normal distribution used to calculate the shadowing for "
81 MakeDoubleChecker<double>())
85 "Standard deviation of the normal distribution used to calculate the shadowing for "
89 MakeDoubleChecker<double>())
91 "ShadowSigmaExtWalls",
92 "Standard deviation of the normal distribution used to calculate the shadowing due "
96 MakeDoubleChecker<double>())
98 .AddAttribute(
"InternalWallLoss",
99 "Additional loss for each internal wall [dB]",
102 MakeDoubleChecker<double>());
141 int nfloors = node->GetFloorNumber() - 1;
142 loss = -2 * (nfloors);
151 double dx = std::abs(a->GetRoomNumberX() - b->GetRoomNumberX());
152 double dy = std::abs(a->GetRoomNumberY() - b->GetRoomNumberY());
161 NS_ASSERT_MSG(a1 && b1,
"BuildingsPropagationLossModel only works with MobilityBuildingInfo");
166 auto bit = ait->second.find(b);
167 if (bit != ait->second.end())
169 return bit->second.GetLoss();
178 return ait->second[b].GetLoss();
196 bool isAIndoor = a->IsIndoor();
197 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)
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Models the propagation loss through a transmission medium.
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.
#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 AttributeAccessor > MakeDoubleAccessor(T1 a1)