23 #include "ns3/mobility-model.h"
24 #include "ns3/string.h"
37 TypeId(
"ns3::ProbabilisticV2vUrbanChannelConditionModel")
39 .SetGroupName(
"Propagation")
41 .AddAttribute(
"Density",
42 "Specifies the density of the vehicles in the scenario."
43 "It can be set to Low, Medium or High.",
45 MakeEnumAccessor<VehicleDensity>(
49 VehicleDensity::MEDIUM,
78 case VehicleDensity::MEDIUM:
85 NS_FATAL_ERROR(
"Undefined density, choose between Low, Medium and High");
106 1 / (0.0396 * distance2D) *
107 exp(-(log(distance2D) - 5.2718) * (log(distance2D) - 5.2718) / 3.4827)));
109 case VehicleDensity::MEDIUM:
113 1 / (0.0312 * distance2D) *
114 exp(-(log(distance2D) - 5.0063) * (log(distance2D) - 5.0063) / 2.4544)));
120 1 / (0.0242 * distance2D) *
121 exp(-(log(distance2D) - 5.0115) * (log(distance2D) - 5.0115) / 2.2092)));
124 NS_FATAL_ERROR(
"Undefined density, choose between Low, Medium and High");
140 TypeId(
"ns3::ProbabilisticV2vHighwayChannelConditionModel")
142 .SetGroupName(
"Propagation")
144 .AddAttribute(
"Density",
145 "Specifies the density of the vehicles in the scenario."
146 "It can be set to Low, Medium or High.",
148 MakeEnumAccessor<VehicleDensity>(
152 VehicleDensity::MEDIUM,
185 case VehicleDensity::MEDIUM:
196 NS_FATAL_ERROR(
"Undefined density, choose between Low, Medium and High");
200 std::min(1.0,
std::max(0.0, aLos * distance2D * distance2D + bLos * distance2D + cLos));
222 case VehicleDensity::MEDIUM:
233 NS_FATAL_ERROR(
"Undefined density, choose between Low, Medium and High");
237 std::min(1.0,
std::max(0.0, aNlos * pow(distance2D, 2) + bNlos * distance2D + cNlos));
Hold variables of type enum.
Computes the channel condition for the V2V Highway scenario.
static TypeId GetTypeId()
Get the type ID.
VehicleDensity m_densityHighway
vehicle density
double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
~ProbabilisticV2vHighwayChannelConditionModel() override
Destructor for the ProbabilisticV2vHighwayChannelConditionModel class.
ProbabilisticV2vHighwayChannelConditionModel()
Constructor for the ProbabilisticV2vHighwayChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the V2V Urban scenario.
VehicleDensity m_densityUrban
vehicle density
static TypeId GetTypeId()
Get the type ID.
double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
~ProbabilisticV2vUrbanChannelConditionModel() override
Destructor for the ProbabilisticV2vUrbanChannelConditionModel class.
ProbabilisticV2vUrbanChannelConditionModel()
Constructor for the ProbabilisticV2vUrbanChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Smart pointer class similar to boost::intrusive_ptr.
Base class for the 3GPP channel condition models.
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
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_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 > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.