Poisson arrival for MAC protocol

조회 수: 3 (최근 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에서 Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by