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

#include <uwgainfromdb.h>

Inheritance diagram for UnderwaterGainFromDb:
Collaboration diagram for UnderwaterGainFromDb:

Public Member Functions

 UnderwaterGainFromDb ()
 
virtual ~UnderwaterGainFromDb ()
 
virtual int command (int, const char *const *)
 
- Public Member Functions inherited from UnderwaterPhysical
 UnderwaterPhysical ()
 
virtual ~UnderwaterPhysical ()
 
virtual void recv (Packet *)
 
int recvSyncClMsg (ClMessage *m)
 

Protected Member Functions

virtual double getPER (double snr, int nbits, Packet *p)
 
virtual void setTimeRoughness (const int &)
 
virtual void setDepthRoughness (const int &)
 
virtual void setDistanceRoughness (const int &)
 
virtual void setTotalTime (const int &)
 
virtual void setFrequencyCorrectionFactor (const double &)
 
const intgetTimeRoughness () const
 
const intgetDepthRoughness () const
 
const intgetDistanceRoughness () const
 
const intgetTotalTime () const
 
const doublegetFrequencyCorrectionFactor () const
 
virtual double getGain (const double &, const double &, const double &, const double &)
 
virtual double retriveGainFromFile (const string &, const int &, const int &) const
 
virtual string createNameFile (const int &, const int &)
 
const bool isZero (const double &value) 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)
 
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

charpath_
 
char token_separator_
 
ostringstream osstream_
 
- 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_
 

Private Attributes

int time_roughness_
 
int depth_roughness_
 
int distance_roughness_
 
int total_time_
 
double frequency_correction_factor_
 

Detailed Description

Definition at line 51 of file uwgainfromdb.h.

Constructor & Destructor Documentation

◆ UnderwaterGainFromDb()

UnderwaterGainFromDb::UnderwaterGainFromDb ( )

Constructor of UnderwaterMPhyBpskDb class.

Definition at line 58 of file uwgainfromdb.cpp.

◆ ~UnderwaterGainFromDb()

virtual UnderwaterGainFromDb::~UnderwaterGainFromDb ( )
inlinevirtual

Destructor of UnderwaterMPhyBpskDb class.

Definition at line 63 of file uwgainfromdb.h.

Member Function Documentation

◆ command()

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

Reimplemented in UnderwaterPhysicalfromdb.

Definition at line 76 of file uwgainfromdb.cpp.

◆ createNameFile()

string UnderwaterGainFromDb::createNameFile ( const int _time,
const int _source_depth 
)
protectedvirtual

Creates the name of the file to load.

Parameters
time
depth
Returns
The name of the file to load.

Definition at line 245 of file uwgainfromdb.cpp.

◆ getDepthRoughness()

const int & UnderwaterGainFromDb::getDepthRoughness ( ) const
inlineprotected

Returns the depth_roughness_ parameter.

Returns
depth_roughness_

Definition at line 145 of file uwgainfromdb.h.

◆ getDistanceRoughness()

const int & UnderwaterGainFromDb::getDistanceRoughness ( ) const
inlineprotected

Returns the distance_roughness_ parameter.

Returns
distance_roughness_

Definition at line 156 of file uwgainfromdb.h.

◆ getFrequencyCorrectionFactor()

const double & UnderwaterGainFromDb::getFrequencyCorrectionFactor ( ) const
inlineprotected

Returns the frequency_correction_factor_ parameter.

Returns
frequency_correction_factor_

Definition at line 178 of file uwgainfromdb.h.

◆ getGain()

double UnderwaterGainFromDb::getGain ( const double _time,
const double _source_depth,
const double _destination_depth,
const double _destination_distance 
)
protectedvirtual
Parameters

param

Parameters

param

Returns

Reimplemented in UnderwaterPhysicalfromdb.

Definition at line 165 of file uwgainfromdb.cpp.

◆ getPER()

double UnderwaterGainFromDb::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 from UnderwaterPhysical.

Reimplemented in UnderwaterPhysicalfromdb.

Definition at line 94 of file uwgainfromdb.cpp.

◆ getTimeRoughness()

const int & UnderwaterGainFromDb::getTimeRoughness ( ) const
inlineprotected

Returns the time_roughness_ parameter.

Returns
time_roughness_

Definition at line 134 of file uwgainfromdb.h.

◆ getTotalTime()

const int & UnderwaterGainFromDb::getTotalTime ( ) const
inlineprotected

Returns the total_time_ parameter.

Returns
total_time_

Definition at line 167 of file uwgainfromdb.h.

◆ isZero()

const bool UnderwaterGainFromDb::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 226 of file uwgainfromdb.h.

◆ retriveGainFromFile()

double UnderwaterGainFromDb::retriveGainFromFile ( const string _file_name,
const int _row_index,
const int _column_index 
) const
protectedvirtual
Parameters

param

Parameters

return

Definition at line 193 of file uwgainfromdb.cpp.

◆ setDepthRoughness()

void UnderwaterGainFromDb::setDepthRoughness ( const int _depth)
protectedvirtual

Sets the depth_roughness_ parameter.

Parameters
Roughnessof the depth samples.

Definition at line 132 of file uwgainfromdb.cpp.

◆ setDistanceRoughness()

void UnderwaterGainFromDb::setDistanceRoughness ( const int _distance)
protectedvirtual

Sets the distance_roughness_ parameter.

Parameters
Roughnessof the distance samples.

Definition at line 140 of file uwgainfromdb.cpp.

◆ setFrequencyCorrectionFactor()

void UnderwaterGainFromDb::setFrequencyCorrectionFactor ( const double _frequency_correction_factor)
protectedvirtual

Sets the frequency_correction_factor_ parameter.

Parameters
Frequencycorrection factor.

Definition at line 156 of file uwgainfromdb.cpp.

◆ setTimeRoughness()

void UnderwaterGainFromDb::setTimeRoughness ( const int _time)
protectedvirtual

Sets the time_roughness_ parameter.

Parameters
Roughnessof the temporal samples.

Definition at line 124 of file uwgainfromdb.cpp.

◆ setTotalTime()

void UnderwaterGainFromDb::setTotalTime ( const int _total_time)
protectedvirtual

Sets the total_time_ parameter.

Parameters
Maximumvalue of the temporal samples.

Definition at line 148 of file uwgainfromdb.cpp.

Member Data Documentation

◆ depth_roughness_

int UnderwaterGainFromDb::depth_roughness_
private

Roughness of the depth samples.

Definition at line 239 of file uwgainfromdb.h.

◆ distance_roughness_

int UnderwaterGainFromDb::distance_roughness_
private

Roughness of the distance samples.

Definition at line 240 of file uwgainfromdb.h.

◆ frequency_correction_factor_

double UnderwaterGainFromDb::frequency_correction_factor_
private

used to shift from a frequency value to another one.

Definition at line 243 of file uwgainfromdb.h.

◆ osstream_

ostringstream UnderwaterGainFromDb::osstream_
protected

Used to create strings.

Definition at line 234 of file uwgainfromdb.h.

◆ path_

char* UnderwaterGainFromDb::path_
protected

Name of the trace file writter for the current node.

Definition at line 231 of file uwgainfromdb.h.

◆ time_roughness_

int UnderwaterGainFromDb::time_roughness_
private

Roughness of the temporal samples.

Definition at line 238 of file uwgainfromdb.h.

◆ token_separator_

char UnderwaterGainFromDb::token_separator_
protected

Token used to parse the elements in a line of the database.

Definition at line 232 of file uwgainfromdb.h.

◆ total_time_

int UnderwaterGainFromDb::total_time_
private

Maximum value of the temporal samples, after this limit the smilulation time will be reset to zero.

Definition at line 241 of file uwgainfromdb.h.


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