|
DESERT 4.0.0
|
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>


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 |
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.
| enum MCLink::ChState |
| MCLink::MCLink | ( | ) |
Default constructor of MCLink class.
| 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.
| ber_good | BER with channel in GOOD state |
| ber_bad | BER with channel in BAD state |
| p_gb | Probability of transition from GOOD to BAD in one step |
| p_bg | Probability of transition from BAD to GOOD in one step |
| step_period | period (s) for channel transition between states |
| ch_state | Optional (default = GOOD) initial channel state |
|
inlinevirtual |
Default destructor of MCLink class.
|
virtual |
TCL command interpreter. It implements the following OTcl methods:
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
Reimplemented in MCLinkExtended.
References getBER(), and getChState().

|
virtual |
Reimplemented in MCLinkExtended.
References ber_bad, ber_good, ch_state, GOOD, and updateChState().
Referenced by command().

|
inline |
References updateChState().
Referenced by command(), and MCLinkExtended::command().

|
virtual |
Called upon packet reception, decides and returns the new channel state updates the members state and last_step.
| curr_step | current step number at packet arrival |
Reimplemented in MCLinkExtended.
References BAD, ch_state, GOOD, last_update, p_bg, p_gb, and step_period.
Referenced by getBER(), and getChState().
|
protected |
BER with bad channel
Referenced by getBER(), and MCLinkExtended::getBER().
|
protected |
BER with good channel
Referenced by getBER(), MCLinkExtended::getBER(), and MCLink().
|
protected |
last channel state
Referenced by getBER(), MCLinkExtended::getBER(), updateChState(), and MCLinkExtended::updateChState().
|
protected |
last time channel state has been updated
Referenced by updateChState(), and MCLinkExtended::updateChState().
|
protected |
Prob of transition from bad to good channel
Referenced by MCLink(), and updateChState().
|
protected |
Prob of transition from good to bad channel
Referenced by MCLinkExtended::MCLinkExtended(), MCLinkExtended::MCLinkExtended(), and updateChState().
|
protected |
period (s) for channel transition between states
Referenced by updateChState(), and MCLinkExtended::updateChState().