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

#include <mclinkextended.h>

Inheritance diagram for MCLinkExtended:
Collaboration diagram for MCLinkExtended:

Public Member Functions

 MCLinkExtended ()
 
 MCLinkExtended (double ber_good, double ber_medium, double ber_bad, double p_gb, double p_gm, double p_mg, double p_mb, double p_bg, double p_bm, double step_period, ChState ch_state=MCLink::GOOD)
 
virtual ~MCLinkExtended ()
 
virtual int command (int, const char *const *) override
 
virtual ChState updateChState () override
 
virtual double getBER () override
 

Protected Member Functions

void mul_matrix (double(&A)[3][3], const double(&B)[3][3])
 
void pow_matrix (const double(&A)[3][3], int n, double(&R)[3][3])
 

Protected Attributes

double ber_medium
 
double p_gm
 
double p_mg
 
double p_mb
 
double p_bm
 
double P [3][3]
 

Additional Inherited Members

Detailed Description

MCLinkExtended class stores and updates the probabilities and the channel state for UnderwaterHMMPhysicalExt.

Definition at line 48 of file mclinkextended.h.

Constructor & Destructor Documentation

◆ MCLinkExtended() [1/2]

MCLinkExtended::MCLinkExtended ( )

Default constructor of MCLinkExtended class.

Definition at line 92 of file mclinkextended.cpp.

◆ MCLinkExtended() [2/2]

MCLinkExtended::MCLinkExtended ( double  ber_good,
double  ber_medium,
double  ber_bad,
double  p_gb,
double  p_gm,
double  p_mg,
double  p_mb,
double  p_bg,
double  p_bm,
double  step_period,
ChState  ch_state = MCLink::GOOD 
)

Constructor of MCLinkExtended class.

Parameters
ber_goodBER with channel in GOOD state
ber_mediumBER with channel in MEDIUM state
ber_badBER with channel in BAD state
p_gbProbability of transition from GOOD to BAD in one step
p_gmProbability of transition from GOOD to MEDIUM in one step
p_mgProbability of transition from MEDIUM to GOOD in one step
p_mbProbability of transition from MEDIUM to BAD in one step
p_bgProbability of transition from BAD to GOOD in one step
p_bmProbability of transition from BAD to MEDIUM in one step
step_periodperiod (s) for state transitions
ch_stateOptional initial channel state (default = GOOD) of type MCLink::{GOOD | MEDIUM | BAD}

Definition at line 104 of file mclinkextended.cpp.

◆ ~MCLinkExtended()

virtual MCLinkExtended::~MCLinkExtended ( )
inlinevirtual

Default destructor of MCLinkExtended class.

Definition at line 81 of file mclinkextended.h.

Member Function Documentation

◆ command()

int MCLinkExtended::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 MCLink.

Definition at line 224 of file mclinkextended.cpp.

◆ getBER()

double MCLinkExtended::getBER ( )
overridevirtual
Returns
BER with current channel state

Reimplemented from MCLink.

Definition at line 211 of file mclinkextended.cpp.

◆ mul_matrix()

void MCLinkExtended::mul_matrix ( double(&)  A[3][3],
const double(&)  B[3][3] 
)
protected

Auxiliary function calculating the result of a 3x3 matrix multiplication; result is stored in first argument.

Parameters
Athe first factor of matrix multiplication
Bthe second factor of matrix multiplication

Definition at line 125 of file mclinkextended.cpp.

◆ pow_matrix()

void MCLinkExtended::pow_matrix ( const double(&)  A[3][3],
int  n,
double(&)  R[3][3] 
)
protected

Auxiliary function raising a 3x3 matrix to the power of n.

Parameters
Athe matrix to be elevated to the n-th power
nthe exponent of the operation
Rthe matrix that stores the result of the operation

Definition at line 145 of file mclinkextended.cpp.

◆ updateChState()

MCLink::ChState MCLinkExtended::updateChState ( )
overridevirtual

Called upon packet reception, decides and returns the new channel state updates the members state and last_step.

Parameters
curr_stepcurrent step number at packet arrival
Returns
the channel state at curr_step as MCLink::{GOOD | MEDIUM | BAD}

Reimplemented from MCLink.

Definition at line 168 of file mclinkextended.cpp.

Member Data Documentation

◆ ber_medium

double MCLinkExtended::ber_medium
protected

BER with medium channel.

Definition at line 131 of file mclinkextended.h.

◆ P

double MCLinkExtended::P[3][3]
protected

Transition matrix for the channel.

Definition at line 136 of file mclinkextended.h.

◆ p_bm

double MCLinkExtended::p_bm
protected

Prob of transition from bad to medium channel.

Definition at line 135 of file mclinkextended.h.

◆ p_gm

double MCLinkExtended::p_gm
protected

Prob of transition from good to medium channel.

Definition at line 132 of file mclinkextended.h.

◆ p_mb

double MCLinkExtended::p_mb
protected

Prob of transition from medium to bad channel.

Definition at line 134 of file mclinkextended.h.

◆ p_mg

double MCLinkExtended::p_mg
protected

Prob of transition from medium to good channel.

Definition at line 133 of file mclinkextended.h.


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