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);
virtual ~ThreeGppV2vHighwayChannelConditionModel() override
Destructor for the ThreeGppV2vHighwayChannelConditionModel class.
Ptr< ChannelCondition > GetChCondWithNoBuildings(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Get the channel condition between a and b.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< BuildingsChannelConditionModel > m_buildingsCcm
used to determine the obstructions due to buildings
std::function< Ptr< ChannelCondition >Ptr< const MobilityModel >, Ptr< const MobilityModel >) > ComputeChCond
The callback which is hooked to a method to compute channel condition.
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
static Iterator End(void)
static Iterator Begin(void)
Ptr< ChannelCondition > GetChCondAndFixCallback(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Get the channel condition and redirect the callback ComputeChCond to GetChaCondWithBuildings or to Ge...
static TypeId GetTypeId(void)
Get the type ID.
Base class for the 3GPP channel condition models.
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the NLOS probability.
Ptr< ChannelCondition > GetChCondWithBuildings(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Get the channel condition between a and b using BuildingsChannelConditionModel.
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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Computes the channel condition for the V2V Highway scenario.
ThreeGppV2vHighwayChannelConditionModel()
Constructor for the ThreeGppV2vHighwayChannelConditionModel class.
virtual ~ThreeGppV2vUrbanChannelConditionModel() override
Destructor for the ThreeGppV2vUrbanChannelConditionModel class.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
ThreeGppV2vUrbanChannelConditionModel()
Constructor for the ThreeGppV2vUrbanChannelConditionModel class.
Ptr< BuildingsChannelConditionModel > m_buildingsCcm
used to determine the obstructions due to buildings
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Computes the channel condition for the V2V Urban scenario.