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

📄 times_dynamically.m

📁 此程序为发表过的一篇IEEE PIMRC 的paper的程序代码。是关于异构无线网络环境下的垂直切换接口激活时间的几个方案的仿真性能比较。
💻 M
字号:
function [q,delay_nd] = times_dynamically(speed,x,y,ap,rx_threshold)

direction = pi/4;
counter = 0;
t_min = 5;
t_max = 15;
d_mt_ap = sqrt((x-ap.x)^2+(y-ap.y)^2);
for times = 1:300
    d_ap = sqrt((x-ap.x)^2+(y-ap.y)^2);
    rss = ap.pt*(ap.antenna^2)/(d_ap^4);
    if (rss >= rx_threshold)
        counter = counter + 1;
    else
        counter = 0;
    end
    if (counter == 5)
        q = times;
        %journal delay_nd = (wlan_boundary - d_wlan)/speed
        %delay_nd = (ap.r- d_ap)/speed;  % the delay between the actual
        %discovering time and the supposed discovering time
        distance = sqrt(x^2+y^2);
        delay_nd = distance/speed;  % time spent from the mt's starting moving to mt's discovering WLAN.
        break
    end
    t_int = t_min + (t_max - t_min)*(1 - rss/rx_threshold);
    if (t_int > t_max)
        t_int = t_max;
    end
    if (t_int < t_min)
        t_int = t_min;
    end
    d = speed*t_int;
    x = x+d*sin(direction);
    y = y+d*cos(direction);
end

    
    

⌨️ 快捷键说明

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