23#include "ns3/mobility-model.h" 
   24#include "ns3/string.h" 
   37        TypeId(
"ns3::ProbabilisticV2vUrbanChannelConditionModel")
 
   39            .SetGroupName(
"Propagation")
 
   43                "Specifies the density of the vehicles in the scenario." 
   44                "It can be set to Low, Medium or High.",
 
   49                                VehicleDensity::MEDIUM,
 
   75    case VehicleDensity::LOW:
 
   78    case VehicleDensity::MEDIUM:
 
   81    case VehicleDensity::HIGH:
 
   85        NS_FATAL_ERROR(
"Undefined density, choose between Low, Medium and High");
 
  102    case VehicleDensity::LOW:
 
  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)));
 
  116    case VehicleDensity::HIGH:
 
  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")
 
  146                "Specifies the density of the vehicles in the scenario." 
  147                "It can be set to Low, Medium or High.",
 
  152                                VehicleDensity::MEDIUM,
 
  154                                VehicleDensity::HIGH,
 
  180    case VehicleDensity::LOW:
 
  185    case VehicleDensity::MEDIUM:
 
  190    case VehicleDensity::HIGH:
 
  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));
 
  217    case VehicleDensity::LOW:
 
  222    case VehicleDensity::MEDIUM:
 
  227    case VehicleDensity::HIGH:
 
  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.
 
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
 
#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(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.