22 #include "ns3/mobility-model.h"
24 #include <ns3/building-list.h>
35 static TypeId tid =
TypeId (
"ns3::ThreeGppV2vUrbanChannelConditionModel")
37 .SetGroupName (
"Buildings")
60 NS_ASSERT_MSG (cond->IsO2o (),
"The nodes should be outdoor");
69 pLos =
std::min (1.0, 1.05 * exp (-0.0114 * distance2D));
83 NS_ASSERT_MSG (cond->IsO2o (),
"The nodes should be outdoor");
101 static TypeId tid =
TypeId (
"ns3::ThreeGppV2vHighwayChannelConditionModel")
103 .SetGroupName (
"Buildings")
114 std::placeholders::_1, std::placeholders::_2);
128 NS_ASSERT_MSG (cond->IsO2o (),
"The nodes should be outdoor");
137 if (distance2D <= 475.0)
139 pLos =
std::min (1.0, 2.1013e-6 * distance2D * distance2D - 0.002 * distance2D + 1.0193);
143 pLos =
std::max (0.0, 0.54 - 0.001 * (distance2D - 475.0));
158 NS_ASSERT_MSG (cond->IsO2o (),
"The nodes should be outdoor");
177 std::placeholders::_1, std::placeholders::_2);
183 std::placeholders::_1, std::placeholders::_2);
202 cond->SetO2iCondition (ChannelCondition::O2iConditionValue::O2O);
203 cond->SetLosCondition (ChannelCondition::LosConditionValue::LOS);
static Iterator End(void)
static Iterator Begin(void)
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.
Computes the channel condition for the V2V Highway scenario.
Ptr< ChannelCondition > GetChCondWithNoBuildings(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Get the channel condition between a and b.
std::function< Ptr< ChannelCondition >Ptr< const MobilityModel >, Ptr< const MobilityModel >) > ComputeChCond
The callback which is hooked to a method to compute channel condition.
Ptr< ChannelCondition > GetChCondWithBuildings(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Get the channel condition between a and b using BuildingsChannelConditionModel.
Ptr< BuildingsChannelConditionModel > m_buildingsCcm
used to determine the obstructions due to buildings
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
ThreeGppV2vHighwayChannelConditionModel()
Constructor for the ThreeGppV2vHighwayChannelConditionModel class.
static TypeId GetTypeId(void)
Get the type ID.
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table Table 6.2-1 of 3GPP TR 37.885 for the V2V Highway s...
Ptr< ChannelCondition > GetChCondAndFixCallback(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Get the channel condition and redirect the callback ComputeChCond to GetChCondWithBuildings or to Get...
virtual ~ThreeGppV2vHighwayChannelConditionModel() override
Destructor for the ThreeGppV2vHighwayChannelConditionModel class.
Computes the channel condition for the V2V Urban scenario.
Ptr< BuildingsChannelConditionModel > m_buildingsCcm
used to determine the obstructions due to buildings
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
ThreeGppV2vUrbanChannelConditionModel()
Constructor for the ThreeGppV2vUrbanChannelConditionModel class.
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table Table 6.2-1 of 3GPP TR 37.885 for the V2V Urban sce...
static TypeId GetTypeId(void)
Get the type ID.
virtual ~ThreeGppV2vUrbanChannelConditionModel() override
Destructor for the ThreeGppV2vUrbanChannelConditionModel class.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#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_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.