• 大小: 1.05MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-12-27
  • 语言: Matlab
  • 标签: matlab  

资源简介

这是以下论文的matlab源代码:Sankalap Arora,Satvir Singh,“蝴蝶优化算法:全局优化的新方法” DOI:https://doi.org/10.1007/s00500-018-3102-4。资源里包含该论文原件和matlab代码

资源截图

代码片段和文件信息

%_____________________________________________________________________________________________ %
%  Butterfly Optimization Algorithm (BOA) source codes demo V1.0                               %
%                                                                                              %
%  Author and programmer: Sankalap Arora                                                       %
%                                                                                              %
%         e-Mail: sankalap.arora@gmail.com                                                     %
%                                                                                              %
%  Main paper: Sankalap Arora Satvir Singh                                                    %
%              Butterfly optimization algorithm: a novel approach for global optimization    %
%              Soft Computing in press                                                       %
%              DOI: https://doi.org/10.1007/s00500-018-3102-4                                  %
%___________________________________________________________________________________________   %
%
function [fminbest_posConvergence_curve]=BOA(nN_iterLbUbdimfobj)

% n is the population size
% N_iter represnets total number of iterations
p=0.8;                       % probabibility switch
power_exponent=0.1;
sensory_modality=0.01;

%Initialize the positions of search agents
Sol=initialization(ndimUbLb);

for i=1:n
    Fitness(i)=fobj(Sol(i:));
end

% Find the current best_pos
[fminI]=min(Fitness);
best_pos=Sol(I:);
S=Sol; 

% Start the iterations -- Butterfly Optimization Algorithm 
for t=1:N_iter
  
        for i=1:n % Loop over all butterflies/solutions
         
          %Calculate fragrance of each butterfly which is correlated with objective function
          Fnew=fobj(S(i:));
          FP=(sensory_modality*(Fnew^power_exponent));   
    
          %Global or local search
          if rand            dis = rand * rand * best_pos - Sol(i:);        %Eq. (2) in paper
            S(i:)=Sol(i:)+dis*FP;
           else
              % Find random butterflies in the neighbourhood
              epsilon=rand;
              JK=randperm(n);
              dis=epsilon*epsilon*Sol(JK(1):)-Sol(JK(2):);
              S(i:)=Sol(i:)+dis*FP;                         %Eq. (3) in paper
          end
           
            % Check if the simple limits/bounds are OK
            S(i:)=simplebounds(S(i:)LbUb);
          
            % Evaluate new solutions
            Fnew=fobj(S(i:));  %Fnew represents new fitness values
            
            % If fitness improves (better solutions found) update then
            if (Fnew<=Fitness(i))
                Sol(i:)=S(i:);
                Fitness(i)=Fnew;
            end
           
           % Update the current global best_pos
           if Fnew<=fmin
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        3577  2018-10-14 10:36  upload\BOA.m
     文件     1533937  2018-10-14 10:36  upload\Butterfly optimization algorithm.pdf
     文件        1502  2018-10-14 10:36  upload\Get_Functions_details.m
     文件        1488  2018-10-14 10:36  upload\initialization.m
     文件        1468  2018-10-14 10:36  upload\license.txt
     文件        1833  2018-10-14 10:36  upload\main.m
     文件        1468  2018-10-14 10:36  license.txt

评论

共有 条评论