DESERT 3.6.0
Loading...
Searching...
No Matches
UnderwaterPhysical Class Reference

#include <uwphysical.h>

Inheritance diagram for UnderwaterPhysical:
Collaboration diagram for UnderwaterPhysical:

Public Member Functions

 UnderwaterPhysical ()
 
virtual ~UnderwaterPhysical ()
 
virtual int command (int, const char *const *) override
 
virtual void recv (Packet *) override
 
int recvSyncClMsg (ClMessage *m) override
 

Protected Member Functions

virtual void updateInstantaneousStats ()
 
virtual void endTx (Packet *p) override
 
virtual void endRx (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::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

Definition at line 99 of file uwphysical.h.

Constructor & Destructor Documentation

◆ UnderwaterPhysical()

UnderwaterPhysical::UnderwaterPhysical ( )

Constructor of UnderwaterPhysical class.

Definition at line 111 of file uwphysical.cpp.

◆ ~UnderwaterPhysical()

UnderwaterPhysical::~UnderwaterPhysical ( )
virtual

Destructor of UnderwaterPhysical class.

Definition at line 135 of file uwphysical.cpp.

Member Function Documentation

◆ command()

int UnderwaterPhysical::command ( int  argc,
const char *const *  argv 
)
overridevirtual

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 in UnderwaterPhysicalNoise, UwAhoiPhy, UnderwaterGainFromDb, UwHermesPhy, UnderwaterHMMPhysical, UwOFDMPhy, UnderwaterPhysicaldb, and UnderwaterPhysicalfromdb.

Definition at line 142 of file uwphysical.cpp.

◆ consumedEnergyRx()

virtual double UnderwaterPhysical::consumedEnergyRx ( const double &  _duration) const
inlineprotectedvirtual

Compute the energy (in Joule) spent by the modem in reception.

Parameters
constdouble& time spent by the modem in reception phase
Returns
double& the value of energy in Joule

Definition at line 192 of file uwphysical.h.

◆ consumedEnergyTx()

virtual double UnderwaterPhysical::consumedEnergyTx ( const double &  _duration) const
inlineprotectedvirtual

Compute the energy (in Joule) spent by the modem in transmission.

Parameters
constdouble& time spent by the modem in transmission phase
Returns
double& the value of energy in Joule

Definition at line 179 of file uwphysical.h.

◆ endRx()

void UnderwaterPhysical::endRx ( Packet *  p)
overrideprotectedvirtual

Handles the end of a packet reception.

Parameters
Packet*p Pointer to the packet received

Reimplemented in UwAhoiPhy, UwHermesPhy, UwOFDMPhy, UnderwaterPhysicaldb, and UnderwaterHMMPhysical.

Definition at line 396 of file uwphysical.cpp.

◆ endTx()

void UnderwaterPhysical::endTx ( Packet *  p)
overrideprotectedvirtual

Handles the end of a packet transmission.

Parameters
Packet*p Pointer to the packet transmitted

Reimplemented in UwOFDMPhy.

Definition at line 293 of file uwphysical.cpp.

◆ Get_Energy_Rx()

double UnderwaterPhysical::Get_Energy_Rx ( ) const
inlineprotected

Returns the energy (in Joule) spent by the node in reception.

Returns
energy (in Joule) spent by the node in reception.

Definition at line 267 of file uwphysical.h.

◆ Get_Energy_Tx()

double UnderwaterPhysical::Get_Energy_Tx ( ) const
inlineprotected

Returns the energy (in Joule) spent by the node in transmission.

Returns
energy (in Joule) spent by the node in transmission.

Definition at line 256 of file uwphysical.h.

◆ get_prob_error_symbol_mpsk()

double UnderwaterPhysical::get_prob_error_symbol_mpsk ( const double &  _snr,
const uint32_t  _M 
) const
inlineprotected
Parameters
_snrSignal to Noise Ratio
_MNumber of simbol of the the MPSK
Returns
Probability error for the symbol

Definition at line 414 of file uwphysical.h.

◆ Get_Rx_Time()

double UnderwaterPhysical::Get_Rx_Time ( ) const
inlineprotected

Returns the time (in seconds) spent by the node in reception.

Returns
time (in seconds) spent by the node in reception.

Definition at line 245 of file uwphysical.h.

◆ Get_Transmitted_bytes()

double UnderwaterPhysical::Get_Transmitted_bytes ( ) const
inlineprotected

Returns the number of bytes transmitted.

Returns
the number of bytes transmitted.

Definition at line 278 of file uwphysical.h.

◆ Get_Tx_Time()

double UnderwaterPhysical::Get_Tx_Time ( ) const
inlineprotected

Returns the time (in seconds) spent by the node in transmission.

Returns
time (in seconds) spent by the node in transmission.

Definition at line 234 of file uwphysical.h.

◆ getCollisionsCTRL()

int UnderwaterPhysical::getCollisionsCTRL ( ) const
inlineprotected
Returns
the number of collisions with a CTRL packet

Definition at line 381 of file uwphysical.h.

◆ getCollisionsDATA()

int UnderwaterPhysical::getCollisionsDATA ( ) const
inlineprotected
Returns
the number of collisions with a DATA packet

Definition at line 391 of file uwphysical.h.

◆ getCollisionsDATAvsCTRL()

int UnderwaterPhysical::getCollisionsDATAvsCTRL ( ) const
inlineprotected
Returns
the total number of collision between DATA and CTRL

Definition at line 371 of file uwphysical.h.

◆ getError_CtrlPktsInterf()

int UnderwaterPhysical::getError_CtrlPktsInterf ( ) const
inlineprotected
Returns
the total number of CTRL pkts lost due to interference

Definition at line 361 of file uwphysical.h.

◆ getPER()

double UnderwaterPhysical::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 in UnderwaterPhysicalfromdb, UwHermesPhy, and UnderwaterGainFromDb.

Definition at line 555 of file uwphysical.cpp.

◆ getTot_CtrlPkts_lost()

int UnderwaterPhysical::getTot_CtrlPkts_lost ( ) const
inlineprotected
Returns
the total number of CTRL packets lost

Definition at line 351 of file uwphysical.h.

◆ getTot_pkts_lost()

int UnderwaterPhysical::getTot_pkts_lost ( ) const
inlineprotected
Returns
the total number of packets lost

Definition at line 341 of file uwphysical.h.

◆ incrCollisionCTRL()

void UnderwaterPhysical::incrCollisionCTRL ( )
inlineprotected

Increment the number of CTRL pkts discarded due to a collision.

Definition at line 323 of file uwphysical.h.

◆ incrCollisionDATA()

void UnderwaterPhysical::incrCollisionDATA ( )
inlineprotected

Increment the number of DATA pkts discarded due to a collision.

Definition at line 332 of file uwphysical.h.

◆ incrCollisionDATAvsCTRL()

void UnderwaterPhysical::incrCollisionDATAvsCTRL ( )
inlineprotected

Increment the number of collisions DATA/CTRL.

Definition at line 314 of file uwphysical.h.

◆ incrErrorCtrlPktsInterf()

void UnderwaterPhysical::incrErrorCtrlPktsInterf ( )
inlineprotected

Increment the number of CTRL packets discarded due to interference.

Definition at line 305 of file uwphysical.h.

◆ incrTot_pkts_lost()

void UnderwaterPhysical::incrTot_pkts_lost ( )
inlineprotected

Increment the number of packets discarded.

Definition at line 287 of file uwphysical.h.

◆ incrTotCrtl_pkts_lost()

void UnderwaterPhysical::incrTotCrtl_pkts_lost ( )
inlineprotected

Increment the number of CTRL packets discarded.

Definition at line 296 of file uwphysical.h.

◆ isZero()

bool UnderwaterPhysical::isZero ( const double &  value) const
inlineprotected

Evaluates is the number passed as input is equal to zero.

When C++ works with double and float number you can't compare them with 0. If the absolute value of the number is smaller than eplison that means that the number is equal to zero.

Parameters
double&Number to evaluate.
Returns
true if the number passed in input is equal to zero, false otherwise.
See also
std::numeric_limits<double>::epsilon()

Definition at line 223 of file uwphysical.h.

◆ log2()

double UnderwaterPhysical::log2 ( const double &  _input) const
inlineprotected
Parameters
_inputInput value.
Returns
the log base 2 of the input.

Definition at line 402 of file uwphysical.h.

◆ recv()

void UnderwaterPhysical::recv ( Packet *  p)
overridevirtual

recv method.

It is called when a packet is received from the channel

Parameters
Packet*Pointer to the packet that are going to be received

Reimplemented in UwOFDMPhy, and UnderwaterPhysicaldb.

Definition at line 219 of file uwphysical.cpp.

◆ recvSyncClMsg()

int UnderwaterPhysical::recvSyncClMsg ( ClMessage *  m)
override

recv syncronous cross layer messages to require an operation from another module

Parameters
mPointer cross layer message

Definition at line 586 of file uwphysical.cpp.

◆ startRx()

void UnderwaterPhysical::startRx ( Packet *  p)
overrideprotectedvirtual

Handles the start of a reception.

This method is called from the recv method

Parameters
Packet*p Pointer to the packet that the PHY are receiving.

Reimplemented in UwOFDMPhy.

Definition at line 307 of file uwphysical.cpp.

◆ updateInstantaneousStats()

void UnderwaterPhysical::updateInstantaneousStats ( )
protectedvirtual

Update the stats before sending them through crosslayer message.

Definition at line 604 of file uwphysical.cpp.

Member Data Documentation

◆ collisionCTRL

int UnderwaterPhysical::collisionCTRL
protected

Total number of CTRL pkts lost due to collision.

Definition at line 437 of file uwphysical.h.

◆ collisionDATA

int UnderwaterPhysical::collisionDATA
protected

Total number of DATA pkts lost due to collision.

Definition at line 439 of file uwphysical.h.

◆ collisionDataCTRL

int UnderwaterPhysical::collisionDataCTRL
protected

Total number of collisions between DATA pkts and CTRL pkts.

Definition at line 435 of file uwphysical.h.

◆ Energy_Rx_

double UnderwaterPhysical::Energy_Rx_
protected

Energy (in Joule) spent by the node in transmission.

Definition at line 426 of file uwphysical.h.

◆ Energy_Tx_

double UnderwaterPhysical::Energy_Tx_
protected

Energy (in Joule) spent by the node in transmission.

Definition at line 424 of file uwphysical.h.

◆ errorCtrlPktsInterf

int UnderwaterPhysical::errorCtrlPktsInterf
protected

Total number of CTRL pkts lost due to interference.

Definition at line 433 of file uwphysical.h.

◆ interference_

uwinterference* UnderwaterPhysical::interference_
protected

Pointer to the interference module.

Definition at line 444 of file uwphysical.h.

◆ Interference_Model

std::string UnderwaterPhysical::Interference_Model
protected

Interference calcuation mode chosen: CHUNK model or MEANPOWER model.

Definition at line 441 of file uwphysical.h.

◆ modulation_name_

std::string UnderwaterPhysical::modulation_name_
protected

Modulation scheme name.

Definition at line 419 of file uwphysical.h.

◆ rx_power_

double UnderwaterPhysical::rx_power_
protected

Power required in reception.

Definition at line 430 of file uwphysical.h.

◆ Rx_Time_

double UnderwaterPhysical::Rx_Time_
protected

Time (in seconds) spent by the node in reception.

Definition at line 423 of file uwphysical.h.

◆ time_ready_to_end_rx_

double UnderwaterPhysical::time_ready_to_end_rx_
protected

Used to keep track of the rx time.

Definition at line 420 of file uwphysical.h.

◆ tot_ctrl_pkts_lost

int UnderwaterPhysical::tot_ctrl_pkts_lost
protected

Total number of CTRL pkts lost.

Definition at line 432 of file uwphysical.h.

◆ tot_pkts_lost

int UnderwaterPhysical::tot_pkts_lost
protected

Total number of packets lost.

Definition at line 431 of file uwphysical.h.

◆ Transmitted_bytes_

double UnderwaterPhysical::Transmitted_bytes_
protected

Number of bytes transmitted.

Definition at line 428 of file uwphysical.h.

◆ tx_power_

double UnderwaterPhysical::tx_power_
protected

Power required in transmission.

Definition at line 429 of file uwphysical.h.

◆ Tx_Time_

double UnderwaterPhysical::Tx_Time_
protected

Time (in seconds) spent by the node in transmission.

Definition at line 421 of file uwphysical.h.


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