DESERT 4.0.0
UwAhoiPhy Class Reference

#include <uwahoi-phy.h>

Inheritance diagram for UwAhoiPhy:
Inheritance graph
Collaboration diagram for UwAhoiPhy:
Collaboration graph

Public Member Functions

 UwAhoiPhy ()
 
virtual ~UwAhoiPhy ()
 
virtual int command (int, const char *const *)
 
- 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)
 
virtual double getPER (double snr, Packet *)
 
virtual void initializeLUT ()
 
- 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
 

Private Member Functions

virtual double getDistance (Packet *)
 
virtual double matchDistancePDR (double distance)
 
virtual double matchSIR_PDR (double sir)
 
virtual double linearInterpolator (double x, double x1, double y1, double x2, double y2)
 

Private Attributes

string pdr_file_name_
 
string sir_file_name_
 
char pdr_token_separator_
 
PdrLut range2pdr_
 
PdrLut sir2pdr_
 
bool initLUT_
 

Additional Inherited Members

- 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_
 

Constructor & Destructor Documentation

◆ UwAhoiPhy()

UwAhoiPhy::UwAhoiPhy ( )

Constructor of UwAhoiPhy class.

References UnderwaterPhysical::Interference_Model.

◆ ~UwAhoiPhy()

UwAhoiPhy::~UwAhoiPhy ( )
virtual

Destructor of UwAhoiPhy class.

Member Function Documentation

◆ command()

int UwAhoiPhy::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(), initializeLUT(), pdr_file_name_, pdr_token_separator_, and sir_file_name_.

Here is the call graph for this function:

◆ endRx()

◆ getDistance()

double UwAhoiPhy::getDistance ( Packet *  _p)
privatevirtual

Return the distance between source and destination.

Parameters
pPacket by witch the module gets information about source and destination.

Referenced by getPER().

◆ getPER()

double UwAhoiPhy::getPER ( double  snr,
Packet *  _p 
)
protectedvirtual

Returns the packet error rate by using the length of a packet and the information contained in the packet (position of the source and the destiantion.

Parameters
snrCalculated by nsmiracle with the Urick model (unused).
pPacket by witch the module gets information about source and destination.
Returns
PER of the packet passed as parameter.

References getDistance(), matchDistancePDR(), and matchSIR_PDR().

Referenced by endRx().

Here is the call graph for this function:

◆ initializeLUT()

void UwAhoiPhy::initializeLUT ( )
protectedvirtual

◆ linearInterpolator()

double UwAhoiPhy::linearInterpolator ( double  x,
double  x1,
double  y1,
double  x2,
double  y2 
)
privatevirtual

Return y via linear interpolation given two points.

Parameters
xinput.
x1,y1coordinates of the first point.
x2,y2coordinates of the second point.

References q.

Referenced by matchDistancePDR(), and matchSIR_PDR().

◆ matchDistancePDR()

double UwAhoiPhy::matchDistancePDR ( double  distance)
privatevirtual

Return the PER via linear interpolation.

Parameters
distancedistance between source and destination.

References linearInterpolator(), and range2pdr_.

Referenced by getPER().

Here is the call graph for this function:

◆ matchSIR_PDR()

double UwAhoiPhy::matchSIR_PDR ( double  sir)
privatevirtual

Return the PER via linear interpolation.

Parameters
distancedistance between source and destination.

References linearInterpolator(), and sir2pdr_.

Referenced by getPER().

Here is the call graph for this function:

Member Data Documentation

◆ initLUT_

bool UwAhoiPhy::initLUT_
private

Referenced by endRx(), and initializeLUT().

◆ pdr_file_name_

string UwAhoiPhy::pdr_file_name_
private

Referenced by command(), and initializeLUT().

◆ pdr_token_separator_

char UwAhoiPhy::pdr_token_separator_
private

Referenced by command(), and initializeLUT().

◆ range2pdr_

PdrLut UwAhoiPhy::range2pdr_
private

Referenced by initializeLUT(), and matchDistancePDR().

◆ sir2pdr_

PdrLut UwAhoiPhy::sir2pdr_
private

Referenced by initializeLUT(), and matchSIR_PDR().

◆ sir_file_name_

string UwAhoiPhy::sir_file_name_
private

Referenced by command(), and initializeLUT().


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