⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 position_init.m

📁 一个无线网络仿真程序
💻 M
字号:
function position_init()
% Initialize mobility model and start it
% Should be called after initializing topology and parameters

global node n;
global mobility_model pos maxspeed maxpause;
global maxx maxy;

% pos:
% 1, 2: starting x and y
% 3: starting time
% 4: moving speed or pasue time
% 5, 6: ending x and y

if strcmp(mobility_model, 'random_waypoint') == 0
    return;
end

pos(:, 1:2) = node(:, 1:2);
pos(:, 3) = zeros(n, 1);
pos(:, 4:6) = [rand(n, 1)*maxspeed rand(n, 1)*maxx rand(n, 1)*maxy];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -