shawn::AlohaTransmissionModel Class Reference

Aloha transmission model where each message is delivered without delay but there is packet loss. More...

#include <aloha_transmission_model.h>

Inheritance diagram for shawn::AlohaTransmissionModel:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

Construction, destruction and lifecycle support
 AlohaTransmissionModel ()
virtual ~AlohaTransmissionModel ()
virtual void init (void) throw ()
virtual void reset (void) 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 (TransmissionModel::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

virtual void deliver_one_message (msg_delivery *msg) throw ()
 Delivers one message.
virtual void drop_collided_frames (TransmissionModel::MessageInfo &mi) throw ()
 Drop frames that collide.
void find_destinations (msg_delivery *pmsg)
 Find the neighbors of the node who send a message.
virtual bool remove_collided_destinations (msg_delivery *msg1, msg_delivery *msg2)
 Set the valid_ tag of destinations where messages collide to be false.

Protected Attributes

int received_
 Number of received messages.
int dropped_
 Number of dropped messages.
int packet_failure_
 Number of packets failed to reach the destination.
std::vector< msg_delivery * > aired_messages_
 The messages that have been sent by the nodes and are waiting for delivery.

Classes

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


Detailed Description

Aloha transmission model where each message is delivered without delay but there is packet loss.

Constructor & Destructor Documentation

shawn::AlohaTransmissionModel::AlohaTransmissionModel (  ) 

virtual shawn::AlohaTransmissionModel::~AlohaTransmissionModel (  )  [virtual]


Member Function Documentation

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

Reimplemented from shawn::TransmissionModel.

Reimplemented in shawn::SlottedAlohaTransmissionModel.

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

Reimplemented from shawn::TransmissionModel.

Reimplemented in shawn::SlottedAlohaTransmissionModel.

virtual bool shawn::AlohaTransmissionModel::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::AlohaTransmissionModel::send_message ( TransmissionModel::MessageInfo mi  )  throw () [virtual]

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

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

See also:
aired_messages_

Implements shawn::TransmissionModel.

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

Delivers all messages which are in the vector.

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

See also:
aired_messages_

Implements shawn::TransmissionModel.

virtual void shawn::AlohaTransmissionModel::deliver_one_message ( msg_delivery msg  )  throw () [protected, virtual]

Delivers one message.

Deliver one message to the destinations of the msg with tag valid_ having a true value

Parameters:
msg message to be delivered

virtual void shawn::AlohaTransmissionModel::drop_collided_frames ( TransmissionModel::MessageInfo mi  )  throw () [protected, virtual]

Drop frames that collide.

Set the valid_ tag of the destinations of both mi and other messages in the aired_messages_ to be false if collision occurs

Parameters:
mi the new-coming message

Reimplemented in shawn::SlottedAlohaTransmissionModel.

void shawn::AlohaTransmissionModel::find_destinations ( msg_delivery pmsg  )  [protected]

Find the neighbors of the node who send a message.

Find all the destinations of a new-coming messages that are the neighbours of its source node

Parameters:
pmsg the message whose source node's neighbours to be determined

virtual bool shawn::AlohaTransmissionModel::remove_collided_destinations ( msg_delivery msg1,
msg_delivery msg2 
) [protected, virtual]

Set the valid_ tag of destinations where messages collide to be false.

Returns:
true if any valid_ tag is set false

Reimplemented in shawn::SlottedAlohaTransmissionModel.


Member Data Documentation

Number of received messages.

Number of dropped messages.

Number of packets failed to reach the destination.

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:26 2012 for Shawn by  doxygen 1.5.6