DESERT 4.0.0
MCLink Class Reference

MCLink class models the BER of a directed link between two nodes. The base class allows for GOOD/BAD channel states only, while the extended McLinkExtended class allows for MEDIUM state as well. Every state is associated with a different channel BER and every step_period the state is updated according to the transition probabilities. More...

#include <mclink.h>

Inheritance diagram for MCLink:
Inheritance graph
Collaboration diagram for MCLink:
Collaboration graph

Public Types

enum  ChState { NOT_DEFINED = 0 , GOOD = 1 , MEDIUM = 2 , BAD = 3 }
 

Public Member Functions

 MCLink ()
 
 MCLink (double ber_good, double ber_bad, double p_gb, double p_bg, double step_period, ChState ch_state=MCLink::GOOD)
 
virtual ~MCLink ()
 
virtual int command (int, const char *const *)
 
virtual ChState updateChState ()
 
ChState getChState ()
 
virtual double getBER ()
 

Protected Attributes

double ber_good
 
double ber_bad
 
double p_gb
 
double p_bg
 
double last_update
 
double step_period
 
ChState ch_state
 

Detailed Description

MCLink class models the BER of a directed link between two nodes. The base class allows for GOOD/BAD channel states only, while the extended McLinkExtended class allows for MEDIUM state as well. Every state is associated with a different channel BER and every step_period the state is updated according to the transition probabilities.

Member Enumeration Documentation

◆ ChState

Channel state

Enumerator
NOT_DEFINED 
GOOD 
MEDIUM 
BAD 

Constructor & Destructor Documentation

◆ MCLink() [1/2]

MCLink::MCLink ( )

Default constructor of MCLink class.

◆ MCLink() [2/2]

MCLink::MCLink ( double  ber_good,
double  ber_bad,
double  p_gb,
double  p_bg,
double  step_period,
ChState  ch_state = MCLink::GOOD 
)

Constructor of MCLink class.

Parameters
ber_goodBER with channel in GOOD state
ber_badBER with channel in BAD state
p_gbProbability of transition from GOOD to BAD in one step
p_bgProbability of transition from BAD to GOOD in one step
step_periodperiod (s) for channel transition between states
ch_stateOptional (default = GOOD) initial channel state
Returns
a new MCLink object

References ber_good, and p_bg.

◆ ~MCLink()

virtual MCLink::~MCLink ( )
inlinevirtual

Default destructor of MCLink class.

Member Function Documentation

◆ command()

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

References getBER(), and getChState().

Here is the call graph for this function:

◆ getBER()

double MCLink::getBER ( )
virtual
Returns
BER with current (updated) channel state

Reimplemented in MCLinkExtended.

References ber_bad, ber_good, ch_state, GOOD, and updateChState().

Referenced by command().

Here is the call graph for this function:

◆ getChState()

ChState MCLink::getChState ( )
inline
Returns
current (updated) channel state

References updateChState().

Referenced by command(), and MCLinkExtended::command().

Here is the call graph for this function:

◆ updateChState()

MCLink::ChState MCLink::updateChState ( )
virtual

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 | BAD}

Reimplemented in MCLinkExtended.

References BAD, ch_state, GOOD, last_update, p_bg, p_gb, and step_period.

Referenced by getBER(), and getChState().

Member Data Documentation

◆ ber_bad

double MCLink::ber_bad
protected

BER with bad channel

Referenced by getBER(), and MCLinkExtended::getBER().

◆ ber_good

double MCLink::ber_good
protected

BER with good channel

Referenced by getBER(), MCLinkExtended::getBER(), and MCLink().

◆ ch_state

ChState MCLink::ch_state
protected

◆ last_update

double MCLink::last_update
protected

last time channel state has been updated

Referenced by updateChState(), and MCLinkExtended::updateChState().

◆ p_bg

double MCLink::p_bg
protected

Prob of transition from bad to good channel

Referenced by MCLink(), and updateChState().

◆ p_gb

double MCLink::p_gb
protected

Prob of transition from good to bad channel

Referenced by MCLinkExtended::MCLinkExtended(), MCLinkExtended::MCLinkExtended(), and updateChState().

◆ step_period

double MCLink::step_period
protected

period (s) for channel transition between states

Referenced by updateChState(), and MCLinkExtended::updateChState().


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