DESERT 4.0.0
UwHermesPhy Class Reference

#include <uwhermesphy.h>

Inheritance diagram for UwHermesPhy:
Inheritance graph
Collaboration diagram for UwHermesPhy:
Collaboration graph

Public Member Functions

 UwHermesPhy ()
 
virtual ~UwHermesPhy ()
 
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, int nbits, 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
 
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 matchPS (double distance, int size)
 
virtual double linearInterpolator (double x, double x1, double y1, double x2, double y2)
 
virtual double chunckInterpolator (double p, int size)
 

Private Attributes

string pdr_file_name_
 
char pdr_token_separator_
 
PdrLut range2pdr_
 
bool initLUT_
 
int BCH_N
 
int BCH_K
 
int BCH_T
 
int FRAME_BIT
 

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

◆ UwHermesPhy()

UwHermesPhy::UwHermesPhy ( )

Constructor of UwHermesPhy class.

References BCH_K, BCH_N, BCH_T, FRAME_BIT, and UnderwaterPhysical::Interference_Model.

◆ ~UwHermesPhy()

UwHermesPhy::~UwHermesPhy ( )
virtual

Destructor of UwHermesPhy class.

Member Function Documentation

◆ chunckInterpolator()

double UwHermesPhy::chunckInterpolator ( double  p,
int  size 
)
privatevirtual

References FRAME_BIT.

Referenced by matchPS().

◆ command()

int UwHermesPhy::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_, and pdr_token_separator_.

Here is the call graph for this function:

◆ endRx()

◆ getDistance()

double UwHermesPhy::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 UwHermesPhy::getPER ( double  snr,
int  nbits,
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).
nbitslength in bit of the packet.
pPacket by witch the module gets information about source and destination.
Returns
PER of the packet passed as parameter.

Reimplemented from UnderwaterPhysical.

References getDistance(), and matchPS().

Referenced by endRx().

Here is the call graph for this function:

◆ initializeLUT()

void UwHermesPhy::initializeLUT ( )
protectedvirtual

References initLUT_, pdr_file_name_, and range2pdr_.

Referenced by command().

◆ linearInterpolator()

double UwHermesPhy::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 matchPS().

◆ matchPS()

double UwHermesPhy::matchPS ( double  distance,
int  size 
)
privatevirtual

Return the PER via linear interpolation.

Parameters
distancedistance between source and destination.
sizePacket size in bit.

References chunckInterpolator(), linearInterpolator(), and range2pdr_.

Referenced by getPER().

Here is the call graph for this function:

Member Data Documentation

◆ BCH_K

int UwHermesPhy::BCH_K
private

Referenced by UwHermesPhy().

◆ BCH_N

int UwHermesPhy::BCH_N
private

BCH(n,k,t) : correction of t errors via BCH code new frame length= FRAME_BIT/k*n, example: 9152/11*15 by default BCH(15,11,1)

Referenced by UwHermesPhy().

◆ BCH_T

int UwHermesPhy::BCH_T
private

Referenced by UwHermesPhy().

◆ FRAME_BIT

int UwHermesPhy::FRAME_BIT
private

Referenced by chunckInterpolator(), and UwHermesPhy().

◆ initLUT_

bool UwHermesPhy::initLUT_
private

Referenced by endRx(), and initializeLUT().

◆ pdr_file_name_

string UwHermesPhy::pdr_file_name_
private

Referenced by command(), and initializeLUT().

◆ pdr_token_separator_

char UwHermesPhy::pdr_token_separator_
private

Referenced by command().

◆ range2pdr_

PdrLut UwHermesPhy::range2pdr_
private

Referenced by initializeLUT(), and matchPS().


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