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

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ChannelConditionModel
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Types

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

Protected Member Functions

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

Static Protected Member Functions

static double Calculate2dDistance (const Vector &a, const Vector &b)
 Computes the 2D distance between two 3D vectors. More...
 

Protected Attributes

Ptr< UniformRandomVariablem_uniformVar
 uniform random variable More...
 

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. More...
 
virtual double ComputePlos (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
 Compute the LOS probability. More...
 
virtual double ComputePnlos (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
 Compute the NLOS probability. More...
 

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. More...
 

Private Attributes

std::unordered_map< uint32_t, Itemm_channelConditionMap
 map to store the channel conditions More...
 
Time m_updatePeriod
 the update period for the channel condition More...
 

Additional Inherited Members

Detailed Description

Base class for the 3GPP channel condition models.


Config Paths

ns3::ThreeGppChannelConditionModel is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::LrWpanNetDevice/Channel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Channel/$ns3::SpectrumChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Channel/$ns3::YansWifiChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/Channel/$ns3::SpectrumChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/Channel/$ns3::YansWifiChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/ChannelList/[i]/$ns3::SpectrumChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"
  • "/ChannelList/[i]/$ns3::YansWifiChannel/PropagationLossModel/$ns3::ThreeGppPropagationLossModel/ChannelConditionModel/$ns3::ThreeGppChannelConditionModel"

Attributes

  • UpdatePeriod: Specifies the time period after which the channel condition is recomputed. If set to 0, the channel condition is never updated.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +0ns
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 104 bytes (on a 64-bit architecture).

Definition at line 446 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 496 of file channel-condition-model.h.

Constructor & Destructor Documentation

◆ ThreeGppChannelConditionModel()

ns3::ThreeGppChannelConditionModel::ThreeGppChannelConditionModel ( )

Constructor for the ThreeGppRmaChannelConditionModel class.

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

References m_uniformVar, and ns3::ObjectBase::SetAttribute().

+ Here is the call graph for this function:

◆ ~ThreeGppChannelConditionModel()

ns3::ThreeGppChannelConditionModel::~ThreeGppChannelConditionModel ( )
overridevirtual

Destructor for the ThreeGppRmaChannelConditionModel class.

Definition at line 304 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 407 of file channel-condition-model.cc.

References m_uniformVar, and ns3::RandomVariableStream::SetStream().

Referenced by V2vUrbanProbChCondModelTestCase::DoRun(), ThreeGppV2vUrbanLosNlosvChCondModelTestCase::DoRun(), V2vHighwayProbChCondModelTestCase::DoRun(), and ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun().

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

◆ 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 362 of file channel-condition-model.cc.

References ComputePlos(), ComputePnlos(), ns3::UniformRandomVariable::GetValue(), m_uniformVar, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by GetChannelCondition().

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

◆ ComputePlos()

virtual double ns3::ThreeGppChannelConditionModel::ComputePlos ( Ptr< const MobilityModel a,
Ptr< const MobilityModel b 
) const
privatepure virtual

◆ 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::ThreeGppV2vHighwayChannelConditionModel, ns3::ProbabilisticV2vHighwayChannelConditionModel, ns3::ThreeGppV2vUrbanChannelConditionModel, and ns3::ProbabilisticV2vUrbanChannelConditionModel.

Definition at line 398 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 ( void  )
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 307 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 314 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.

Referenced by ThreeGppChannelConditionModelTestCase::EvaluateChannelCondition(), V2vUrbanProbChCondModelTestCase::EvaluateChannelCondition(), ThreeGppV2vUrbanLosNlosvChCondModelTestCase::EvaluateChannelCondition(), V2vHighwayProbChCondModelTestCase::EvaluateChannelCondition(), and ThreeGppV2vHighwayLosNlosvChCondModelTestCase::EvaluateChannelCondition().

+ Here is the call graph for this function:
+ Here is the caller 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 424 of file channel-condition-model.cc.

References ns3::Node::GetId(), max, and min.

Referenced by GetChannelCondition().

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

◆ GetTypeId()

TypeId ns3::ThreeGppChannelConditionModel::GetTypeId ( void  )
static

Get the type ID.

Get the type ID.

Returns
the object TypeId

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

References m_updatePeriod, 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 560 of file channel-condition-model.h.

Referenced by DoDispose(), and GetChannelCondition().

◆ m_uniformVar

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

uniform random variable

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

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

◆ m_updatePeriod

Time ns3::ThreeGppChannelConditionModel::m_updatePeriod
private

the update period for the channel condition

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

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


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