Borrar filtros
Borrar filtros

Poisson arrival for MAC protocol

2 visualizaciones (últimos 30 días)
remo
remo el 17 de Nov. de 2017
Comentada: Tuan Nguyen el 12 de Oct. de 2018
Hi all,
Good day.
I am trying to understand this piece of code which i modified on top of a code that i acquired from github.io. I am trying to simulate Slotted Aloha protocol.
Node = 10; % number of nodes TOTAL_SLOT_NUMBER = 10000; % simulation time lambda = 1; % average one arrival per time slot q = poissrnd(lambda,Node,TOTAL_SLOT_NUMBER); % generate poisson dist for N and simulation time
for id=1:1:N % N is number of sensor nodes
%%Poisson Arrival for every time slot
is_arrival = rand;
while is_arrival >=lambda*(exp(-lambda*q(index,t))) % is this correct? i modified this line.index denotes the current sensor node id. index = 1 is sensor node 1. t= current time slot
% record the number of data frames in the queue
buffered_number(id) = buffered_number(id) + 1; % array to store buffer data
generated = generated + 1; % generates new data
is_arrival = rand*is_arrival;
end
end
It is imperative that i understand this piece of code so that i can be sure that poisson arrival of packets are being simulated correctly.
Your comments are welcomed. Let me know if there is a simpler way of doing it.
Thank you.
Regards, Muru
  1 comentario
Tuan Nguyen
Tuan Nguyen el 12 de Oct. de 2018
Hi Remo,
I am interested in this ALOHA code, could you send me the full text of this?
Thank you

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by