21 #include "ns3/double.h"
23 #include "ns3/string.h"
38 TypeId(
"ns3::ThreeGppV2vUrbanPropagationLossModel")
40 .SetGroupName(
"Propagation")
44 "The percentage of vehicles of type 3 (i.e., trucks) in the scenario",
47 MakeDoubleChecker<double>(0.0, 100.0));
56 m_logNorVar = CreateObject<LogNormalRandomVariable>();
77 double loss = 38.77 + 16.7 * log10(distance3D) + 18.2 * log10(
m_frequency / 1e9);
86 NS_LOG_WARN(
"O2I car penetration loss not yet implemented");
117 double additionalLoss = 0;
118 double blockerHeight = 0;
134 if (
std::min(hUt, hBs) > blockerHeight)
139 else if (
std::max(hUt, hBs) < blockerHeight)
142 mu_a = 9.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))));
154 mu_a = 5.0 +
std::max(0.0, 15 * log10(distance3D) - 41.0);
159 DoubleValue(log(pow(mu_a, 2) / sqrt(pow(sigma_a, 2) + pow(mu_a, 2)))));
161 DoubleValue(sqrt(log(pow(sigma_a, 2) / pow(mu_a, 2) + 1))));
165 return additionalLoss;
176 double loss = 36.85 + 30 * log10(distance3D) + 18.9 * log10(
m_frequency / 1e9);
190 if (cond == ChannelCondition::LosConditionValue::LOS ||
191 cond == ChannelCondition::LosConditionValue::NLOSv)
195 else if (cond == ChannelCondition::LosConditionValue::NLOS)
212 double correlationDistance;
215 if (cond == ChannelCondition::LosConditionValue::LOS)
217 correlationDistance = 10;
219 else if (cond == ChannelCondition::LosConditionValue::NLOSv ||
220 cond == ChannelCondition::LosConditionValue::NLOS)
222 correlationDistance = 13;
229 return correlationDistance;
250 static TypeId tid =
TypeId(
"ns3::ThreeGppV2vHighwayPropagationLossModel")
252 .SetGroupName(
"Propagation")
277 double loss = 32.4 + 20 * log10(distance3D) + 20 * log10(
m_frequency / 1e9);
LosConditionValue
Possible values for Line-of-Sight condition.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
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.
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.
ThreeGppV2vHighwayPropagationLossModel()
Constructor.
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 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.
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.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
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
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.
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.
double GetAdditionalNlosvLoss(double distance3D, double hUt, double hBs) const
Computes the additional loss due to an obstruction caused by a vehicle.
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
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.
#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)