unitanneal.m

来自「退火确定标定值,退火技术的一个模拟程序。很有用的哦」· M 代码 · 共 24 行

M
24
字号
%function x=unitanneal(L,s,t,dt,x,lb,ub)
%x为标定值,lb为下界,ub为上界
function x=unitanneal(L,s,t,dt,x,lb,ub)
s0=0;
while 1
    a=0;
    for k=1:L
        newx=generatenew(x,lb,ub);
        df=accyouhua(newx)-accyouhua(x);
        if accept(t,df)
            x=newx,a=1;
        end
    end
    t=t*dt
    if a==0
        s0=s0+1;
    else 
        s0=0;
    end
    if s0==s
        break;
    end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?