10#include "ns3/double.h"
12#include "ns3/string.h"
27 TypeId(
"ns3::ThreeGppV2vUrbanPropagationLossModel")
29 .SetGroupName(
"Propagation")
33 "The percentage of vehicles of type 3 (i.e., trucks) in the scenario",
65 double loss = 38.77 + 16.7 * log10(distance3D) + 18.2 * log10(
m_frequency / 1e9);
74 NS_LOG_WARN(
"O2I car penetration loss not yet implemented");
95 double hBs = std::max(a->GetPosition().z, b->GetPosition().z);
96 double hUt = std::min(a->GetPosition().z, b->GetPosition().z);
104 double additionalLoss = 0;
105 double blockerHeight = 0;
121 if (std::min(hUt, hBs) > blockerHeight)
126 else if (std::max(hUt, hBs) < blockerHeight)
129 mu_a = 9.0 + std::max(0.0, 15 * log10(distance3D) - 41.0);
133 DoubleValue(log(pow(mu_a, 2) / sqrt(pow(sigma_a, 2) + pow(mu_a, 2)))));
135 DoubleValue(sqrt(log(pow(sigma_a, 2) / pow(mu_a, 2) + 1))));
136 additionalLoss = std::max(0.0,
m_logNorVar->GetValue());
141 mu_a = 5.0 + std::max(0.0, 15 * log10(distance3D) - 41.0);
146 DoubleValue(log(pow(mu_a, 2) / sqrt(pow(sigma_a, 2) + pow(mu_a, 2)))));
148 DoubleValue(sqrt(log(pow(sigma_a, 2) / pow(mu_a, 2) + 1))));
149 additionalLoss = std::max(0.0,
m_logNorVar->GetValue());
152 return additionalLoss;
162 double loss = 36.85 + 30 * log10(distance3D) + 18.9 * log10(
m_frequency / 1e9);
198 double correlationDistance;
203 correlationDistance = 10;
208 correlationDistance = 13;
215 return correlationDistance;
236 static TypeId tid =
TypeId(
"ns3::ThreeGppV2vHighwayPropagationLossModel")
238 .SetGroupName(
"Propagation")
262 double loss = 32.4 + 20 * log10(distance3D) + 20 * log10(
m_frequency / 1e9);
LosConditionValue
Possible values for Line-of-Sight condition.
@ NLOSv
Non Line of Sight due to a vehicle.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
Base class for the 3GPP propagation models.
Ptr< NormalRandomVariable > m_normRandomVariable
normal random variable
double m_frequency
operating frequency in Hz
Implements the pathloss model defined in 3GPP TR 37.885, Table 6.2.1-1 for the Highway scenario.
~ThreeGppV2vHighwayPropagationLossModel() override
Destructor.
ThreeGppV2vHighwayPropagationLossModel()
Constructor.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
static TypeId GetTypeId()
Get the type ID.
Implements the pathloss model defined in 3GPP TR 37.885, Table 6.2.1-1 for the Urban scenario.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed by a building.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
double GetAdditionalNlosvLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Computes the additional loss due to an obstruction caused by a vehicle.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double m_percType3Vehicles
percentage of Type 3 vehicles in the scenario (i.e., trucks)
Ptr< LogNormalRandomVariable > m_logNorVar
log normal random variable
ThreeGppV2vUrbanPropagationLossModel()
Constructor.
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
~ThreeGppV2vUrbanPropagationLossModel() override
Destructor.
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
double GetLossNlosv(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed by a vehicle.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
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()
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)