#include <uwphysical.h>
Definition at line 112 of file uwphysical.h.
◆ UnderwaterPhysical()
UnderwaterPhysical::UnderwaterPhysical |
( |
| ) |
|
◆ ~UnderwaterPhysical()
UnderwaterPhysical::~UnderwaterPhysical |
( |
| ) |
|
|
virtual |
◆ command()
int UnderwaterPhysical::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
◆ consumedEnergyRx()
virtual double UnderwaterPhysical::consumedEnergyRx |
( |
const double & |
_duration | ) |
|
|
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 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
-
const | double& 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 |
◆ 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
-
_snr | Signal to Noise Ratio |
_M | Number 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
-
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 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
-
- 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
-
m | Pointer 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.
◆ 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_
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 |
◆ 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 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 |
◆ Transmitted_bytes_
double UnderwaterPhysical::Transmitted_bytes_ |
|
protected |
◆ 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: