⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 franz.m

📁 Matlab模拟退火算法工具箱,它由冷却进度表(Cooling Schedule)控制
💻 M
字号:
function a = franz(dE,T,q)
% Franz acceptance method supplied with SA Tools.
% Copyright (c) 2002, by Richard Frost and Frost Concepts.
% See http://www.frostconcepts.com/software for information on SA Tools.
%
%   a = franz(dE,T,q) ;
%
%   dE = the difference in cost between a trial state and
%     the current state: dE = Wtrial - W
%   T = the current temperature
%   q = the "q" parameter of the franz acceptance rule
%   a = 0 if trial is rejected, otherwise 1.
%
a = 0 ;
if dE <= 0                           % accept non-uphill moves
    a = 1 ;
elseif (q == 1) | (q == 2)           % avoid division by 0
    a = 1 ;
else
    if T > 0            % ignore 0 or negative temperatures
        D = ((1 - q)/(2 - q))*(dE/T) ;
        if D <= 1
            if rand < (1 - D)^(1/(1-q))
                a = 1 ;
            end
        end
    end
end

⌨️ 快捷键说明

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