A Discrete-Event Network Simulator
API
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ns3::WaveBsmStats Class Reference

The WaveBsmStats class implements a stats collector for IEEE 1609 WAVE (Wireless Access in Vehicular Environments) Basic Safety Messages (BSMs). More...

#include "wave-bsm-stats.h"

+ Inheritance diagram for ns3::WaveBsmStats:

Public Member Functions

 WaveBsmStats ()
 Constructor. More...
 
double GetBsmPdr (int index)
 Returns the BSM Packet Delivery Ratio (PDR) which is the percent of expected packets within range(index) that are actually received. More...
 
double GetCumulativeBsmPdr (int index)
 Returns the cumulative BSM Packet Delivery Ratio (PDR) which is the percent of cumulative expected packets within range(index) that are actually received. More...
 
int GetExpectedRxPktCount (int index)
 Returns the count of expected packets received within range(index) More...
 
int GetLogging ()
 Gets logging state. More...
 
int GetRxPktCount ()
 Returns the count of packets received. More...
 
int GetRxPktInRangeCount (int index)
 Increments the count of actual packets received within range(index) More...
 
int GetTxByteCount ()
 Returns the count of (application data) bytes transmitted not include MAC/PHY overhead. More...
 
int GetTxPktCount ()
 Returns the count of transmitted packets. More...
 
void IncExpectedRxPktCount (int index)
 Increments the count of (broadcast) packets expected to be received within the coverage area1. More...
 
void IncRxPktCount ()
 Increments the count of actual packets received (regardless of coverage area). More...
 
void IncRxPktInRangeCount (int index)
 Increments the count of actual packets received within the coverage area(index). More...
 
void IncTxByteCount (int bytes)
 Increments the count of (application data) bytes transmitted not including MAC/PHY overhead. More...
 
void IncTxPktCount ()
 Increments the count of transmitted packets. More...
 
void ResetTotalRxPktCounts (int index)
 Resets the count of total packets expected and/or within range(index) that are received. More...
 
void SetExpectedRxPktCount (int index, int count)
 Sets the count of packets expected to received. More...
 
void SetLogging (int log)
 Enables/disables logging. More...
 
void SetRxPktCount (int count)
 Sets the count of packets received. More...
 
void SetRxPktInRangeCount (int index, int count)
 Sets the count of packets within range that are received. More...
 
void SetTxPktCount (int count)
 Sets the count of packets transmitted. 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...
 
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)
 Register this type. 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...
 

Private Attributes

int m_log
 log More...
 
int m_waveByteSendCount
 byte sent count More...
 
std::vector< int > m_wavePktExpectedReceiveCounts
 packet expected receive counts More...
 
std::vector< int > m_wavePktInCoverageReceiveCounts
 packet in ceoverage receive counts More...
 
int m_wavePktReceiveCount
 packet receive count More...
 
int m_wavePktSendCount
 packet sent count More...
 
std::vector< int > m_waveTotalPktExpectedReceiveCounts
 total packet expected receive counts More...
 
std::vector< int > m_waveTotalPktInCoverageReceiveCounts
 total packet in coverage receive counts More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. 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...
 

Detailed Description

The WaveBsmStats class implements a stats collector for IEEE 1609 WAVE (Wireless Access in Vehicular Environments) Basic Safety Messages (BSMs).

The BSM is a ~200-byte packet that is generally broadcast from every vehicle at a nominal rate of 10 Hz.

Internal:
Note: This class collects data elements and accessors along with methods that calculate metrics from the data elements. The data and metrics calculation algorithms are collected together here purely to keep them together. Future work may need to add additional metric calculations, and for now, we are trying to keep all related data and algorithms together, although these could easily be refactored in the future and moved to separate classes. However, it seems that for now, moving the data elements or the algorithms separately into different classes could lead to confusion over usage.

Definition at line 49 of file wave-bsm-stats.h.

Constructor & Destructor Documentation

◆ WaveBsmStats()

ns3::WaveBsmStats::WaveBsmStats ( )

Member Function Documentation

◆ GetBsmPdr()

double ns3::WaveBsmStats::GetBsmPdr ( int  index)

Returns the BSM Packet Delivery Ratio (PDR) which is the percent of expected packets within range(index) that are actually received.

Parameters
indexindex for statistics
Returns
the packet delivery ratio (PDR) of BSMs.

Definition at line 130 of file wave-bsm-stats.cc.

References m_wavePktExpectedReceiveCounts, and m_wavePktInCoverageReceiveCounts.

◆ GetCumulativeBsmPdr()

double ns3::WaveBsmStats::GetCumulativeBsmPdr ( int  index)

Returns the cumulative BSM Packet Delivery Ratio (PDR) which is the percent of cumulative expected packets within range(index) that are actually received.

Parameters
indexindex for statistics
Returns
the packet delivery ratio (PDR) of BSMs.

Definition at line 151 of file wave-bsm-stats.cc.

References m_waveTotalPktExpectedReceiveCounts, and m_waveTotalPktInCoverageReceiveCounts.

◆ GetExpectedRxPktCount()

int ns3::WaveBsmStats::GetExpectedRxPktCount ( int  index)

Returns the count of expected packets received within range(index)

Parameters
indexindex for statistics
Returns
the count of expected packets received within range(index)

Definition at line 94 of file wave-bsm-stats.cc.

References m_wavePktExpectedReceiveCounts.

◆ GetLogging()

int ns3::WaveBsmStats::GetLogging ( )

Gets logging state.

Returns
logging state

Definition at line 178 of file wave-bsm-stats.cc.

References m_log.

◆ GetRxPktCount()

int ns3::WaveBsmStats::GetRxPktCount ( )

Returns the count of packets received.

Returns
the count of packets received

Definition at line 88 of file wave-bsm-stats.cc.

References m_wavePktReceiveCount.

◆ GetRxPktInRangeCount()

int ns3::WaveBsmStats::GetRxPktInRangeCount ( int  index)

Increments the count of actual packets received within range(index)

Parameters
indexindex for statistics
Returns
the count of actual packets received within range(index)

Definition at line 100 of file wave-bsm-stats.cc.

References m_wavePktInCoverageReceiveCounts.

◆ GetTxByteCount()

int ns3::WaveBsmStats::GetTxByteCount ( )

Returns the count of (application data) bytes transmitted not include MAC/PHY overhead.

Returns
number of bytes of application-data transmitted

Definition at line 124 of file wave-bsm-stats.cc.

References m_waveByteSendCount.

◆ GetTxPktCount()

int ns3::WaveBsmStats::GetTxPktCount ( )

Returns the count of transmitted packets.

Returns
count of packets transmitted

Definition at line 62 of file wave-bsm-stats.cc.

References m_wavePktSendCount.

◆ GetTypeId()

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

Register this type.

Returns
The TypeId.

Definition at line 45 of file wave-bsm-stats.cc.

References ns3::TypeId::SetParent().

◆ IncExpectedRxPktCount()

void ns3::WaveBsmStats::IncExpectedRxPktCount ( int  index)

Increments the count of (broadcast) packets expected to be received within the coverage area1.

Broadcast packets (i.e. WAVE Basic Safety Messages) are not ACK'd. For packet delivery ratio (PDR), we need to count transmitted packets that are expected to be received within the coverage area, even though they may not be physically received (due to collisions or receiver power thresholds).

Parameters
indexindex for statistics
Returns
none

Definition at line 68 of file wave-bsm-stats.cc.

References m_wavePktExpectedReceiveCounts, and m_waveTotalPktExpectedReceiveCounts.

◆ IncRxPktCount()

void ns3::WaveBsmStats::IncRxPktCount ( )

Increments the count of actual packets received (regardless of coverage area).

Returns
none

Definition at line 75 of file wave-bsm-stats.cc.

References m_wavePktReceiveCount.

◆ IncRxPktInRangeCount()

void ns3::WaveBsmStats::IncRxPktInRangeCount ( int  index)

Increments the count of actual packets received within the coverage area(index).

Broadcast packets (i.e. WAVE Basic Safety Messages) are not ACK'd. For packet delivery ratio (PDR), we need to count only those received packets that are actually received within the (circular) coverage area.

Parameters
indexindex for statistics
Returns
none

Definition at line 81 of file wave-bsm-stats.cc.

References m_wavePktInCoverageReceiveCounts, and m_waveTotalPktInCoverageReceiveCounts.

◆ IncTxByteCount()

void ns3::WaveBsmStats::IncTxByteCount ( int  bytes)

Increments the count of (application data) bytes transmitted not including MAC/PHY overhead.

Parameters
bytesthe bytes of application-data transmitted
Returns
none

Definition at line 118 of file wave-bsm-stats.cc.

References m_waveByteSendCount.

◆ IncTxPktCount()

void ns3::WaveBsmStats::IncTxPktCount ( )

Increments the count of transmitted packets.

Returns
none

Definition at line 56 of file wave-bsm-stats.cc.

References m_wavePktSendCount.

◆ ResetTotalRxPktCounts()

void ns3::WaveBsmStats::ResetTotalRxPktCounts ( int  index)

Resets the count of total packets expected and/or within range(index) that are received.

Parameters
indexindex for statistics
Returns
none

Definition at line 196 of file wave-bsm-stats.cc.

References m_waveTotalPktExpectedReceiveCounts, and m_waveTotalPktInCoverageReceiveCounts.

◆ SetExpectedRxPktCount()

void ns3::WaveBsmStats::SetExpectedRxPktCount ( int  index,
int  count 
)

Sets the count of packets expected to received.

Parameters
indexindex for statistics
countthe count of packets
Returns
none

Definition at line 184 of file wave-bsm-stats.cc.

References m_wavePktExpectedReceiveCounts.

◆ SetLogging()

void ns3::WaveBsmStats::SetLogging ( int  log)

Enables/disables logging.

Parameters
log
Returns
none

Definition at line 172 of file wave-bsm-stats.cc.

References m_log.

◆ SetRxPktCount()

void ns3::WaveBsmStats::SetRxPktCount ( int  count)

Sets the count of packets received.

Parameters
countthe count of packets received
Returns
none

Definition at line 112 of file wave-bsm-stats.cc.

References m_wavePktReceiveCount.

◆ SetRxPktInRangeCount()

void ns3::WaveBsmStats::SetRxPktInRangeCount ( int  index,
int  count 
)

Sets the count of packets within range that are received.

Parameters
indexindex for statistics
countthe count of packets
Returns
none

Definition at line 190 of file wave-bsm-stats.cc.

References m_wavePktInCoverageReceiveCounts.

◆ SetTxPktCount()

void ns3::WaveBsmStats::SetTxPktCount ( int  count)

Sets the count of packets transmitted.

Parameters
countthe count of packets transmitted
Returns
none

Definition at line 106 of file wave-bsm-stats.cc.

References m_wavePktSendCount.

Member Data Documentation

◆ m_log

int ns3::WaveBsmStats::m_log
private

log

Definition at line 244 of file wave-bsm-stats.h.

Referenced by GetLogging(), and SetLogging().

◆ m_waveByteSendCount

int ns3::WaveBsmStats::m_waveByteSendCount
private

byte sent count

Definition at line 238 of file wave-bsm-stats.h.

Referenced by GetTxByteCount(), and IncTxByteCount().

◆ m_wavePktExpectedReceiveCounts

std::vector<int> ns3::WaveBsmStats::m_wavePktExpectedReceiveCounts
private

packet expected receive counts

Definition at line 241 of file wave-bsm-stats.h.

Referenced by GetBsmPdr(), GetExpectedRxPktCount(), IncExpectedRxPktCount(), SetExpectedRxPktCount(), and WaveBsmStats().

◆ m_wavePktInCoverageReceiveCounts

std::vector<int> ns3::WaveBsmStats::m_wavePktInCoverageReceiveCounts
private

packet in ceoverage receive counts

Definition at line 240 of file wave-bsm-stats.h.

Referenced by GetBsmPdr(), GetRxPktInRangeCount(), IncRxPktInRangeCount(), SetRxPktInRangeCount(), and WaveBsmStats().

◆ m_wavePktReceiveCount

int ns3::WaveBsmStats::m_wavePktReceiveCount
private

packet receive count

Definition at line 239 of file wave-bsm-stats.h.

Referenced by GetRxPktCount(), IncRxPktCount(), and SetRxPktCount().

◆ m_wavePktSendCount

int ns3::WaveBsmStats::m_wavePktSendCount
private

packet sent count

Definition at line 237 of file wave-bsm-stats.h.

Referenced by GetTxPktCount(), IncTxPktCount(), and SetTxPktCount().

◆ m_waveTotalPktExpectedReceiveCounts

std::vector<int> ns3::WaveBsmStats::m_waveTotalPktExpectedReceiveCounts
private

total packet expected receive counts

Definition at line 243 of file wave-bsm-stats.h.

Referenced by GetCumulativeBsmPdr(), IncExpectedRxPktCount(), ResetTotalRxPktCounts(), and WaveBsmStats().

◆ m_waveTotalPktInCoverageReceiveCounts

std::vector<int> ns3::WaveBsmStats::m_waveTotalPktInCoverageReceiveCounts
private

total packet in coverage receive counts

Definition at line 242 of file wave-bsm-stats.h.

Referenced by GetCumulativeBsmPdr(), IncRxPktInRangeCount(), ResetTotalRxPktCounts(), and WaveBsmStats().


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