模拟退火算法Matlab源程序.doc

模拟退火算法Matlab源程序.doc

ID:56709767

大小:47.50 KB

页数:4页

时间:2020-07-05

模拟退火算法Matlab源程序.doc_第1页
模拟退火算法Matlab源程序.doc_第2页
模拟退火算法Matlab源程序.doc_第3页
模拟退火算法Matlab源程序.doc_第4页
资源描述:

《模拟退火算法Matlab源程序.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、MCM战备历程3(模拟退火算法Matlab源程序)Forglory  2007-02-0311:20:04

2、  分类: 数学建模 

3、  标签:学习  

4、字号 订阅%模拟退火算法程序T_max=input('pleaseinputthestarttemprature');T_min=input('pleaseinputtheendtemprature');iter_max=input('pleaseinputthemostinterpstepsonthefittemp');s_max=input('pleaseinputthemoststeadystepsontthefittemp'

5、);T=T_max;loadd:address.txt;order1=randperm(size(address,1))';%生成初始解。plot(address(order1,1),address(order1,2),'*r-')totaldis1=distance(address,order1);whileT>=T_min   iter_num=1;   s_num=1;     plot(T,totaldis1)   holdon   whileiter_num

6、   totaldis2=distance(address,order2);       R=rand;       DeltaDis=totaldis2-totaldis1;       ifDeltaDis<0;           order1=order2;            totaldis1=totaldis2;       elseif(exp((totaldis1-totaldis2)/(T))>R)           order1=order2;           totaldis1=totaldis2;       elses_num=s_num+1; 

7、      end       iter_num=iter_num+1;   end   T=T*0.99;endorder1totaldis1figure(2)plot(address(order1,1),address(order1,2),'*r-') functiony=distance(address,order)nmb=size(address,1);y=0;fori=1:nmb-1   y=y+sqrt((address(order(i+1),1)-address(order(i),1))^2+(address(order(i+1),2)-address(order(i

8、),2))^2);endy=y+sqrt((address(order(i+1),1)-address(order(1),1))^2+(address(order(i+1),2)-address(order(1),2))^2);    functiony=exhgpath(order)  while1      b=size(order,1);      r=unidrnd(b,1,2);      ifr(1)-r(2)~=0          break      end  end  b=order(r(2));  order(r(2))=order(r(1));  order

9、(r(1))=b;(模拟退火算法Matlab源程序)学术讨论2008-04-0118:05:56阅读1322评论6  字号:大中小 订阅(模拟退火算法Matlab源程序)Forglory   [折叠]%模拟退火算法程序T_max=input('pleaseinputthestarttemprature');T_min=input('pleaseinputtheendtemprature');iter_max=input('pleaseinputthemostinterpstepsonthefittemp');s_max=input('pleaseinputthemoststeady

10、stepsontthefittemp');T=T_max;loadd:address.txt;order1=randperm(size(address,1))';%生成初始解。plot(address(order1,1),address(order1,2),'*r-')totaldis1=distance(address,order1);whileT>=T_min   iter_num=1;   s_num=1;     plot(T,totaldis1)   ho

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。