Base class for the 3GPP channel condition models. More...
#include "channel-condition-model.h"
Classes | |
struct | Item |
Struct to store the channel condition in the m_channelConditionMap. More... | |
Public Member Functions | |
ThreeGppChannelConditionModel () | |
Constructor for the ThreeGppRmaChannelConditionModel class. More... | |
~ThreeGppChannelConditionModel () override | |
Destructor for the ThreeGppRmaChannelConditionModel class. More... | |
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... | |
Ptr< ChannelCondition > | GetChannelCondition (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 | |
~ChannelConditionModel () override | |
Destructor for the ChannelConditionModel class. More... | |
ChannelConditionModel & | operator= (const ChannelConditionModel &)=delete |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () 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[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () 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 errors. 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 () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::ChannelConditionModel | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
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 | |
void | DoDispose () override |
Destructor implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
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 () |
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< UniformRandomVariable > | m_uniformVar |
uniform random variable More... | |
Private Member Functions | |
Ptr< ChannelCondition > | ComputeChannelCondition (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 ChannelCondition::O2iConditionValue | ComputeO2i (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const |
Determines whether the channel condition is O2I or O2O. 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, Item > | m_channelConditionMap |
map to store the channel conditions More... | |
bool | m_linkO2iConditionToAntennaHeight |
the indicator that determines whether the O2I/O2O condition is determined based on the UE height More... | |
double | m_o2iLowLossThreshold {0} |
the threshold for determining what is the ratio of low - high O2I building penetration losses More... | |
double | m_o2iThreshold |
the threshold for determining what is the ratio of channels with O2I More... | |
Ptr< UniformRandomVariable > | m_uniformO2iLowHighLossVar |
a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7.4.3-2 More... | |
Ptr< UniformRandomVariable > | m_uniformVarO2i |
uniform random variable that is used for the generation of the O2i conditions More... | |
Time | m_updatePeriod |
the update period for the channel condition More... | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Base class for the 3GPP channel condition models.
Definition at line 441 of file channel-condition-model.h.
|
protected |
Determine the density of vehicles in a V2V scenario.
Enumerator | |
---|---|
LOW | |
MEDIUM | |
HIGH | |
INVALID |
Definition at line 492 of file channel-condition-model.h.
ns3::ThreeGppChannelConditionModel::ThreeGppChannelConditionModel | ( | ) |
Constructor for the ThreeGppRmaChannelConditionModel class.
Definition at line 337 of file channel-condition-model.cc.
References m_uniformO2iLowHighLossVar, m_uniformVar, m_uniformVarO2i, and ns3::ObjectBase::SetAttribute().
|
override |
Destructor for the ThreeGppRmaChannelConditionModel class.
Definition at line 348 of file channel-condition-model.cc.
|
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.
stream | the offset used to set the stream numbers |
Implements ns3::ChannelConditionModel.
Definition at line 507 of file channel-condition-model.cc.
References m_uniformO2iLowHighLossVar, m_uniformVar, m_uniformVarO2i, and ns3::RandomVariableStream::SetStream().
Referenced by ThreeGppV2vUrbanLosNlosvChCondModelTestCase::DoRun(), ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun(), V2vUrbanProbChCondModelTestCase::DoRun(), and V2vHighwayProbChCondModelTestCase::DoRun().
|
staticprotected |
Computes the 2D distance between two 3D vectors.
a | the first 3D vector |
b | the second 3D vector |
Definition at line 517 of file channel-condition-model.cc.
References two-ray-to-three-gpp-ch-calibration::x.
Referenced by ns3::ThreeGppV2vUrbanChannelConditionModel::ComputePlos(), ns3::ThreeGppV2vHighwayChannelConditionModel::ComputePlos(), ns3::ThreeGppRmaChannelConditionModel::ComputePlos(), ns3::ThreeGppUmaChannelConditionModel::ComputePlos(), ns3::ThreeGppUmiStreetCanyonChannelConditionModel::ComputePlos(), ns3::ThreeGppIndoorMixedOfficeChannelConditionModel::ComputePlos(), ns3::ThreeGppIndoorOpenOfficeChannelConditionModel::ComputePlos(), ns3::ProbabilisticV2vUrbanChannelConditionModel::ComputePlos(), ns3::ProbabilisticV2vHighwayChannelConditionModel::ComputePlos(), ns3::ProbabilisticV2vUrbanChannelConditionModel::ComputePnlos(), and ns3::ProbabilisticV2vHighwayChannelConditionModel::ComputePnlos().
|
private |
This method computes the channel condition based on a probabilistic model that is specific for the scenario of interest.
a | tx mobility model |
b | rx mobility model |
Definition at line 441 of file channel-condition-model.cc.
References ComputeO2i(), ComputePlos(), ComputePnlos(), ns3::UniformRandomVariable::GetValue(), ns3::olsr::HIGH, ns3::olsr::LOW, m_o2iLowLossThreshold, m_uniformO2iLowHighLossVar, m_uniformVar, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by GetChannelCondition().
|
privatevirtual |
Determines whether the channel condition is O2I or O2O.
a | tx mobility model |
b | rx mobility model |
Definition at line 409 of file channel-condition-model.cc.
References ns3::UniformRandomVariable::GetValue(), m_linkO2iConditionToAntennaHeight, m_o2iThreshold, m_uniformVarO2i, min, and NS_LOG_INFO.
Referenced by ComputeChannelCondition().
|
privatepure virtual |
Compute the LOS probability.
a | tx mobility model |
b | rx mobility model |
Implemented in ns3::ProbabilisticV2vHighwayChannelConditionModel, ns3::ProbabilisticV2vUrbanChannelConditionModel, ns3::ThreeGppIndoorOpenOfficeChannelConditionModel, ns3::ThreeGppIndoorMixedOfficeChannelConditionModel, ns3::ThreeGppUmiStreetCanyonChannelConditionModel, ns3::ThreeGppUmaChannelConditionModel, ns3::ThreeGppRmaChannelConditionModel, ns3::ThreeGppV2vHighwayChannelConditionModel, and ns3::ThreeGppV2vUrbanChannelConditionModel.
Referenced by ComputeChannelCondition(), and ComputePnlos().
|
privatevirtual |
Compute the NLOS probability.
By default returns 1 - PLOS
a | tx mobility model |
b | rx mobility model |
Reimplemented in ns3::ProbabilisticV2vHighwayChannelConditionModel, ns3::ProbabilisticV2vUrbanChannelConditionModel, ns3::ThreeGppV2vHighwayChannelConditionModel, and ns3::ThreeGppV2vUrbanChannelConditionModel.
Definition at line 498 of file channel-condition-model.cc.
References ComputePlos(), and NS_LOG_FUNCTION.
Referenced by ComputeChannelCondition().
|
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 353 of file channel-condition-model.cc.
References m_channelConditionMap, m_updatePeriod, and ns3::Seconds().
|
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.
a | mobility model |
b | mobility model |
Implements ns3::ChannelConditionModel.
Definition at line 360 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 ThreeGppV2vUrbanLosNlosvChCondModelTestCase::EvaluateChannelCondition(), ThreeGppV2vHighwayLosNlosvChCondModelTestCase::EvaluateChannelCondition(), ThreeGppChannelConditionModelTestCase::EvaluateChannelCondition(), V2vUrbanProbChCondModelTestCase::EvaluateChannelCondition(), and V2vHighwayProbChCondModelTestCase::EvaluateChannelCondition().
|
staticprivate |
Returns a unique and reciprocal key for the channel between a and b.
a | tx mobility model |
b | rx mobility model |
Definition at line 527 of file channel-condition-model.cc.
References ns3::Node::GetId(), max, and min.
Referenced by GetChannelCondition().
|
static |
Get the type ID.
Get the type ID.
Definition at line 299 of file channel-condition-model.cc.
References m_linkO2iConditionToAntennaHeight, m_o2iLowLossThreshold, m_o2iThreshold, m_updatePeriod, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDoubleAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MilliSeconds(), and ns3::TypeId::SetParent().
|
private |
map to store the channel conditions
Definition at line 568 of file channel-condition-model.h.
Referenced by DoDispose(), and GetChannelCondition().
|
private |
the indicator that determines whether the O2I/O2O condition is determined based on the UE height
Definition at line 575 of file channel-condition-model.h.
Referenced by ComputeO2i(), and GetTypeId().
|
private |
the threshold for determining what is the ratio of low - high O2I building penetration losses
Definition at line 573 of file channel-condition-model.h.
Referenced by ComputeChannelCondition(), and GetTypeId().
|
private |
the threshold for determining what is the ratio of channels with O2I
Definition at line 571 of file channel-condition-model.h.
Referenced by ComputeO2i(), and GetTypeId().
|
private |
a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7.4.3-2
Definition at line 581 of file channel-condition-model.h.
Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeChannelCondition().
|
protected |
uniform random variable
Definition at line 508 of file channel-condition-model.h.
Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeChannelCondition().
|
private |
uniform random variable that is used for the generation of the O2i conditions
Definition at line 578 of file channel-condition-model.h.
Referenced by ThreeGppChannelConditionModel(), AssignStreams(), and ComputeO2i().
|
private |
the update period for the channel condition
Definition at line 569 of file channel-condition-model.h.
Referenced by DoDispose(), GetChannelCondition(), and GetTypeId().