10. مسئله های فرمول
10
توسط شده تجربه تداخلAPبا هاaکانال در که شود می داده نشانiکند می کار( :هر برای انتقال قدرتAPبرابر
از ای مجموعه1است ها).
𝐼 𝑎 𝑖 = Σ 𝑏∈𝑁𝐵(𝑎)Ω 𝑎,𝑏 𝐺 𝑎,𝑏 𝑃𝑡 + 𝜂 𝑎
Where NB(A) defines a local environment around the Ap a
But not including AP a itself
𝜂 𝑎 is the background noise experienced by AP a.
13. متلب کد
13
function [bestsol,fmin] = Final(alpha)
clc
clear
close all
if nargin<1
alpha = 1;% Cooling factor
end
% Initializing parameters and settings
T_init= 1; % Initial temperature
T = T_init; % Temp variable
T_min = 1e-10; % Minimum temperature
max_rej = 2500; % Max # of rejections
max_run = 500; % Max # of runs
max_accept = 250; % Max # of acceptances
14. متلب کد
14
s= randi(3,1,5); % Channels
i= 0;j=0; accept = 0;
G = rand (5,5);
G(logical(eye(size(G)))) = 0;
G = G./100;
E_init = fun(s,G);
E_old = E_init; count = 0;
best = s; fminimum = []; counter = [];
while ((T>T_min) || (j<=max_rej))
i = i+1;
if(i>=max_run) || (accept >=max_accept)
%reset the counters
i=1; accept =1;
T = cooling(alpha,T);
end
15. متلب کد
15
ns=randi(3,1,5);
E_new = fun(ns,G);
% Decide to accept new solution
%Accept if improved
DeltaE = E_new - E_old;
if(E_new < E_old)
best = ns; E_old = E_new;
accept = accept + 1; j=0;
end
p= min(1,exp(-DeltaE/T)); % Probability of accepting new solution
%Accept with a small probability p if not improved
if ((E_new >= E_old) && (p > 0))
best = ns; E_old = E_new;
accept = accept + 1;
16. متلب کد
16
else
j=j+1;
end
%Update the estimated optimal solution
fmin = E_old;
count = count + 1;
fminimum(count) = fmin; %#ok<AGROW>
counter(count) = count; %#ok<AGROW>
%display(fmin)
end
plot (counter,fminimum)
xlabel ('Iteration');
ylabel ('Interference');
title ('Variation in interference')
display(count)
17. متلب کد
17
display(E_init)
bestsol = best;
bestfunctionvalue = fmin;
display(bestfunctionvalue)
end
function I=fun(s,G)
E_norm = 25; % Normalization
omega = zeros([5 5]);
if (s(1,1) == s(1,2))
omega(1,2) = 1;
omega(2,1) = 1;
end
if(s(1,3)==s(1,4))
omega(3,4)=1;
18. متلب کد
18
omega(4,3)=1;
end
rho = zeros([3 5]);
for y=1:5
switch s(1,y)
case 1
rho(1,y)=1;
case 2
rho(2,y)=1;
case 3
rho(3,y)=1;
end
end
noise = rand(1,5);
32. منابع
32
• Source Code : https://github.com/krishnasubramani/Simulated-Annealing
• Paper : https://ieeexplore.ieee.org/document/4525967
• Paper Resources :
• [1] A. Aklla, G. Judd, P. Steenkiste and S. Seshan, “Self management in chaotic wireless developments,” Proc. the 11th Annual International Conference on
Mobile Computing and Networking, 2005.
• [2] V. I. Norkin, G. Ch. Pflug and A. Ruszczynski, “A branch and bound method of stochastic global optimization,” International Institute for Applied Systems
Analysis, 1996.
• [3] Kirkpatrick, S., Gelatt, C.D. and Vecchi, P. M., “Optimization by Simulated Annealing,” Science, vol. 220, pp. 610-680, 1983.
• [4] V. Cerny, “A thermodynamical approach to the traveling salesman problem: an efficient simulation algorithm,” Journal of Optimization Theory and
Applications, vol. 45, pp.41-51, 1985.
• [5] COST231, Final Report, 1999.
• [6] R. Vaughan, J. Bach Andersen, Channels Propagation and Antennas for Mobile Communications, IEE, 2003.