Poisson arrival for MAC protocol

2 次查看(过去 30 天)
remo
remo 2017-11-17
评论: Tuan Nguyen 2018-10-12
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 个评论
Tuan Nguyen
Tuan Nguyen 2018-10-12
Hi Remo,
I am interested in this ALOHA code, could you send me the full text of this?
Thank you

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by