shawn::MacaTransmissionModel Class Reference

A MACA transmission model delays the messages if two packets may interfere at some node. More...

#include <maca_transmission_model.h>

Inheritance diagram for shawn::MacaTransmissionModel:

Inheritance graph
[legend]
Collaboration diagram for shawn::MacaTransmissionModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

construction, destruction and support for lifecycle
 MacaTransmissionModel ()
 ~MacaTransmissionModel ()
virtual void init () throw ()
virtual void reset () throw ()
Transmission model implementation
virtual bool supports_mobility (void) const throw (std::logic_error)
 Mobility is depending on mobility support from the edge model.
virtual void send_message (MessageInfo &mi) throw ()
 Stores each message in a vector for delivery at the next simulation round start.
virtual void deliver_messages () throw ()
 Delivers all messages which are in the vector.

Protected Member Functions

void insert_message (TransmissionModel::MessageInfo &mi) throw ()
 Insert a new-coming message into aired_messages_.
bool need_delay (maca_msg *new_msg, maca_msg *msg) throw ()
 See if new_msg will interfere with msg.
void deliver_one_message (maca_msg *msg) throw ()
 Delivers one message.

Protected Attributes

int received_
 The number of messages received.
double average_delay_
 The average delay of the packets.
double jitter_
 The average variation of delay.
int deliver_num_
 Number of messages delivered so far.
double last_delay_
 The delay of last message.
std::vector< maca_msg * > aired_messages_
 The messages that have been sent by the nodes and are waiting for delivery.

Classes

struct  maca_msg
 Message structure used in MACA transmission model. More...
struct  same_round
 Unary function to determine if two messages are of the same simulation round. More...


Detailed Description

A MACA transmission model delays the messages if two packets may interfere at some node.

The model assumes that a node sends a RTS packet before it sends the message, and a destination node replies a CTS packet. Any other node who hears the RTS or CTS packet cannot sends a message in the same simulation round, so there is no packet loss.


Constructor & Destructor Documentation

shawn::MacaTransmissionModel::MacaTransmissionModel (  ) 

shawn::MacaTransmissionModel::~MacaTransmissionModel (  ) 


Member Function Documentation

virtual void shawn::MacaTransmissionModel::init (  )  throw () [virtual]

Reimplemented from shawn::TransmissionModel.

virtual void shawn::MacaTransmissionModel::reset (  )  throw () [virtual]

Reimplemented from shawn::TransmissionModel.

virtual bool shawn::MacaTransmissionModel::supports_mobility ( void   )  const throw (std::logic_error) [virtual]

Mobility is depending on mobility support from the edge model.

The edge model is used to determine the 1-hop neighbours which will receive the message

Implements shawn::TransmissionModel.

virtual void shawn::MacaTransmissionModel::send_message ( MessageInfo mi  )  throw () [virtual]

Stores each message in a vector for delivery at the next simulation round start.

A new structure of maca_msg will be build and inserted into aired_messages_

Implements shawn::TransmissionModel.

virtual void shawn::MacaTransmissionModel::deliver_messages (  )  throw () [virtual]

Delivers all messages which are in the vector.

Call deliver_one_message( maca_msg* msg ) for each element in aired_messages_

Implements shawn::TransmissionModel.

void shawn::MacaTransmissionModel::insert_message ( TransmissionModel::MessageInfo mi  )  throw () [protected]

Insert a new-coming message into aired_messages_.

See also:
aired_messages_

bool shawn::MacaTransmissionModel::need_delay ( maca_msg new_msg,
maca_msg msg 
) throw () [protected]

See if new_msg will interfere with msg.

Returns:
true if new_msg need delay

void shawn::MacaTransmissionModel::deliver_one_message ( maca_msg msg  )  throw () [protected]

Delivers one message.

Deliver a message to all the neighbours of its source node


Member Data Documentation

The number of messages received.

The average delay of the packets.

The average variation of delay.

Number of messages delivered so far.

The delay of last message.

The messages that have been sent by the nodes and are waiting for delivery.


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

Generated on Tue Feb 7 00:01:30 2012 for Shawn by  doxygen 1.5.6