资源简介
用matlab写的aloha防碰撞算法,涉及到吞吐量,数据包的数量,成功的数量,进行一个直观的分析。
代码片段和文件信息
% Number of nodes
num_nodes = 10;
% Number of time slots to run for
num_time_slots = 500;
num_calculations = 50;
% Probability of transmitting p
p = 0.025;
% Number of times to run simulation
num_intervals = 28;
efficiency = zeros(num_calculations (num_intervals - 1));
mean_wait_time = zeros(num_calculations (num_intervals - 1));
std_dev_wait_time = zeros(num_calculations (num_intervals - 1));
for i = 1:num_intervals
fprintf(‘Running simulation for p = %f.\n‘ p);
[efficiency(1:num_calculationsi) mean_wait_time(1:num_calculationsi) std_dev_wait_time(1:num_calculationsi)] = slottedALOHA(p num_nodes num_time_slots num_calculations);
p = p + 0.025;
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-02 23:00 aloha_simulator-master\
文件 120 2013-12-02 23:00 aloha_simulator-master\README.md
文件 685 2013-12-02 23:00 aloha_simulator-master\ee450project.m
文件 5602 2013-12-02 23:00 aloha_simulator-master\pureALOHA.m
文件 4542 2013-12-02 23:00 aloha_simulator-master\slottedALOHA.m
- 上一篇:ALOHA防碰撞算法
- 下一篇:课程设计基于Matlab的音频处理系统的设计一
评论
共有 条评论