39#ifndef MCLINKEXTENDED_H
40#define MCLINKEXTENDED_H
95 virtual int command(
int,
const char *
const *)
override;
110 virtual double getBER()
override;
120 void mul_matrix (
double (&A)[3][3],
const double (&B)[3][3]);
128 void pow_matrix (
const double (&A)[3][3],
int n,
double (&R)[3][3]);
MCLinkExtended class stores and updates the probabilities and the channel state for UnderwaterHMMPhys...
MCLinkExtended()
Default constructor of MCLinkExtended class.
virtual double getBER() override
double P[3][3]
Transition matrix for the channel.
virtual ChState updateChState() override
Called upon packet reception, decides and returns the new channel state updates the members state and...
double p_bm
Prob of transition from bad to medium channel.
double p_gm
Prob of transition from good to medium channel.
virtual ~MCLinkExtended()
Default destructor of MCLinkExtended class.
double p_mb
Prob of transition from medium to bad channel.
double p_mg
Prob of transition from medium to good channel.
double ber_medium
BER with medium channel.
void pow_matrix(const double(&A)[3][3], int n, double(&R)[3][3])
Auxiliary function raising a 3x3 matrix to the power of n.
virtual int command(int, const char *const *) override
TCL command interpreter.
void mul_matrix(double(&A)[3][3], const double(&B)[3][3])
Auxiliary function calculating the result of a 3x3 matrix multiplication; result is stored in first a...
MCLink class models the BER of a directed link between two nodes.
ChState ch_state
last channel state
double p_gb
Prob of transition from good to bad channel.
double ber_good
BER with good channel.
double p_bg
Prob of transition from bad to good channel.
double ber_bad
BER with bad channel.
double step_period
period (s) for channel transition between states
Definition of MCLink class.