DESERT 4.0.0
UnderwaterPhysicalNoise Class Reference

#include <uwphysicalnoise.h>

Inheritance diagram for UnderwaterPhysicalNoise:
Inheritance graph
Collaboration diagram for UnderwaterPhysicalNoise:
Collaboration graph

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 *) override
 
int recvSyncClMsg (ClMessage *m) override
 

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) 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

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_
 

Constructor & Destructor Documentation

◆ UnderwaterPhysicalNoise()

UnderwaterPhysicalNoise::UnderwaterPhysicalNoise ( )

Constructor of UnderwaterPhysicalNoise class.

References debug_noise, granularity, and ship_stop.

◆ ~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

References debug_noise, and noise_src.

Referenced by command().

◆ 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.

References addNoiseSource(), UnderwaterPhysical::command(), and removeNoiseSourcefromID().

Here is the call graph for this function:

◆ 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

References noise_src, and vesselNoisePower().

Here is the call graph for this function:

◆ 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

References UWSMPosition::getSpeed(), UWSMPosition::isDestReached(), MS_TO_KNOTS, and ship_stop.

Referenced by vesselNoisePower().

Here is the call graph for this function:

◆ removeNoiseSourcefromID()

void UnderwaterPhysicalNoise::removeNoiseSourcefromID ( size_t  id)
virtual

It removes the noise emitter corresponding to the given id.

Parameters
size_tID of the emitter

References noise_src.

Referenced by command().

◆ 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

References debug_noise, ship_noise::getNoisefromCategory(), getSpeedKnots(), granularity, and noise_src.

Referenced by getNoisePower().

Here is the call graph for this function:

Member Data Documentation

◆ debug_noise

int UnderwaterPhysicalNoise::debug_noise
protected

◆ granularity

double UnderwaterPhysicalNoise::granularity
protected

Number of step for the integration.

Referenced by UnderwaterPhysicalNoise(), and vesselNoisePower().

◆ MS_TO_KNOTS

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

Conversion m/s to knots.

Referenced by getSpeedKnots().

◆ noise_src

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

Vector that stores all the vessels.

Referenced by addNoiseSource(), getNoisePower(), removeNoiseSourcefromID(), and vesselNoisePower().

◆ ship_stop

int UnderwaterPhysicalNoise::ship_stop
protected

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

Referenced by getSpeedKnots(), and UnderwaterPhysicalNoise().


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