智能优化算法-深度睡眠优化器Deep Sleep Optimizer(附Matlab代码)

引言

由于‘没有免费的午餐’理论,没有单一的优化算法可以准确地解决所有的优化问题,因此需要新的优化技术。本文介绍了一种新的元启发式算法——深度睡眠优化器(Deep Sleep Optimizer,DSO)。深度睡眠优化器模仿人类的睡眠模式来解决优化问题。该成果2023年发表在SCI期刊IEEE Access上。

参考文献

 S. O. Oladejo, S. O. Ekwe, L. A. Akinyemi and S. A. Mirjalili, "The Deep Sleep Optimizer: A Human-Based Metaheuristic Approach," in IEEE Access, vol. 11, pp. 83639-83665, 2023, doi: 10.1109/ACCESS.2023.3298105.

Matlab代码下载

微信搜索并关注-优化算法侠,或扫描下方二维码关注,以算法名字搜索历史文章即可下载。

优化算法-深度睡眠优化器Deep Sleep Optimizer(附Matlab代码)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEEP SLEEP OPTIMIZATION (DSO).                                                           %
% Authors: Stephen Ekwe and Sunday Oladejo                                                  %
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Best] = DSO(ObjFun,LB,UB,dim,search_agent,MaxIt)
%% Problem Parameters
prob = ObjFun;                  % objective function
nVar = dim;                     % dimension of problem
lb = LB;                        % lower bound
ub = UB;                        % upper bound
nPop = search_agent;            % no. of search agent
MaxIt = run;                    % no. of individual runs

%% DSO Tuning Parameters
H0_minus = 0.17;                % minimum initial homeostatic value of search space
H0_plus = 0.85;                 % maximum initial homeostatic value of search space
a = 0.1;                        % circadian cost per unit function
xs = 4.2;                       % sleep power index
xw = 18.2;                      % wake power index
T = 24;                         % maximum sleep duration of agent

%% Pre-allocate
fit = zeros(nPop,1);                    % vector to store fitness value
Best.iteration = zeros(MaxIt+1,1);      % vector to store best fitness value per iteration

%% Starting Deep Sleep Optimization
C = sin((2*pi)/T);                      % set the periodic function
H_min = H0_minus + a.*C;                % set homeostatic lower threshold
H_max = H0_plus + a.*C;                 % set homeostatic upper threshold

Pop = repmat(lb,nPop,1) + repmat((ub-lb),nPop,1).*rand(nPop,nVar); % generate initial population of search agents

%% Evaluate fitness
for q = 1:nPop
    fit(q) = prob(Pop(q,:));            % evaluating the fitness value of the initial solution
end
Best.iteration(1) = min(fit);           % stores the best fitness value of the 0th iteration


%% Main Loop
for i = 1:MaxIt
    for j = 1:nPop
        % Get initial population for 2D plot
        %if (i==1) && (j==round(nPop*0.1))
        %    int_pop.one = Pop;
        %elseif (i==1) && (j==round(nPop*0.5))
        %    int_pop.Fone = Pop;
        %elseif (i==2) && (j==round(nPop*0.1))
        %    int_pop.two = Pop;
        %elseif (i==3) && (j==round(nPop*0.2))
        %    int_pop.three = Pop;
        %elseif (i==4) && (j==round(nPop*0.5))
        %    int_pop.four = Pop;
        %elseif (i==5) && (j==round(nPop*0.8))
        %    int_pop.five = Pop;
        %elseif (i==MaxIt) && (j==nPop*1)
        %    int_pop.last = Pop;
        %end   
        
        Xini = (Pop(j,:));              % obtain initial solution of agent
        [~,ind] = min(fit);             % determine the position of agent with best fitness
        Xbest = Pop(ind,:);             % obtain initial best solution 
        
        mu = rand;                      % randomly select asymptote value
        mu = min(H_max,mu);             % bound violating asymptote to upper bound
        mu = max(H_min,mu);             % bound violating asymptote to lower bound
        
        H0 =  Pop(j,:) + rand(1,nVar).*(Xbest - mu.*Xini); % obtain candidate solution
        
        % randomly compute candidate solution based on Sleep-Wake cycle
        if (rand > mu) 
            H = H0.*10^(-1/xs);             % exploit agent position as homeostatic pressure decreases during sleep
        else
            H = mu + (H0-mu).*10^(-1/xw);   % explore other positions as homeostatic pressure increases during wake 
        end
        
        H = min(ub,H);              % bound violating variables to their upper bound
        H = max(lb,H);              % bound violating variables to their lower bound
        
        fnew = prob(H);             % evaluating the fitness of new candidate solution
        if (fnew < fit(j))          % greedy selection
            Pop(j,:) = H;           % include the new solution in population
            fit(j) = fnew;          % include the new fitness to fitness function of population
        end
    end
    Best.iteration(i+1) = min(fit); % store best fitness per iteration
end
% DSO-TPM Solution: Global best value and position
[Best.Cost,ind] = min(fit); Best.Position = Pop(ind,:);
end

320多种基础的群智能优化算法-matlab

速来下载!超320种基础优化算法!-Matlab版(截至2023.12.02)icon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247485602&idx=1&sn=806af7a9a7169b058e179ca2a089c287&chksm=c12be4a7f65c6db15c5969dd0223d2e42759a8e24a263fb71abac3b5015c0cabe2c5bdbbf285&token=649838004&lang=zh_CN#rd

175种群智能优化算法python库

超175+种群智能优化算法Python库!!!icon-default.png?t=N7T8http://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247484577&idx=1&sn=ed0b2e27b73e738c094c7534a63a2cda&chksm=c12be8a4f65c61b2f3d90e2b4d1f480f8d0bb038b6598828ebf2434006e07925f8102af9795f&scene=21#wechat_redirect

求解cec测试函数-matlab

最新最火!cec2022测试函数来了(附Matlab代码)icon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247484693&idx=1&sn=ce311acb26bee2894db6fe90776288bd&chksm=c12be910f65c6006af080b1e97ad5514eee06b64d2caeeac2008b8c06fdc3ba379455e9ca709&scene=21#wechat_redirect

解决12工程设计优化问题-matlab

略微出手,工程设计问题(12)(附Matlab代码)icon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247485052&idx=1&sn=80e5573c1c005ee5640e44935044ee35&chksm=c12bea79f65c636fc73758b4f4893502bd89cbd1c5d15d7db15e8b5c94eeae40450439d44944&token=681266555&lang=zh_CN#rd

求解11种cec测试函数-python

一网打尽!170+种优化算法求解11种cec测试函数(附Python代码)icon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247484745&idx=1&sn=1957f7c9b44c47f171c1cd46054d1679&chksm=c12be94cf65c605a5e0f8404e6c90964ce0743b7c25ff5f98a03dedc77e5eec5b48bf0c0e782&token=681266555&lang=zh_CN#rd

解决12种工程设计优化问题-python

大放送!170+种优化算法解决12种工程设计问题(附python代码)icon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=MzkxMDQ5MDk4Ng==&mid=2247485068&idx=1&sn=c913be0f2445f8b4d3e944569f5e599f&chksm=c12bea89f65c639f1df0f8e6cacffc1fdffa96683d10743094435ee6b0b55573a5bc8eec7eb3&token=681266555&lang=zh_CN#rd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值