【優化求解】冠狀病毒羣體免疫優化算法(CHIO)【含Matlab源碼 186期】

一、簡介

本文提出了一種新的基於自然啓發的人本優化算法:冠狀病毒羣免疫優化算法(CHIO)。

In this paper, a new nature-inspired human-based optimization algorithm is proposed which is called coronavirus herd immunity optimizer (CHIO).

CHIO的靈感來源於羣體免疫概念,作爲應對冠狀病毒大流行(COVID-19)的一種方法。

The inspiration of CHIO is originated from the herd immunity concept as a way to tackle coronavirus pandemic (COVID-19).

冠狀病毒感染的傳播速度取決於感染者如何與其他社會成員直接接觸。

The speed of spreading coronavirus infection depends on how the infected individuals directly contact with other society members.

爲了保護其他社會成員免受疾病的侵害,健康專家建議保持社會距離。

In order to protect other members of society from the disease, social distancing is suggested by health experts.

羣體免疫是一種狀態,當大多數人免疫時,人羣達到這種狀態,從而防止疾病傳播。

Herd immunity is a state the population reaches when most of the population is immune which results in the prevention of disease transmission.

這些概念是根據優化理論建模的。

These concepts are modeled in terms of optimization concepts.

CHIO模仿了羣體免疫策略和社會距離概念。

CHIO mimics the herd immunity strategy as well as the social distancing concepts.

羣體免疫利用了三種類型的個體病例:易感、感染和免疫。

Three types of individual cases are utilized for herd immunity: susceptible, infected, and immuned.

這是爲了確定如何用社會距離策略更新其基因產生的解決方案。

This is to determine how the newly generated solution updates its genes with social distancing strategies.

CHIO使用23個著名的基準函數進行評估。

CHIO is evaluated using 23 well-known benchmark functions.

首先,研究了CHIO對其參數的敏感性。

Initially, the sensitivity of CHIO to its parameters is studied.

在此基礎上,對現有的七種方法進行了比較評價。

Thereafter, the comparative evaluation against seven state-of-the-art methods is conducted.

通過對比分析,證實了CHIO與其他成熟方法相比,能夠產生非常有競爭力的結果。

The comparative analysis verifies that CHIO is able to yield very competitive results compared to those obtained by other well-established methods.

爲了進一步驗證,使用了從IEEE-CEC 2011中提取的三個實際工程優化問題。

For more validations, three real-world engineering optimization problems extracted from IEEE-CEC 2011 are used.

同樣,CHIO被證明是有效的。

Again, CHIO is proved to be efficient.

總之,CHIO是一個非常強大的優化算法,可以用來解決跨各種優化領域的許多優化問題。

In conclusion, CHIO is a very powerful optimization algorithm that can be used to tackle many optimization problems across a wide variety of optimization domains.

二、源代碼

%=======================================================================
%            Coronavirus herd immunity optimizer (CHIO)
 
% All rights reserved.       
%=======================================================================
 
 
clear all
close all
clc
 
PopSize=30; %/* The number of Solutions*/
 
MaxAge = 100;
 
C0 = 1; % number of solutions have corona virus
 
Max_iter=100000; %/*The number of cycles for foraging {a stopping criteria}*/
 
SpreadingRate = 0.05;   % Spreading rate parameter
 
runs = 1;%/*Algorithm can be run many times in order to see its robustness*/
 
ObjVal = zeros(1,PopSize);
 
Age = zeros(1,PopSize);
 
BestResults = zeros(runs,1); % saving the best solution at each run
 
for funNum=7:7  % fun#1 to fun#23
    if(funNum==1)
        Function_name='F1';
    elseif(funNum==2)
        Function_name='F2';
    elseif(funNum==3)
        Function_name='F3';
    elseif(funNum==4)
        Function_name='F4';
    elseif(funNum==5)
        Function_name='F5';
    elseif(funNum==6)
        Function_name='F6';
    elseif(funNum==7)
        Function_name='F7';
    elseif(funNum==8)
        Function_name='F8';
    elseif(funNum==9)
        Function_name='F9';
    elseif(funNum==10)
        Function_name='F10';
    elseif(funNum==11)
        Function_name='F11';
    elseif(funNum==12)
        Function_name='F12';
    elseif(funNum==13)
        Function_name='F13';
    elseif(funNum==14)
        Function_name='F14';
    elseif(funNum==15)
        Function_name='F15';
    elseif(funNum==16)
        Function_name='F16';
    elseif(funNum==17)
        Function_name='F17';
    elseif(funNum==18)
        Function_name='F18';
    elseif(funNum==19)
        Function_name='F19';
    elseif(funNum==20)
        Function_name='F20';
    elseif(funNum==21)
        Function_name='F21';
    elseif(funNum==22)
        Function_name='F22';
    elseif(funNum==23)
        Function_name='F23';
    end
 
    % Load details of the selected benchmark function
    [lb,ub,dim,fobj]=Get_Functions_details(Function_name);
 
    for run = 1:runs
        % Initializing arrays
        swarm=zeros(PopSize,dim);
        
        % Initialize the population/solutions
        swarm=initialization(PopSize,dim,ub,lb);
 
        for i=1:PopSize,
          ObjVal(i)=fobj(swarm(i,:));
        end
        
        Fitness=calculateFitness(ObjVal);
        
        
        %% update the status of the swarms (normal, confirmed) 
        %%the minmum C0 Immune rate will take 1 status which means 
        %%infected by corona 
 
        Status=zeros(1,PopSize);
        
        for i=1:C0,
            Status(fix(rand*(PopSize))+1)=1;  
        end
        
      %===================== loop ===================================
      tic
      
      itr=0;   % Loop counter
 
      while itr<Max_iter
          
          for i=1:PopSize,
           
              %evaluate new solution
              ObjValSol=fobj(NewSol);
              FitnessSol=calculateFitness(ObjValSol);
              
              % Update the curent solution  & Age of the current solution
              if (ObjVal(i)>ObjValSol) 
                swarm(i,:)=NewSol;
                Fitness(i)=FitnessSol;
                ObjVal(i)=ObjValSol;
              else
                  if(Status(i)==1)
                      Age(i) = Age(i) + 1;
                  end
              end            
                           
              % change the solution from normal to confirmed
              if ((Fitness(i) < mean(Fitness))&& Status(i)==0 && CountCornoa>0)
                  Status(i) = 1;
                  Age(i)=1;
              end
              
              % change the solution from confirmed to recovered
              if ((Fitness(i) >= mean(Fitness))&& Status(i)==1)
                  Status(i) = 2; 
                  Age(i)=0;
              end
              
              % killed the current soluion and regenerated from scratch
              if(Age(i)>=MaxAge)
                  NewSolConst = initialization(1,dim,ub,lb);
                  swarm(i,:) = NewSolConst(:);
                  Status(i) = 0;
              end
          end
                
          if(mod(itr,100)==0)
             display(['Fun#',num2str(funNum),' Run#', num2str(run), ', Itr ', num2str(itr), ' Results ', num2str(min(ObjVal))]);
          end
 
          itr=itr+1;    
      end
      
      toc;
    
      % Save the best results at each iteration
      BestResults(run)=min(ObjVal);
 
    end % run
  
    fprintf(1, '\n\n Done \n\n'); 
  
end

三、運行結果

在這裏插入圖片描述

四、備註

完整代碼或者代寫添加QQ2449341593。
往期回顧>>>>>>
【優化求解】基於matlab粒子羣優化灰狼算法【含Matlab源碼 006期】
【優化求解】基於matlab多目標灰狼優化算法MOGWO 【含Matlab源碼 007期】
【優化求解】基於matlab粒子羣算法的充電站最優佈局【含Matlab源碼 012期】
【優化求解】基於matlab遺傳算法的多旅行商問題【含Matlab源碼 016期】
【優化求解】基於matlab遺傳算法求最短路徑【含Matlab源碼 023期】
【優化求解】基於matlab遺傳和模擬退火的三維裝箱問題【含Matlab源碼 031期】
【優化求解】基於matlab遺傳算法求解車輛發車間隔優化問題【含Matlab源碼 132期】
【優化求解】磷蝦羣算法【含matlab源碼 133期】
【優化求解】差分進化算法【含Matlab源碼 134期】
【優化求解】基於matlab約束優化之懲罰函數法【含Matlab源碼 163期】
【優化求解】基於matlab改進灰狼算法求解重油熱解模型【含Matlab源碼 164期】
【優化求解】基於matlab蟻羣算法配電網故障定位【含Matlab源碼 165期】
【優化求解】基於matalb遺傳算法求解島嶼物資補給優化問題【含Matlab源碼 172期】













發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章