?? location_improveliu.m
字號:
function [x,l,tabu]=location_improve(x0,l0,tabu)
global customer;
global depot;
global demand;
global bestx;
global bestl;
global bestSC;
%內循環次數
inner=10;
Ts=10;
T=70;
r=0.9;
outer=1;
count=1;
while count<=inner
% SCx0
[x1,move,l1,tabu]=tabu_locationmove(x0,l0,tabu);
SCx0=SC(x0,l0);
SCx1=SC(x1,l1);
%'SCx0'
record=1;
% 'SCx1'
% SCx1
delet=SCx1-SCx0;
if delet<=0
if record>1
record=1;
end
% 'jieshou'
x0=x1;l0=l1;
SCx0=SCx1;
tabu=updatetabu(x1,tabu);%將這個解放到tabu中
% solution(outer,count)=SCx0;
count=count+1;
%把該接受的解記錄到集合SET中
if SCx1<=bestSC(best_iter)
% '3'
bestx=x1;
bestl=l1;
best_iter=best_iter+1;
bestSC(best_iter)=SCx1;
end
else
record=record+1;
if record>20
% solution(outer,1:inner)=SCx0;
break;
end
end
end %接受解的個數達到要求
end
x=x0;
l=l0;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -