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));
191 bool isAIndoor = a->IsIndoor ();
192 bool isBIndoor = b->IsIndoor ();
This model allows the computation of shadowing loss.
double m_shadowingValue
Shadowing value.
Ptr< MobilityModel > GetReceiver(void) const
static TypeId GetTypeId(void)
Get the type ID.
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.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
PropagationLossModel.
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Calculate the external wall loss.
BuildingsPropagationLossModel()
virtual int64_t DoAssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
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(void) 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...
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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.