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

#include <mclink.h>

Inheritance diagram for MCLink:
Collaboration diagram for MCLink:

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.

Definition at line 52 of file mclink.h.

Member Enumeration Documentation

◆ ChState

Channel state.

Enumerator
NOT_DEFINED 
GOOD 
MEDIUM 
BAD 

Definition at line 58 of file mclink.h.

Constructor & Destructor Documentation

◆ MCLink() [1/2]

MCLink::MCLink ( )

Default constructor of MCLink class.

Definition at line 45 of file mclink.cpp.

◆ 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

Definition at line 57 of file mclink.cpp.

◆ ~MCLink()

virtual MCLink::~MCLink ( )
inlinevirtual

Default destructor of MCLink class.

Definition at line 83 of file mclink.h.

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.

Definition at line 110 of file mclink.cpp.

◆ getBER()

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

Reimplemented in MCLinkExtended.

Definition at line 99 of file mclink.cpp.

◆ getChState()

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

Definition at line 111 of file mclink.h.

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

Definition at line 73 of file mclink.cpp.

Member Data Documentation

◆ ber_bad

double MCLink::ber_bad
protected

BER with bad channel.

Definition at line 126 of file mclink.h.

◆ ber_good

double MCLink::ber_good
protected

BER with good channel.

Definition at line 125 of file mclink.h.

◆ ch_state

ChState MCLink::ch_state
protected

last channel state

Definition at line 131 of file mclink.h.

◆ last_update

double MCLink::last_update
protected

last time channel state has been updated

Definition at line 129 of file mclink.h.

◆ p_bg

double MCLink::p_bg
protected

Prob of transition from bad to good channel.

Definition at line 128 of file mclink.h.

◆ p_gb

double MCLink::p_gb
protected

Prob of transition from good to bad channel.

Definition at line 127 of file mclink.h.

◆ step_period

double MCLink::step_period
protected

period (s) for channel transition between states

Definition at line 130 of file mclink.h.


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