DESERT 3.5.1
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 *)
 
virtual void recv (Packet *)
 
int recvSyncClMsg (ClMessage *m)
 

Protected Member Functions

virtual void updateInstantaneousStats ()
 
virtual void endTx (Packet *p)
 
virtual void endRx (Packet *p)
 
virtual void startRx (Packet *p)
 
virtual double consumedEnergyTx (const double &_duration)
 
virtual double consumedEnergyRx (const double &_duration)
 
virtual double getPER (double snr, int nbits, Packet *)
 
const bool isZero (const double &value) const
 
double Get_Tx_Time ()
 
double Get_Rx_Time ()
 
double Get_Energy_Tx ()
 
double Get_Energy_Rx ()
 
double Get_Transmitted_bytes ()
 
void incrTot_pkts_lost ()
 
void incrTotCrtl_pkts_lost ()
 
void incrErrorCtrlPktsInterf ()
 
void incrCollisionDATAvsCTRL ()
 
void incrCollisionCTRL ()
 
void incrCollisionDATA ()
 
int getTot_pkts_lost ()
 
int getTot_CtrlPkts_lost ()
 
int getError_CtrlPktsInterf ()
 
int getCollisionsDATAvsCTRL ()
 
int getCollisionsCTRL ()
 
int getCollisionsDATA ()
 
const double log2 (const double &_input) const
 
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 112 of file uwphysical.h.

Constructor & Destructor Documentation

◆ UnderwaterPhysical()

UnderwaterPhysical::UnderwaterPhysical ( )

Constructor of UnderwaterPhysical class.

Definition at line 109 of file uwphysical.cpp.

◆ ~UnderwaterPhysical()

UnderwaterPhysical::~UnderwaterPhysical ( )
virtual

Destructor of UnderwaterPhysical class.

Definition at line 134 of file uwphysical.cpp.

Member Function Documentation

◆ command()

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

Definition at line 141 of file uwphysical.cpp.

◆ consumedEnergyRx()

virtual double UnderwaterPhysical::consumedEnergyRx ( const double &  _duration)
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 200 of file uwphysical.h.

◆ consumedEnergyTx()

virtual double UnderwaterPhysical::consumedEnergyTx ( const double &  _duration)
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 188 of file uwphysical.h.

◆ endRx()

void UnderwaterPhysical::endRx ( Packet *  p)
protectedvirtual

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 404 of file uwphysical.cpp.

◆ endTx()

void UnderwaterPhysical::endTx ( Packet *  p)
protectedvirtual

Handles the end of a packet transmission.

Parameters
Packet*p Pointer to the packet transmitted

Reimplemented in UwOFDMPhy.

Definition at line 304 of file uwphysical.cpp.

◆ Get_Energy_Rx()

double UnderwaterPhysical::Get_Energy_Rx ( )
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 275 of file uwphysical.h.

◆ Get_Energy_Tx()

double UnderwaterPhysical::Get_Energy_Tx ( )
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 264 of file uwphysical.h.

◆ get_prob_error_symbol_mpsk()

const 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 423 of file uwphysical.h.

◆ Get_Rx_Time()

double UnderwaterPhysical::Get_Rx_Time ( )
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 253 of file uwphysical.h.

◆ Get_Transmitted_bytes()

double UnderwaterPhysical::Get_Transmitted_bytes ( )
inlineprotected

Returns the number of bytes transmitted.

Returns
the number of bytes transmitted.

Definition at line 286 of file uwphysical.h.

◆ Get_Tx_Time()

double UnderwaterPhysical::Get_Tx_Time ( )
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 242 of file uwphysical.h.

◆ getCollisionsCTRL()

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

Definition at line 390 of file uwphysical.h.

◆ getCollisionsDATA()

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

Definition at line 400 of file uwphysical.h.

◆ getCollisionsDATAvsCTRL()

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

Definition at line 380 of file uwphysical.h.

◆ getError_CtrlPktsInterf()

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

Definition at line 370 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 553 of file uwphysical.cpp.

◆ getTot_CtrlPkts_lost()

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

Definition at line 360 of file uwphysical.h.

◆ getTot_pkts_lost()

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

Definition at line 350 of file uwphysical.h.

◆ incrCollisionCTRL()

void UnderwaterPhysical::incrCollisionCTRL ( )
inlineprotected

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

Definition at line 331 of file uwphysical.h.

◆ incrCollisionDATA()

void UnderwaterPhysical::incrCollisionDATA ( )
inlineprotected

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

Definition at line 340 of file uwphysical.h.

◆ incrCollisionDATAvsCTRL()

void UnderwaterPhysical::incrCollisionDATAvsCTRL ( )
inlineprotected

Increment the number of collisions DATA/CTRL.

Definition at line 322 of file uwphysical.h.

◆ incrErrorCtrlPktsInterf()

void UnderwaterPhysical::incrErrorCtrlPktsInterf ( )
inlineprotected

Increment the number of CTRL packets discarded due to interference.

Definition at line 313 of file uwphysical.h.

◆ incrTot_pkts_lost()

void UnderwaterPhysical::incrTot_pkts_lost ( )
inlineprotected

Increment the number of packets discarded.

Definition at line 295 of file uwphysical.h.

◆ incrTotCrtl_pkts_lost()

void UnderwaterPhysical::incrTotCrtl_pkts_lost ( )
inlineprotected

Increment the number of CTRL packets discarded.

Definition at line 304 of file uwphysical.h.

◆ isZero()

const 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 231 of file uwphysical.h.

◆ log2()

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

Definition at line 411 of file uwphysical.h.

◆ recv()

void UnderwaterPhysical::recv ( Packet *  p)
virtual

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 221 of file uwphysical.cpp.

◆ recvSyncClMsg()

int UnderwaterPhysical::recvSyncClMsg ( ClMessage *  m)

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

Parameters
mPointer cross layer message

Definition at line 582 of file uwphysical.cpp.

◆ startRx()

void UnderwaterPhysical::startRx ( Packet *  p)
protectedvirtual

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 318 of file uwphysical.cpp.

◆ updateInstantaneousStats()

void UnderwaterPhysical::updateInstantaneousStats ( )
protectedvirtual

Update the stats before sending them through crosslayer message.

Definition at line 600 of file uwphysical.cpp.

Member Data Documentation

◆ collisionCTRL

int UnderwaterPhysical::collisionCTRL
protected

Total number of CTRL pkts lost due to collision.

Definition at line 459 of file uwphysical.h.

◆ collisionDATA

int UnderwaterPhysical::collisionDATA
protected

Total number of DATA pkts lost due to collision.

Definition at line 461 of file uwphysical.h.

◆ collisionDataCTRL

int UnderwaterPhysical::collisionDataCTRL
protected

Total number of collisions between DATA pkts and CTRL pkts.

Definition at line 456 of file uwphysical.h.

◆ Energy_Rx_

double UnderwaterPhysical::Energy_Rx_
protected

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

Definition at line 441 of file uwphysical.h.

◆ Energy_Tx_

double UnderwaterPhysical::Energy_Tx_
protected

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

Definition at line 438 of file uwphysical.h.

◆ errorCtrlPktsInterf

int UnderwaterPhysical::errorCtrlPktsInterf
protected

Total number of CTRL pkts lost due to interference.

Definition at line 453 of file uwphysical.h.

◆ interference_

uwinterference* UnderwaterPhysical::interference_
protected

Pointer to the interference model module.

Definition at line 467 of file uwphysical.h.

◆ Interference_Model

std::string UnderwaterPhysical::Interference_Model
protected

Interference calcuation mode chosen: CHUNK model or MEANPOWER model.

Definition at line 463 of file uwphysical.h.

◆ modulation_name_

std::string UnderwaterPhysical::modulation_name_
protected

Modulation scheme name.

Definition at line 429 of file uwphysical.h.

◆ rx_power_

double UnderwaterPhysical::rx_power_
protected

Power required in reception.

Definition at line 447 of file uwphysical.h.

◆ Rx_Time_

double UnderwaterPhysical::Rx_Time_
protected

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

Definition at line 435 of file uwphysical.h.

◆ time_ready_to_end_rx_

double UnderwaterPhysical::time_ready_to_end_rx_
protected

Used to keep track of the arrival time.

Definition at line 430 of file uwphysical.h.

◆ tot_ctrl_pkts_lost

int UnderwaterPhysical::tot_ctrl_pkts_lost
protected

Total number of CTRL pkts lost.

Definition at line 451 of file uwphysical.h.

◆ tot_pkts_lost

int UnderwaterPhysical::tot_pkts_lost
protected

Total number of packets lost.

Definition at line 449 of file uwphysical.h.

◆ Transmitted_bytes_

double UnderwaterPhysical::Transmitted_bytes_
protected

Number of bytes transmitted.

Definition at line 444 of file uwphysical.h.

◆ tx_power_

double UnderwaterPhysical::tx_power_
protected

Power required in transmission.

Definition at line 446 of file uwphysical.h.

◆ Tx_Time_

double UnderwaterPhysical::Tx_Time_
protected

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

Definition at line 433 of file uwphysical.h.


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