39#ifndef UWHMMPHYSICAL_H
40#define UWHMMPHYSICAL_H
59 virtual Stats*
clone()
const;
72 virtual void updateStats(
int mod_id,
int stck_id,
double rx_pwr,
73 double noise_pwr,
double interf_pwr,
double sinr,
double ber,
double per,
bool error,
108 virtual int command(
int,
const char *
const *);
169 virtual void endRx(Packet *p)
override;
179 virtual double ber2per(
double ber, Packet * p);
MCLink class models the BER of a directed link between two nodes.
UnderwaterHMMPhysical models an hidden Markov Model phy channel.
virtual double ber2per(double ber, Packet *p)
Returns the packet error rate by using the BER from HMM and the size of a packet.
virtual void endRx(Packet *p) override
Handles the end of a packet reception.
int getPktsTotMedium() const
void incrTotPkts(MCLink::ChState ch_state)
increase the counter of packets sent taking into account the channel state
void setMCLink(int mac, MCLink *link)
Adds the Markov Chain transition matrix for each source MAC.
virtual ~UnderwaterHMMPhysical()
Destructor of UnderwaterHMMPhysical class.
int getPktsTotGood() const
int getPktsTotBad() const
virtual int command(int, const char *const *)
TCL command interpreter.
int pkts_tot_good
Total number of packets arrived with good channel.
int pkts_tot_bad
Total number of packets arrived with bad channel.
int pkts_tot_medium
Total number of packets arrived with medium channel.
UnderwaterHMMPhysical()
Constructor of UnderwaterHMMPhysical class.
std::map< int, MCLink * > link_map
maps source mac to associated MCLink
virtual ~UwHMMPhysicalStats()=default
Destructor of UwPhysicalStats class.
virtual Stats * clone() const
Virtual method used by the Module class in order to copy its stats an a generic fashion,...
MCLink::ChState channel_state
HMM channel state.
virtual void updateStats(int mod_id, int stck_id, double rx_pwr, double noise_pwr, double interf_pwr, double sinr, double ber, double per, bool error, MCLink::ChState channel_state=MCLink::ChState::NOT_DEFINED)
Method to update stats with the param of last received packet.
Definition of MCLink class.
Definition of UwPhysical class.