三九宝宝网宝宝教育教学论文

关于蚁群算法应用的英文翻译

01月02日 编辑 39baobao.com

[疯狂动物城英文读后感]"Crazy Town animal" produced by Walt Disney Pictures of 3D animation, a modern urban animals, each animal in here have their own homes, Plaza Sahara desert climat...+阅读

找不到翻译,给你一个算法吧!该程序试图对具有31个城市的VRP进行求解,已知的最优解为784.1,我用该程序只能优化到810左右,应该是陷入局部最优,但我不知问题出在什么地方。请用过蚁群算法的高手指教。蚁群算法的matlab源码,同时请指出为何不能优化到已知的最好解%%% the procedure of ant colony algorithm for VRP%% % % % % % % % % % %%initialize the parameters of ant colony algorithms load data.txt; d=data(:,2:3); g=data(:,4); m=31; % 蚂蚁数 alpha=1; belta=4;% 决定tao和miu重要性的参数 lmda=0; rou=0.9; %衰减系数 q0=0.95;% 概率 tao0=1/(31*841.04);%初始信息素 Q=1;% 蚂蚁循环一周所释放的信息素 defined_phrm=15.0; % initial pheromone level value QV=100; % 车辆容量 vehicle_best=round(sum(g)/QV)+1; %所完成任务所需的最少车数 V=40;% 计算两点的距离 for i=1:32; for j=1:32; dist(i,j)=sqrt((d(i,1)-d(j,1))^2+(d(i,2)-d(j,2))^2); end; end;%给tao miu赋初值 for i=1:32; for j=1:32; if i~=j;%s(i,j)=dist(i,1)+dist(1,j)-dist(i,j); tao(i,j)=defined_phrm; miu(i,j)=1/dist(i,j); end; end; end; for k=1:32; for k=1:32; deltao(i,j)=0; end; end; best_cost=10000; for n_gen=1:50; print_head(n_gen); for i=1:m;%best_solution=[]; print_head2(i); sumload=0; cur_pos(i)=1; rn=randperm(32); n=1; nn=1; part_sol(nn)=1;%cost(n_gen,i)=0.0; n_sol=0; % 由蚂蚁产生的路径数量 M_vehicle=500; t=0; %最佳路径数组的元素数为0 while sumload for k=1:length(rn); if sumload+g(rn(k))gama(cur_pos(i),rn(k))=(sumload+g(rn(k)))/QV; A(n)=rn(k); n=n+1; end; end; fid=fopen('out_customer.txt','a+'); fprintf(fid,'%s %i\t','the current position is:',cur_pos(i)); fprintf(fid,'\n%s','the possible customer set is:') fprintf(fid,'\t%i\n',A); fprintf(fid,'------------------------------\n'); fclose(fid); p=compute_prob(A,cur_pos(i),tao,miu,alpha,belta,gama,lmda,i); maxp=1e-8; na=length(A); for j=1:na; if p(j)>maxp maxp=p(j); index_max=j; end; end; old_pos=cur_pos(i); if rand

(1)cur_pos(i)=A(index_max); else krnd=randperm(na); cur_pos(i)=A(krnd

(1)); bbb=[old_pos cur_pos(i)]; ccc=[1 1]; if bbb==ccc; cur_pos(i)=A(krnd

(2)); end; end; tao(old_pos,cur_pos(i))=taolocalupdate(tao(old_pos,cur_pos(i)),rou,tao0);%对所经弧进行局部更新 sumload=sumload+g(cur_pos(i)); nn=nn+1; part_sol(nn)=cur_pos(i); temp_load=sumload; if cur_pos(i)~=1; rn=setdiff(rn,cur_pos(i)); n=1; A=[]; end; if cur_pos(i)==1; % 如果当前点为车场,将当前路径中的已访问用户去掉后,开始产生新路径 if setdiff(part_sol,1)~=[]; n_sol=n_sol+1; % 表示产生的路径数,n_sol=1,2,3,..5,6...,超过5条对其费用加上车辆的派遣费用 fid=fopen('out_solution.txt','a+'); fprintf(fid,'%s%i%s','NO.',n_sol,'条路径是:'); fprintf(fid,'%i ',part_sol); fprintf(fid,'\n'); fprintf(fid,'%s','当前的用户需求量是:'); fprintf(fid,'%i\n',temp_load); fprintf(fid,'------------------------------\n'); fclose(fid);% 对所得路径进行路径内3-opt优化 final_sol=exchange(part_sol); for nt=1:length(final_sol); % 将所有产生的路径传给一个数组 temp(t+nt)=final_sol(nt); end; t=t+length(final_sol)-1; sumload=0; final_sol=setdiff(final_sol,1); rn=setdiff(rn,final_sol); part_sol=[]; final_sol=[]; nn=1; part_sol(nn)=cur_pos(i); A=[]; n=1; end; end; if setdiff(rn,1)==[];% 产生最后一条终点不为1的路径 n_sol=n_sol+1; nl=length(part_sol); part_sol(nl+1)=1;%将路径的最后1位补1% 对所得路径进行路径内3-opt优化 final_sol=exchange(part_sol); for nt=1:length(final_sol); % 将所有产生的路径传给一个数组 temp(t+nt)=final_sol(nt); end; cost(n_gen,i)=cost_sol(temp,dist)+M_vehicle*(n_sol-vehicle_best); %计算由蚂蚁i产生的路径总长度 for ki=1:length(temp)-1; deltao(temp(ki),temp(ki+1))=deltao(temp(ki),temp(ki+1))+Q/cost(n_gen,i); end; if cost(n_gen,i)best_cost=cost(n_gen,i); old_cost=best_cost; best_gen=n_gen; % 产生最小费用的代数 best_ant=i; %产生最小费用的蚂蚁 best_solution=temp; end; if i==m; %如果所有蚂蚁均完成一次循环,,则用最佳费用所对应的路径对弧进行整体更新 for ii=1:32; for jj=1:32; tao(ii,jj)=(1-rou)*tao(ii,jj); end; end; for kk=1:length(best_solution)-1; tao(best_solution(kk),best_solution(kk+1))=tao(best_solution(kk),best_solution(kk+1))+deltao(best_solution(kk),best_solution(kk+1)); end; end; fid=fopen('out_solution.txt','a+'); fprintf(fid,'%s%i%s','NO.',n_sol,'路径是:'); fprintf(fid,'%i ',part_sol); fprintf(fid,'\n'); fprintf(fid,'%s %i\n','当前的用户需求量是:',temp_load); fprintf(fid,'%s %f\n','总费用是:',cost(n_gen,i)); fprintf(fid,'------------------------------\n'); fprintf(fid,'%s\n','最终路径是:'); fprintf(fid,'%i-',temp); fprintf(fid,'\n'); fclose(fid); temp=[]; break; end; end; end; end; 我现在也在研究它,希望能共同进步.建义可以看一下段海滨的关于蚁群算法的书.讲的不错,李士勇的也可以,还有一本我在图书馆见过,记不得名字了.

以下为关联文档:

需要两篇关于数字签名的英文文献1 数字业务中的信任与保密:TrustBus 2006/会议录/Trust and privacy in digital business 作者:Simone Fischer-Hübner 著 出版社:湖北辞书出版社 出版时间:2006年12月 Exploit...

跪求神探夏洛克第一季的观后感要用英文Sherlock is a British television series that presents a contemporary update of Sir Arthur Conan Doyle's Sherlock Holmes detective stories. This TV drama is base...

寻有关中西方建筑文化差异论文的开题报告或英文的参考文献中国期刊全文数据库 共找到 12 条 [1] 王蒙. 汉城盛会话东洋[J]读书, 1996,(01) . [2] 孟丹. 走向“天人合一”的城市文化生态观[J]华南理工大学学报(社会科学版), 2001,(01) ....

求电影美丽人生英文观后感I am surprised about the negative comments that some people made on this web-page. I can see how some people might not experience the same kind of uplift or joy...

速求意大利电影美丽人生的英文影评 1000字左右十万火急The first half of the movie is a whimsical, romantic comedy and often slapstick. Guido (Roberto Benigni), a young Italian Jew, arrives in Arezzo where he sets u...

求美丽人生英文观后感 120词左右高一水平"Life is beautiful",is a film about that brief period of Nazi rule in Italy due to which many ordinary Jewish people had to endure enormous hardships.Although it...

美丽人生英文观后感 80字左右初中水平词语越简单越好"Life is beautiful",is a film about that brief period of Nazi rule in Italy due to which many ordinary Jewish people had to endure enormous hardships.Although it...

怎么写英文评语you impressed us as responsible,kind,active,and sweet teacher,my kid likes your lesson a lot,hope you enjoy your work and life in China,thanks for your help.作...

求动画片匹诺曹的英文影评Such animation seems to be dwindling today when looking at- and thinking a lot about- Pinocchio, one of the real landmarks that Walt Disney ever produced. It mi...

推荐阅读
图文推荐