#include <uwphysical.h>
Definition at line 99 of file uwphysical.h.
◆ UnderwaterPhysical()
UnderwaterPhysical::UnderwaterPhysical |
( |
| ) |
|
◆ ~UnderwaterPhysical()
UnderwaterPhysical::~UnderwaterPhysical |
( |
| ) |
|
|
virtual |
◆ command()
int UnderwaterPhysical::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
overridevirtual |
◆ consumedEnergyRx()
virtual double UnderwaterPhysical::consumedEnergyRx |
( |
const double & |
_duration | ) |
const |
|
inlineprotectedvirtual |
Compute the energy (in Joule) spent by the modem in reception.
- Parameters
-
const | double& 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
-
const | double& 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 |
◆ 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
-
_snr | Signal to Noise Ratio |
_M | Number 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
-
snr | Calculated by nsmiracle with the Urick model (unused). |
nbits | length in bit of the packet. |
p | Packet 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
-
- 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
-
m | Pointer 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.
◆ 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_
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 |
◆ rx_power_
double UnderwaterPhysical::rx_power_ |
|
protected |
◆ 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 |
◆ Transmitted_bytes_
double UnderwaterPhysical::Transmitted_bytes_ |
|
protected |
◆ 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: