#include <aloha_transmission_model.h>


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... | |
| shawn::AlohaTransmissionModel::AlohaTransmissionModel | ( | ) |
| virtual shawn::AlohaTransmissionModel::~AlohaTransmissionModel | ( | ) | [virtual] |
| virtual void shawn::AlohaTransmissionModel::init | ( | void | ) | throw () [virtual] |
| virtual void shawn::AlohaTransmissionModel::reset | ( | void | ) | throw () [virtual] |
| 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_
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_
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
| 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
| 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
| 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.
Reimplemented in shawn::SlottedAlohaTransmissionModel.
int shawn::AlohaTransmissionModel::received_ [protected] |
Number of received messages.
int shawn::AlohaTransmissionModel::dropped_ [protected] |
Number of dropped messages.
int shawn::AlohaTransmissionModel::packet_failure_ [protected] |
Number of packets failed to reach the destination.
std::vector<msg_delivery*> shawn::AlohaTransmissionModel::aired_messages_ [protected] |
The messages that have been sent by the nodes and are waiting for delivery.
1.5.6