DESERT 3.5.1
Loading...
Searching...
No Matches
UnderwaterPhysicalNoise Class Reference

#include <uwphysicalnoise.h>

Inheritance diagram for UnderwaterPhysicalNoise:
Collaboration diagram for UnderwaterPhysicalNoise:

Classes

struct  Noisesource
 

Public Member Functions

 UnderwaterPhysicalNoise ()
 
virtual ~UnderwaterPhysicalNoise ()=default
 
virtual int command (int argc, const char *const *argv) override
 
virtual void addNoiseSource (size_t id, double len, ship_noise::ShipCategory cat, Position *pos)
 
virtual void removeNoiseSourcefromID (size_t id)
 
virtual double vesselNoisePower (Packet *p)
 
- Public Member Functions inherited from UnderwaterPhysical
 UnderwaterPhysical ()
 
virtual ~UnderwaterPhysical ()
 
virtual void recv (Packet *)
 
int recvSyncClMsg (ClMessage *m)
 

Static Public Attributes

static constexpr const double MS_TO_KNOTS
 

Protected Member Functions

virtual double getNoisePower (Packet *p) override
 
virtual double getSpeedKnots (Position *p) const
 
- Protected Member Functions inherited from UnderwaterPhysical
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

int debug_noise
 
int ship_stop
 
double granularity
 
std::vector< Noisesourcenoise_src
 
- 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_
 

Detailed Description

Definition at line 46 of file uwphysicalnoise.h.

Constructor & Destructor Documentation

◆ UnderwaterPhysicalNoise()

UnderwaterPhysicalNoise::UnderwaterPhysicalNoise ( )

Constructor of UnderwaterPhysicalNoise class.

Definition at line 59 of file uwphysicalnoise.cpp.

◆ ~UnderwaterPhysicalNoise()

virtual UnderwaterPhysicalNoise::~UnderwaterPhysicalNoise ( )
virtualdefault

Destructor of UnderwaterPhysicalNoise class.

Member Function Documentation

◆ addNoiseSource()

void UnderwaterPhysicalNoise::addNoiseSource ( size_t  id,
double  len,
ship_noise::ShipCategory  cat,
Position *  pos 
)
virtual

It adds the noise emitter corresponding to the given id.

Parameters
size_tID of the emitter
doubleLength of the vessel
ShipCategoryCategory of the vessel
Position*Pointer to the position of the emitter

Definition at line 114 of file uwphysicalnoise.cpp.

◆ command()

int UnderwaterPhysicalNoise::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 from UnderwaterPhysical.

Definition at line 71 of file uwphysicalnoise.cpp.

◆ getNoisePower()

double UnderwaterPhysicalNoise::getNoisePower ( Packet *  p)
overrideprotectedvirtual

Compute the noise power, considering also vessels noise if needed.

Parameters
Packet*pointer to the packet received
Returns
double Total noise power

Definition at line 224 of file uwphysicalnoise.cpp.

◆ getSpeedKnots()

double UnderwaterPhysicalNoise::getSpeedKnots ( Position *  p) const
protectedvirtual

Compute the speed of the vessel in knots.

Parameters
Position*pointer to the position.
Returns
double Speed of a vessel in m/s

Definition at line 209 of file uwphysicalnoise.cpp.

◆ removeNoiseSourcefromID()

void UnderwaterPhysicalNoise::removeNoiseSourcefromID ( size_t  id)
virtual

It removes the noise emitter corresponding to the given id.

Parameters
size_tID of the emitter

Definition at line 133 of file uwphysicalnoise.cpp.

◆ vesselNoisePower()

double UnderwaterPhysicalNoise::vesselNoisePower ( Packet *  p)
virtual

It calculates the total noise power, iterating on the vessel map.

Parameters
Packet*Pointer to the packet that is going to be received
Returns
double Total vessels noise power

Definition at line 142 of file uwphysicalnoise.cpp.

Member Data Documentation

◆ debug_noise

int UnderwaterPhysicalNoise::debug_noise
protected

Definition at line 131 of file uwphysicalnoise.h.

◆ granularity

double UnderwaterPhysicalNoise::granularity
protected

Number of step for the integration.

Definition at line 133 of file uwphysicalnoise.h.

◆ MS_TO_KNOTS

constexpr const double UnderwaterPhysicalNoise::MS_TO_KNOTS
staticconstexpr
Initial value:
=
1.94384

Conversion m/s to knots.

Definition at line 101 of file uwphysicalnoise.h.

◆ noise_src

std::vector<Noisesource> UnderwaterPhysicalNoise::noise_src
protected

Vector that stores all the vessels.

Definition at line 135 of file uwphysicalnoise.h.

◆ ship_stop

int UnderwaterPhysicalNoise::ship_stop
protected

If enabled, the speed is set to zero when the ship reaches its destination.

Definition at line 132 of file uwphysicalnoise.h.


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