資源簡介
鏈路調度matlab程序(適合初學者)鏈路調度matlab程序(適合初學者)
代碼片段和文件信息
%to?update?the?imlicit?cost?of?each?link
%s?is?the?stepsize?for?updating?the?implicit?cost
function?q=costupdate(Tcountn)
%n?is?user_numand?T?is?the?timeslotcount?is?the?cycle?times
global?routing
global?cost
global?rate
global?schedule_set
global?user
global?link
global?stepsize
global?capacity
for?i=1:1:length(link)
????m=0;
????for?j=1:1:n
????????user(j)=poisson(jcountT);
???????m=m+routing(ji)*user(j)*rate(j)/capacity(i)*T;
????end
???????if?schedule_set(i)==1
????????m=m-T;
???????end
????????q(i)=cost(i)+stepsize*m;
????????if?q(i)<0
????????????q(i)=0;
????????end
end
???
評論
共有 條評論