拓冰建站拓冰建站
首页 / 资讯中心 / 正文

MATLAB退火算法

参考流程图写的一篇退火算法详情可见:什么是退火算法详述退火算法的原理用C语言实现退火算法。内附完整代码。 - 腾讯云开发者社区-腾讯云我的理解就是大号的概率计算排序取最优值流程图:代码块:% 赋值新函数对应关系 a1:0.5:50; fsa; fsfs/50; T1.0; fxexp(-fs); seedrand(1); if mod(seed,0.01)0.005 seedseed0.01-mod(seed,0.01); else seedseed-mod(seed,0.01); end % 随机化种子 ori_indexround(seed*(length(fx)1)); %随机化初始种子变量 indexround(0.5*(length(fx))1); T_min0.001; r0.95; Tfx(ori_index) while TT_min % dE为对应温度对应的能量 dEfx(ori_index)-fx(index); % 选择性选举能量 if(dE0) indexori_index T_minfx(ori_index) else if(exp(-dE/T)rand()) indexori_index T_minfx(ori_index) end end %自变量上下浮动 ori_indexori_indexrandi([-1,1]); if ori_index1 ori_index1 end %温度自动衰减 Tr*T; end
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门