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