A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::ThreeGppChannelConditionModel Class Referenceabstract

Base class for the 3GPP channel condition models. More...

#include "channel-condition-model.h"

+ Inheritance diagram for ns3::ThreeGppChannelConditionModel:
+ Collaboration diagram for ns3::ThreeGppChannelConditionModel:

Classes

struct  Item
 Struct to store the channel condition in the m_channelConditionMap. More...
 

Public Member Functions

 ThreeGppChannelConditionModel ()
 Constructor for the ThreeGppRmaChannelConditionModel class.
 
 ~ThreeGppChannelConditionModel () override
 Destructor for the ThreeGppRmaChannelConditionModel class.
 
int64_t AssignStreams (int64_t stream) override
 If this model uses objects of type RandomVariableStream, set the stream numbers to the integers starting with the offset 'stream'.
 
Ptr< ChannelConditionGetChannelCondition (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
 Retrieve the condition of the channel between a and b.
 
- Public Member Functions inherited from ns3::ChannelConditionModel
 ChannelConditionModel ()
 Constructor for the ChannelConditionModel class.
 
 ChannelConditionModel (const ChannelConditionModel &)=delete
 
 ~ChannelConditionModel () override
 Destructor for the ChannelConditionModel class.
 
ChannelConditionModeloperator= (const ChannelConditionModel &)=delete
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static double Calculate2dDistance (const Vector &a, const Vector &b)
 Computes the 2D distance between two 3D vectors.
 
static std::tuple< double, doubleGetQuantizedElevationAngle (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
 Computes and quantizes the elevation angle to a two-digits integer in [10, 90].
 
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::ChannelConditionModel
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Types

enum  VehicleDensity { LOW , MEDIUM , HIGH , INVALID }
 Determine the density of vehicles in a V2V scenario. More...
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Protected Attributes

Ptr< UniformRandomVariablem_uniformVar
 uniform random variable
 

Private Member Functions

Ptr< ChannelConditionComputeChannelCondition (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
 This method computes the channel condition based on a probabilistic model that is specific for the scenario of interest.
 
virtual ChannelCondition::O2iConditionValue ComputeO2i (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
 Determines whether the channel condition is O2I or O2O.
 
virtual double ComputePlos (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
 Compute the LOS probability.
 
virtual double ComputePnlos (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
 Compute the NLOS probability.
 

Static Private Member Functions

static uint32_t GetKey (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
 Returns a unique and reciprocal key for the channel between a and b.
 

Private Attributes

std::unordered_map< uint32_t, Itemm_channelConditionMap
 map to store the channel conditions
 
bool m_linkO2iConditionToAntennaHeight
 the indicator that determines whether the O2I/O2O condition is determined based on the UE height
 
double m_o2iLowLossThreshold {0}
 the threshold for determining what is the ratio of low - high O2I building penetration losses
 
double m_o2iThreshold
 the threshold for determining what is the ratio of channels with O2I
 
Ptr< UniformRandomVariablem_uniformO2iLowHighLossVar
 a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7.4.3-2
 
Ptr< UniformRandomVariablem_uniformVarO2i
 uniform random variable that is used for the generation of the O2i conditions
 
Time m_updatePeriod
 the update period for the channel condition
 

Additional Inherited Members

Detailed Description

Base class for the 3GPP channel condition models.

Definition at line 431 of file channel-condition-model.h.

Member Enumeration Documentation

◆ VehicleDensity

Determine the density of vehicles in a V2V scenario.

Enumerator
LOW 
MEDIUM 
HIGH 
INVALID 

Definition at line 503 of file channel-condition-model.h.

Constructor & Destructor Documentation

◆ ThreeGppChannelConditionModel()

ns3::ThreeGppChannelConditionModel::ThreeGppChannelConditionModel ( )

Constructor for the ThreeGppRmaChannelConditionModel class.

Definition at line 372 of file channel-condition-model.cc.

References ns3::CreateObject(), m_uniformO2iLowHighLossVar, m_uniformVar, and m_uniformVarO2i.

+ Here is the call graph for this function:

◆ ~ThreeGppChannelConditionModel()

ns3::ThreeGppChannelConditionModel::~ThreeGppChannelConditionModel ( )
override

Destructor for the ThreeGppRmaChannelConditionModel class.

Definition at line 383 of file channel-condition-model.cc.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::ThreeGppChannelConditionModel::AssignStreams ( int64_t stream)
overridevirtual

If this model uses objects of type RandomVariableStream, set the stream numbers to the integers starting with the offset 'stream'.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamthe offset used to set the stream numbers
Returns
the number of stream indices assigned by this model

Implements ns3::ChannelConditionModel.

Definition at line 542 of file channel-condition-model.cc.

References m_uniformO2iLowHighLossVar, m_uniformVar, and m_uniformVarO2i.

◆ Calculate2dDistance()

◆ ComputeChannelCondition()

Ptr< ChannelCondition > ns3::ThreeGppChannelConditionModel::ComputeChannelCondition ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b ) const
private

This method computes the channel condition based on a probabilistic model that is specific for the scenario of interest.

Parameters
atx mobility model
brx mobility model
Returns
the channel condition

Definition at line 476 of file channel-condition-model.cc.

References ComputeO2i(), ComputePlos(), ComputePnlos(), ns3::CreateObject(), ns3::ChannelCondition::HIGH, ns3::ChannelCondition::LOS, ns3::ChannelCondition::LOW, m_o2iLowLossThreshold, m_uniformO2iLowHighLossVar, m_uniformVar, ns3::ChannelCondition::NLOS, ns3::ChannelCondition::NLOSv, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::ChannelCondition::O2I.

Referenced by GetChannelCondition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeO2i()

ChannelCondition::O2iConditionValue ns3::ThreeGppChannelConditionModel::ComputeO2i ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b ) const
privatevirtual

Determines whether the channel condition is O2I or O2O.

Parameters
atx mobility model
brx mobility model
Returns
the O2I channelcondition

Definition at line 444 of file channel-condition-model.cc.

References m_linkO2iConditionToAntennaHeight, m_o2iThreshold, m_uniformVarO2i, NS_LOG_INFO, ns3::ChannelCondition::O2I, and ns3::ChannelCondition::O2O.

Referenced by ComputeChannelCondition().

+ Here is the caller graph for this function:

◆ ComputePlos()

◆ ComputePnlos()

double ns3::ThreeGppChannelConditionModel::ComputePnlos ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b ) const
privatevirtual

Compute the NLOS probability.

By default returns 1 - PLOS

Parameters
atx mobility model
brx mobility model
Returns
the LOS probability

Reimplemented in ns3::ProbabilisticV2vHighwayChannelConditionModel, ns3::ProbabilisticV2vUrbanChannelConditionModel, ns3::ThreeGppV2vHighwayChannelConditionModel, and ns3::ThreeGppV2vUrbanChannelConditionModel.

Definition at line 533 of file channel-condition-model.cc.

References ComputePlos(), and NS_LOG_FUNCTION.

Referenced by ComputeChannelCondition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::ThreeGppChannelConditionModel::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 388 of file channel-condition-model.cc.

References m_channelConditionMap, m_updatePeriod, and ns3::Seconds().

+ Here is the call graph for this function:

◆ GetChannelCondition()

Ptr< ChannelCondition > ns3::ThreeGppChannelConditionModel::GetChannelCondition ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b ) const
overridevirtual

Retrieve the condition of the channel between a and b.

If the channel condition does not exists, the method computes it by calling ComputeChannelCondition and stores it in a local cache, that will be updated following the "UpdatePeriod" parameter.

Parameters
amobility model
bmobility model
Returns
the condition of the channel between a and b

Implements ns3::ChannelConditionModel.

Definition at line 395 of file channel-condition-model.cc.

References ComputeChannelCondition(), GetKey(), ns3::Time::IsZero(), m_channelConditionMap, ns3::ThreeGppChannelConditionModel::Item::m_condition, ns3::ThreeGppChannelConditionModel::Item::m_generatedTime, m_updatePeriod, ns3::Simulator::Now(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

◆ GetKey()

uint32_t ns3::ThreeGppChannelConditionModel::GetKey ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b )
staticprivate

Returns a unique and reciprocal key for the channel between a and b.

Parameters
atx mobility model
brx mobility model
Returns
channel key

Definition at line 562 of file channel-condition-model.cc.

References ns3::Node::GetId().

Referenced by GetChannelCondition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetQuantizedElevationAngle()

std::tuple< double, double > ns3::ThreeGppChannelConditionModel::GetQuantizedElevationAngle ( Ptr< const MobilityModel > a,
Ptr< const MobilityModel > b )
static

Computes and quantizes the elevation angle to a two-digits integer in [10, 90].

Asserts that the provided mobility models are of the expected type, i.e., GeocentricConstantPositionMobilityModel, and that the quantized angle is in the expected range [10, 90].

Parameters
amobility model
bmobility model
Returns
the tuple [elevation angle, quantized elevation angle] between a and b

Definition at line 576 of file channel-condition-model.cc.

References ns3::ConstCast(), ns3::DynamicCast(), and NS_ASSERT_MSG.

Referenced by ns3::ThreeGppNTNDenseUrbanChannelConditionModel::ComputePlos(), ns3::ThreeGppNTNRuralChannelConditionModel::ComputePlos(), ns3::ThreeGppNTNSuburbanChannelConditionModel::ComputePlos(), ns3::ThreeGppNTNUrbanChannelConditionModel::ComputePlos(), ns3::ThreeGppNTNDenseUrbanPropagationLossModel::GetLossLos(), ns3::ThreeGppNTNRuralPropagationLossModel::GetLossLos(), ns3::ThreeGppNTNSuburbanPropagationLossModel::GetLossLos(), ns3::ThreeGppNTNUrbanPropagationLossModel::GetLossLos(), ns3::ThreeGppNTNDenseUrbanPropagationLossModel::GetLossNlos(), ns3::ThreeGppNTNRuralPropagationLossModel::GetLossNlos(), ns3::ThreeGppNTNSuburbanPropagationLossModel::GetLossNlos(), ns3::ThreeGppNTNUrbanPropagationLossModel::GetLossNlos(), ns3::ThreeGppNTNDenseUrbanPropagationLossModel::GetShadowingStd(), ns3::ThreeGppNTNRuralPropagationLossModel::GetShadowingStd(), ns3::ThreeGppNTNSuburbanPropagationLossModel::GetShadowingStd(), and ns3::ThreeGppNTNUrbanPropagationLossModel::GetShadowingStd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::ThreeGppChannelConditionModel::GetTypeId ( )
static

Get the type ID.

Get the type ID.

Returns
the object TypeId

Definition at line 334 of file channel-condition-model.cc.

References m_linkO2iConditionToAntennaHeight, m_o2iLowLossThreshold, m_o2iThreshold, m_updatePeriod, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MilliSeconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_channelConditionMap

std::unordered_map<uint32_t, Item> ns3::ThreeGppChannelConditionModel::m_channelConditionMap
private

map to store the channel conditions

Definition at line 571 of file channel-condition-model.h.

Referenced by DoDispose(), and GetChannelCondition().

◆ m_linkO2iConditionToAntennaHeight

bool ns3::ThreeGppChannelConditionModel::m_linkO2iConditionToAntennaHeight
private
Initial value:
{
false}

the indicator that determines whether the O2I/O2O condition is determined based on the UE height

Definition at line 578 of file channel-condition-model.h.

Referenced by ComputeO2i(), and GetTypeId().

◆ m_o2iLowLossThreshold

double ns3::ThreeGppChannelConditionModel::m_o2iLowLossThreshold {0}
private

the threshold for determining what is the ratio of low - high O2I building penetration losses

Definition at line 576 of file channel-condition-model.h.

Referenced by ComputeChannelCondition(), and GetTypeId().

◆ m_o2iThreshold

double ns3::ThreeGppChannelConditionModel::m_o2iThreshold
private
Initial value:
{
0}

the threshold for determining what is the ratio of channels with O2I

Definition at line 574 of file channel-condition-model.h.

Referenced by ComputeO2i(), and GetTypeId().

◆ m_uniformO2iLowHighLossVar

Ptr<UniformRandomVariable> ns3::ThreeGppChannelConditionModel::m_uniformO2iLowHighLossVar
private

a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7.4.3-2

Definition at line 584 of file channel-condition-model.h.

Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeChannelCondition().

◆ m_uniformVar

Ptr<UniformRandomVariable> ns3::ThreeGppChannelConditionModel::m_uniformVar
protected

uniform random variable

Definition at line 511 of file channel-condition-model.h.

Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeChannelCondition().

◆ m_uniformVarO2i

Ptr<UniformRandomVariable> ns3::ThreeGppChannelConditionModel::m_uniformVarO2i
private

uniform random variable that is used for the generation of the O2i conditions

Definition at line 581 of file channel-condition-model.h.

Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeO2i().

◆ m_updatePeriod

Time ns3::ThreeGppChannelConditionModel::m_updatePeriod
private

the update period for the channel condition

Definition at line 572 of file channel-condition-model.h.

Referenced by DoDispose(), GetChannelCondition(), and GetTypeId().


The documentation for this class was generated from the following files: