|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/double.h"
23 #include "ns3/string.h"
36 static TypeId tid =
TypeId (
"ns3::ThreeGppV2vUrbanPropagationLossModel")
38 .SetGroupName (
"Propagation")
40 .AddAttribute (
"PercType3Vehicles",
41 "The percentage of vehicles of type 3 (i.e., trucks) in the scenario",
44 MakeDoubleChecker<double> (0.0, 100.0))
54 m_logNorVar = CreateObject<LogNormalRandomVariable> ();
72 double loss = 38.77 + 16.7 * log10 (distance3D) + 18.2 * log10 (
m_frequency / 1e9);
98 double additionalLoss = 0;
99 double blockerHeight = 0;
115 if (
std::min (hUt, hBs) > blockerHeight)
120 else if (
std::max (hUt, hBs) < blockerHeight)
123 mu_a = 9.0 +
std::max (0.0, 15 * log10 (distance3D) - 41.0);
125 m_logNorVar->SetAttribute (
"Mu",
DoubleValue (log (pow (mu_a, 2) / sqrt (pow (sigma_a, 2) + pow (mu_a, 2)))));
132 mu_a = 5.0 +
std::max (0.0, 15 * log10 (distance3D) - 41.0);
135 m_logNorVar->SetAttribute (
"Mu",
DoubleValue (log (pow (mu_a,2) / sqrt (pow (sigma_a, 2) + pow (mu_a, 2)))));
140 return additionalLoss;
148 double loss = 36.85 + 30 * log10 (distance3D) + 18.9 * log10 (
m_frequency / 1e9);
159 if (cond == ChannelCondition::LosConditionValue::LOS || cond == ChannelCondition::LosConditionValue::NLOSv)
163 else if (cond == ChannelCondition::LosConditionValue::NLOS)
179 double correlationDistance;
182 if (cond == ChannelCondition::LosConditionValue::LOS)
184 correlationDistance = 10;
186 else if (cond == ChannelCondition::LosConditionValue::NLOSv || cond == ChannelCondition::LosConditionValue::NLOS)
188 correlationDistance = 13;
195 return correlationDistance;
205 static TypeId tid =
TypeId (
"ns3::ThreeGppV2vHighwayPropagationLossModel")
207 .SetGroupName (
"Propagation")
230 double loss = 32.4 + 20 * log10 (distance3D) + 20 * log10 (
m_frequency / 1e9);
virtual ~ThreeGppV2vUrbanPropagationLossModel() override
Destructor.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual ~ThreeGppV2vHighwayPropagationLossModel() override
Destructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed by a building.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Implements the pathloss model defined in 3GPP TR 37.885, Table 6.2.1-1 for the Urban scenario.
Ptr< LogNormalRandomVariable > m_logNorVar
log normal random variable
Implements the pathloss model defined in 3GPP TR 37.885, Table 6.2.1-1 for the Highway scenario.
ThreeGppV2vUrbanPropagationLossModel()
Constructor.
double GetAdditionalNlosvLoss(double distance3D, double hUt, double hBs) const
Computes the additional loss due to an obstruction caused by a vehicle.
LosConditionValue
Possible values for Line-of-Sight condition.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
ThreeGppV2vHighwayPropagationLossModel()
Constructor.
static TypeId GetTypeId(void)
Get the type ID.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double m_frequency
operating frequency in Hz
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
double m_percType3Vehicles
percentage of Type 3 vehicles in the scenario (i.e., trucks)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Base class for the 3GPP propagation models.
virtual double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
virtual double GetLossNlosv(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed by a vehicle.
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable