DESERT 4.0.0
UnderwaterHMMPhysical Class Reference

UnderwaterHMMPhysical models an hidden Markov Model phy channel. More...

#include <uwhmmphysical.h>

Inheritance diagram for UnderwaterHMMPhysical:
Inheritance graph
Collaboration diagram for UnderwaterHMMPhysical:
Collaboration graph

Public Member Functions

 UnderwaterHMMPhysical ()
 
virtual ~UnderwaterHMMPhysical ()
 
virtual int command (int, const char *const *)
 
void setMCLink (int mac, MCLink *link)
 
int getPktsTotBad () const
 
int getPktsTotMedium () const
 
int getPktsTotGood () const
 
void incrTotPkts (MCLink::ChState ch_state)
 
- Public Member Functions inherited from UnderwaterPhysical
 UnderwaterPhysical ()
 
virtual ~UnderwaterPhysical ()
 
virtual void recv (Packet *) override
 
int recvSyncClMsg (ClMessage *m) override
 

Protected Member Functions

virtual void endRx (Packet *p) override
 
virtual double ber2per (double ber, Packet *p)
 
- Protected Member Functions inherited from UnderwaterPhysical
virtual void updateInstantaneousStats ()
 
virtual void endTx (Packet *p) override
 
virtual void startRx (Packet *p) override
 
virtual double consumedEnergyTx (const double &_duration) const
 
virtual double consumedEnergyRx (const double &_duration) const
 
virtual double getPER (double snr, int nbits, Packet *_p)
 
bool isZero (const double &value) const
 
double Get_Tx_Time () const
 
double Get_Rx_Time () const
 
double Get_Energy_Tx () const
 
double Get_Energy_Rx () const
 
double Get_Transmitted_bytes () const
 
void incrTot_pkts_lost ()
 
void incrTotCrtl_pkts_lost ()
 
void incrErrorCtrlPktsInterf ()
 
void incrCollisionDATAvsCTRL ()
 
void incrCollisionCTRL ()
 
void incrCollisionDATA ()
 
int getTot_pkts_lost () const
 
int getTot_CtrlPkts_lost () const
 
int getError_CtrlPktsInterf () const
 
int getCollisionsDATAvsCTRL () const
 
int getCollisionsCTRL () const
 
int getCollisionsDATA () const
 
double log2 (const double &_input) const
 
double get_prob_error_symbol_mpsk (const double &_snr, const uint32_t _M) const
 

Protected Attributes

std::map< int, MCLink * > link_map
 
int pkts_tot_good
 
int pkts_tot_medium
 
int pkts_tot_bad
 
- Protected Attributes inherited from UnderwaterPhysical
std::string modulation_name_
 
double time_ready_to_end_rx_
 
double Tx_Time_
 
double Rx_Time_
 
double Energy_Tx_
 
double Energy_Rx_
 
double Transmitted_bytes_
 
double tx_power_
 
double rx_power_
 
int tot_pkts_lost
 
int tot_ctrl_pkts_lost
 
int errorCtrlPktsInterf
 
int collisionDataCTRL
 
int collisionCTRL
 
int collisionDATA
 
std::string Interference_Model
 
uwinterferenceinterference_
 

Detailed Description

UnderwaterHMMPhysical models an hidden Markov Model phy channel.

Constructor & Destructor Documentation

◆ UnderwaterHMMPhysical()

UnderwaterHMMPhysical::UnderwaterHMMPhysical ( )

Constructor of UnderwaterHMMPhysical class.

◆ ~UnderwaterHMMPhysical()

UnderwaterHMMPhysical::~UnderwaterHMMPhysical ( )
virtual

Destructor of UnderwaterHMMPhysical class.

Member Function Documentation

◆ ber2per()

double UnderwaterHMMPhysical::ber2per ( double  ber,
Packet *  p 
)
protectedvirtual

Returns the packet error rate by using the BER from HMM and the size of a packet

Parameters
beraccording to HMM state
pPacket
Returns
PER of the packet.

Referenced by endRx().

◆ command()

int UnderwaterHMMPhysical::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter. It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray of strings which are the command parameters (Note that argv[0] is the name of the object).
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.

Reimplemented from UnderwaterPhysical.

References UnderwaterPhysical::command(), getPktsTotBad(), getPktsTotGood(), getPktsTotMedium(), and setMCLink().

Here is the call graph for this function:

◆ endRx()

◆ getPktsTotBad()

int UnderwaterHMMPhysical::getPktsTotBad ( ) const
inline
Returns
the number of packets sent with bad channel

References pkts_tot_bad.

Referenced by command().

◆ getPktsTotGood()

int UnderwaterHMMPhysical::getPktsTotGood ( ) const
inline
Returns
the number of packets sent with good channel

References pkts_tot_good.

Referenced by command().

◆ getPktsTotMedium()

int UnderwaterHMMPhysical::getPktsTotMedium ( ) const
inline
Returns
the number of packets sent with medium channel

References pkts_tot_medium.

Referenced by command().

◆ incrTotPkts()

void UnderwaterHMMPhysical::incrTotPkts ( MCLink::ChState  ch_state)
inline

increase the counter of packets sent taking into account the channel state

References MCLink::BAD, MCLink::GOOD, MCLink::MEDIUM, pkts_tot_bad, pkts_tot_good, and pkts_tot_medium.

Referenced by endRx().

◆ setMCLink()

void UnderwaterHMMPhysical::setMCLink ( int  mac,
MCLink link 
)

Adds the Markov Chain transition matrix for each source MAC

Parameters
macMAC of the transmitting node
linkPointer to associated MCLink

References link_map.

Referenced by command().

Member Data Documentation

◆ link_map

std::map<int, MCLink *> UnderwaterHMMPhysical::link_map
protected

maps source mac to associated MCLink

Referenced by endRx(), and setMCLink().

◆ pkts_tot_bad

int UnderwaterHMMPhysical::pkts_tot_bad
protected

Total number of packets arrived with bad channel

Referenced by getPktsTotBad(), and incrTotPkts().

◆ pkts_tot_good

int UnderwaterHMMPhysical::pkts_tot_good
protected

Total number of packets arrived with good channel

Referenced by getPktsTotGood(), and incrTotPkts().

◆ pkts_tot_medium

int UnderwaterHMMPhysical::pkts_tot_medium
protected

Total number of packets arrived with medium channel

Referenced by getPktsTotMedium(), and incrTotPkts().


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