|  | 
 
| 
本帖最后由 uperrua 于 2021-3-1 09:56 编辑 3 p; F3 ~( i8 [. r
x
EDA365欢迎您登录!您需要 登录 才可以下载或查看,没有帐号?注册  
 + ]/ @& |5 J* ]一、简介
 + k% x. A; s: d. W, y本文提出了一种新的基于自然启发的人本优化算法:冠状病毒群免疫优化算法(CHIO)。9 ]8 v8 L6 G/ @. J1 ^, j
 v$ t: y* Z, i0 z/ I% V
 In this paper, a new nature-inspired human-based optimization algorithm is proposed which is called coronavirus herd immunity optimizer (CHIO)./ r8 W% g) {& }4 W0 b) N5 J- @+ I1 J' |
 3 F1 H$ e8 \8 Q2 H. X7 \
 CHIO的灵感来源于群体免疫概念,作为应对冠状病毒大流行(COVID-19)的一种方法。
 - P, F* N5 l5 C" j  z+ H
 ( b/ g4 v+ L' {. f4 `8 a. nThe inspiration of CHIO is originated from the herd immunity concept as a way to tackle coronavirus pandemic (COVID-19).
 % j% R6 E9 n2 f6 I4 d+ \/ {3 Y, b' c0 g: ?3 s
 冠状病毒感染的传播速度取决于感染者如何与其他社会成员直接接触。
 3 W4 I, t: Z! O' d7 @+ _. M% v" z: _# Z; J+ {$ O5 W! A
 The speed of spreading coronavirus infection depends on how the infected individuals directly contact with other society members.
 ' s$ T/ _" C3 G( R: n$ s2 P  ]) l
 & L, l5 @8 O( N) P- F0 L为了保护其他社会成员免受疾病的侵害,健康专家建议保持社会距离。) x8 u" U0 j0 e! E3 |. ?, y
 & s& f/ n$ J0 X1 e' W
 In order to protect other members of society from the disease, social distancing is suggested by health experts.$ \. q3 g: @% {, D: X- q) ?6 q  g, f/ H
 
 Z1 b1 k2 P* Q+ C群体免疫是一种状态,当大多数人免疫时,人群达到这种状态,从而防止疾病传播。
 . l( r, G3 b) {# u5 g- `6 y( w
 # M7 ^" u7 r9 O1 {3 n4 xHerd immunity is a state the population reaches when most of the population is immune which results in the prevention of disease transmission.# p: w: c9 y& I
 
 - J$ B+ m3 p8 b& s2 L# C这些概念是根据优化理论建模的。+ R# j& u7 [- S
 
 $ z% O0 c+ l) I. d8 fThese concepts are modeled in terms of optimization concepts.6 S9 J8 Y' a- E
 
 / j7 I! U, [! h- `. B) E/ u/ eCHIO模仿了群体免疫策略和社会距离概念。' O' B2 m3 a" x; a
 : }4 J5 N$ N  H# X8 }% n* @
 CHIO mimics the herd immunity strategy as well as the social distancing concepts." F! r6 o4 g  G" f( v* y
 
 8 E: J9 K! [0 G/ C1 p" J群体免疫利用了三种类型的个体病例:易感、感染和免疫。' Q% j' D9 P) r) x) i4 H* B8 M
 
 ) N6 \9 {) a9 ?* k+ P; \1 AThree types of individual cases are utilized for herd immunity: susceptible, infected, and immuned.
 ( c3 t2 j* L+ A" i: a
 8 z$ D" I7 a7 E( R这是为了确定如何用社会距离策略更新其基因产生的解决方案。! \0 y0 o* P( d
 , @$ R  G0 h) K% P; z
 This is to determine how the newly generated solution updates its genes with social distancing strategies.. N5 K- V2 L. [
 " d2 ^1 i) _6 j7 E7 d8 `& s
 CHIO使用23个著名的基准函数进行评估。- ?. f6 H6 U+ m8 A- T
 % m) W( \- R# Y* b. {
 CHIO is evaluated using 23 well-known benchmark functions.) R# u( `, b) F1 z1 z
 ( a$ K4 s/ {2 w! B+ ?' {
 首先,研究了CHIO对其参数的敏感性。6 I  @: b& s. [
 & {5 [# L" K: \$ H
 Initially, the sensitivity of CHIO to its parameters is studied.
 ' N* w! q: C% \( `  ?
 3 ]' Q3 z# }& d0 w2 u1 ?在此基础上,对现有的七种方法进行了比较评价。) I. x( J2 @5 A2 o: o+ l$ z9 j
 
 8 z: K! e7 K% c3 U7 A+ K" g( ~% @Thereafter, the comparative evaluation against seven state-of-the-art methods is conducted.+ B# S: ?4 v" G2 Q9 k
 R* Q! ^- n6 Q6 p
 通过对比分析,证实了CHIO与其他成熟方法相比,能够产生非常有竞争力的结果。% h1 w* U0 ^$ D
 
 : b% z+ k( l* F4 @& D7 X9 x, BThe comparative analysis verifies that CHIO is able to yield very competitive results compared to those obtained by other well-established methods.' ?$ h) A7 o. s, V9 x2 \  J. W+ {
 $ G4 B0 a; d( O& L
 为了进一步验证,使用了从IEEE-CEC 2011中提取的三个实际工程优化问题。
 0 I- y- n' o' k4 r" Y. x# {1 I& ~8 i; |0 u9 s
 For more validations, three real-world engineering optimization problems extracted from IEEE-CEC 2011 are used.. K: G7 [! Q* C6 n3 N8 ~
 2 V5 ?0 d! U' `& f0 F9 k9 b, I
 同样,CHIO被证明是有效的。- ]+ i; i( K2 S% F: b
 
 H) j' o/ Y  P! a! t) IAgain, CHIO is proved to be efficient.
 7 F% \8 M6 ^" e0 G+ p
 6 u4 k5 h9 d! [$ c总之,CHIO是一个非常强大的优化算法,可以用来解决跨各种优化领域的许多优化问题。& n% O3 ~: _9 i  d
 0 I% Q& x* @: c) r5 t. M( [
 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.! }; P  O& ^+ ?; J* L9 f
 * M- W% ]/ L* j6 t8 s; r( _
 二、源代码1 ]: w6 _: _" M6 `7 ]9 u/ v2 _, J
 %=======================================================================
 + x3 W3 m3 u4 ]. _9 \# E( |! ?) I; ]" l%            Coronavirus herd immunity optimizer (CHIO)
 * Y% |/ {& S3 x. b  `) ~4 o2 u) } $ o9 J& N/ D/ d0 w7 P
 % All rights reserved.       : h+ W) ?  {6 E) F5 Y1 `" @( g* y
 %=======================================================================% g$ G3 Y  i/ H! c
 ' B) a6 O+ z: L8 l+ k5 K
 ! N) j. y& j8 t: r  A" v$ T  ~% ?& I, h
 clear all5 E: q+ f1 x/ N1 D: u0 l& d# h
 close all
 1 [$ k5 m& o: |clc
 % `6 Z1 B' B9 m* n% ]
 5 t0 P) T- V/ k! S7 J# lPopSize=30; %/* The number of Solutions*/: O- ]3 L# t. l
 
 4 i- V- j  c+ i+ ?+ q% `, d( O! O( a6 Y! MMaxAge = 100;
 6 L( v5 P, U* U2 E4 Z# y2 M - ]4 J8 k* w5 F& b) |" D4 n
 C0 = 1; % number of solutions have corona virus
 " N" k$ k3 j8 y; a6 s
 W% b) \0 W1 U6 {: pMax_iter=100000; %/*The number of cycles for foraging {a stopping criteria}*/+ ]$ u3 v2 T9 w  e
 & q2 S0 p: Z. Y$ ~+ N' i
 SpreadingRate = 0.05;   % Spreading rate parameter) r$ L- ^& k( E) i! X8 G2 b: I
 
 - `: S7 U( j  `& o8 ]7 J- H8 A+ Sruns = 1;%/*Algorithm can be run many times in order to see its robustness*/
 # C6 R! f; y. q& `9 J6 Y) m& z # {& N4 O2 {3 @; @1 X8 R
 ObjVal = zeros(1,PopSize);
 ) [9 n6 z% Z& d5 Q. E0 o. P
 # U0 L. b# r. I+ pAge = zeros(1,PopSize);6 R* K" @/ K' c# _# [, u+ J
 & f# t. T3 }+ r
 BestResults = zeros(runs,1); % saving the best solution at each run
 ; ]3 ?- F9 Y9 @6 G  F8 i+ O" u 4 d# [" C$ V6 Q6 _4 y
 for funNum=7:7  % fun#1 to fun#23
 $ \2 A/ ]: A) Y0 A$ g$ ?: ?( b1 \4 O( f    if(funNum==1)
 : X- b  x" T5 |3 a+ P8 {8 J        Function_name='F1';
 w* X% H7 p# s( i    elseif(funNum==2)
 2 V1 I8 I$ P& F1 X        Function_name='F2';* B+ ~  J/ w% X# W# l
 elseif(funNum==3). c4 h7 n1 _/ W3 S
 Function_name='F3';
 " y( @- l& ~% B  ^. L" P    elseif(funNum==4)
 p. J8 t& W! ]% L; @+ q        Function_name='F4';- v. @2 i" C3 _" U. p4 _) [4 ~
 elseif(funNum==5)2 [1 Z7 Y$ x/ C2 C  `0 j( o
 Function_name='F5';% z$ H; i1 l7 j( J. [+ S
 elseif(funNum==6)
 ! C2 o" |; A6 G4 h6 {        Function_name='F6';6 Z3 M' ?; h) i5 q# `
 elseif(funNum==7)3 @, V! H  f% q+ L3 U3 Y+ S& w  n
 Function_name='F7';. n. p) n  o: L3 t+ |+ W  [
 elseif(funNum==8)
 7 i' H2 u/ j9 Z5 E( q9 f1 c8 g5 {        Function_name='F8';
 ! G* U8 Y$ e3 V" P3 u4 K  d    elseif(funNum==9)
 0 ^8 o7 |1 C+ P% x. u4 X        Function_name='F9';
 : B  `# X  d1 A) i    elseif(funNum==10)
 : t+ y! N; v" X; I$ o' R# M1 A3 L5 q        Function_name='F10';
 6 J9 K4 x6 p6 L, u3 Q( G( N    elseif(funNum==11)" ?$ d/ H2 H' [$ I$ @4 [
 Function_name='F11';4 G% e* |3 t$ g8 R- X! R) Z0 y
 elseif(funNum==12)
 9 m2 K% q: N+ V9 U" [9 `' Y" k- `7 V        Function_name='F12';
 # V- {0 B* O" O) r/ _& |* }5 Y  z1 l2 s    elseif(funNum==13)
 0 J# |6 Q, U( i4 h        Function_name='F13';
 9 x9 Y$ ~' [* G* N& @8 M    elseif(funNum==14)
 ' K. `% i% n2 s, F8 K: Q" C        Function_name='F14';! F0 N1 B* R; y: \8 c
 elseif(funNum==15)  C- n0 _$ J" p4 V# }; h+ D
 Function_name='F15';' b% N0 c2 v9 I1 \0 ^
 elseif(funNum==16)
 + C6 w" b2 W5 ?& b        Function_name='F16';/ ~+ R8 `4 l) ]- z
 elseif(funNum==17)
 : ~5 m, A- D7 W! r! C/ [0 J        Function_name='F17';! K) h; s! l* u/ ^4 v
 elseif(funNum==18); a% s' ]$ ~0 H7 y% l
 Function_name='F18';
 1 r" c: E* `& \3 K. G' g    elseif(funNum==19)' F4 ?# ?' r- F# a- Z0 o2 P2 u
 Function_name='F19';
 / |5 m9 G- b+ ]4 f. J" n5 E* h* z    elseif(funNum==20)9 k8 G; ?  i- f5 A: t* Y" [
 Function_name='F20';( [# S! j8 }3 d! \, ]# \
 elseif(funNum==21)! P6 O# K, V' T# V% C
 Function_name='F21';, \" V. s) K2 i4 k* z" i  F: h
 elseif(funNum==22)/ Q$ V5 e7 R: W4 p
 Function_name='F22';; j; a) [* T( P6 ]
 elseif(funNum==23)( k. O: R! j4 T6 U" H+ ?
 Function_name='F23';
 . f  U: W. E5 [; Z" s    end* P+ A. G% L& i  |" I( D# f) ?+ N
 
 2 x/ {* b; I5 l. e6 r. q  E    % Load details of the selected benchmark function
 / `" }- Y7 K0 U$ L- @* u3 W    [lb,ub,dim,fobj]=Get_Functions_details(Function_name);
 5 {" C0 o( f6 ^: i9 r& l- a / z( F. e( K: y
 for run = 1: runs4 o2 J6 e4 F. M  U
 % Initializing arrays# {. L6 P# y. X$ S/ J% j
 swARM=zeros(PopSize,dim);
 : L, C6 J& o2 \7 d" k4 Z        ; {( j$ O0 c9 H* [( d
 % Initialize the population/solutions
 5 ?8 Y+ D- J) @3 T2 d        swarm=initialization(PopSize,dim,ub,lb);
 7 h5 u* D- C3 b6 S1 e$ I% U 6 v, t0 @* ~) W& X5 V
 for i=1: PopSize,
 * \9 c( ~( G! U1 Y2 h- [          ObjVal(i)=fobj(swarm(i,: ));
 * W, D9 B; f; W0 c# ^        end
 * a' J  A2 {) C9 ]        " ^$ h  m7 i, |3 [/ m$ J
 Fitness=calculateFitness(ObjVal);
 . X; s! @' p% t7 l        " g" m  j8 m! K) x1 x
 
 * d1 |8 @  o, _0 Z! h; a- b        %% update the status of the swarms (normal, confirmed)
 0 U! `% j/ L# I/ X% @        %%the minmum C0 Immune rate will take 1 status which means
 8 d: r% W8 _2 K        %%infected by corona + G. ^- m% q) I9 x$ `' j1 E
 / C. u4 l0 Q, W  ]. s6 X
 Status=zeros(1,PopSize);( {3 [& G: y; n1 B; t3 ]! Y7 k
 ; r* Z2 A2 }2 |4 e% }
 for i=1: C0,
 3 u- H; a3 t3 H0 |            Status(fix(rand*(PopSize))+1)=1;  & S" s3 G3 W* c$ h% h% E8 A
 end' @$ Q8 p7 J/ }3 U$ c; T
 
 0 U1 z+ I' E( F      %===================== loop ===================================9 _1 ~8 D2 M* r$ U; p
 tic# B5 A- H% v% j& {. p6 X1 i
 ( X1 @! V* O& [% ?$ @
 itr=0;   % Loop counter: K0 S/ }# W2 Z3 O, ~8 Q
 . g/ o& K( l5 q- Z
 while itr<Max_iter
 # @/ ]$ e) l4 T6 k2 s          1 J) Q5 H3 _# q' t" |& \* p7 r# A
 for i=1: PopSize,
 & }; u+ A7 d( H! [9 W( S
 , M8 {1 H+ h- j8 E( y0 b7 H              %evaluate new solution1 _. K$ O4 T  Y6 h/ F6 c; @+ H
 ObjValSol=fobj(NewSol);
 * R3 Y! W: w* Y              FitnessSol=calculateFitness(ObjValSol);5 r! |' }% Q3 \
 " J$ x0 ?* @9 _
 % Update the curent solution  & Age of the current solution
 4 U  J6 ?: j2 o: ~2 }              if (ObjVal(i)>ObjValSol) # ~: B4 h# ~* D, K4 L4 K. Q9 l$ F4 b# i
 swarm(i,: )=NewSol;9 o9 Z/ f: |* W* u
 Fitness(i)=FitnessSol;
 9 u# k; H3 f* B6 D                ObjVal(i)=ObjValSol;( D4 P" S. W* K+ A$ L7 C
 else
 5 p: ]; K6 m( `+ P  x+ Z. H7 ^7 C                  if(Status(i)==1)
 , P; E. r: H, g                      Age(i) = Age(i) + 1;' z  e& V3 U! K% D; B* I1 ~" X
 end
 0 W4 n! I. G) B) S! e8 [$ a7 z              end
 ! n$ M- ?3 d8 _" {& [
 - K# h' Z/ K1 e4 }' f: B              % change the solution from normal to confirmed! }  d- S5 s; F( B. t
 if ((Fitness(i) < mean(Fitness))&& Status(i)==0 && CountCornoa>0)9 ~) a3 a4 |' f$ t. }
 Status(i) = 1;
 & `8 l7 ~6 x8 J( R, z# y                  Age(i)=1;
 0 h) G7 h# \& J9 K  c( D* |              end
 ) A1 M  W7 x9 C# k; r
 , Q7 g8 A# t: T. _# t- \5 }, L8 g              % change the solution from confirmed to recovered
 % J6 ^" y! a+ ?- U' x* r9 g              if ((Fitness(i) >= mean(Fitness))&& Status(i)==1)
 ( x" o5 U; t) j, u7 h. ]+ l                  Status(i) = 2; ! t' c% J/ d! P6 A  M" \
 Age(i)=0;
 7 O# r& |5 M6 q& j$ G/ T# Q              end
 + P7 k0 ]: h5 A( W5 P
 + M2 l2 c  H: F- l; L" ~5 e              % killed the current soluion and regenerated from scratch8 L3 S' k8 q% R
 if(Age(i)>=MaxAge)3 k& @; e( M0 U1 X
 NewSolConst = initialization(1,dim,ub,lb);7 ]' Q# B0 {. [( I
 swarm(i,: ) = NewSolConst(: );
 4 ^$ S% i  y$ S' w                  Status(i) = 0;* ]* Y$ X9 i$ F- n% a
 end
 8 g" K7 I/ I  c: g9 Q# F/ s          end
 ! y1 r4 v5 b0 v. d. Z& K$ e
 ' I: T1 M  o! s2 ^' U, \& h& E: F$ c  U          if(mod(itr,100)==0)6 X" I% J6 A5 e0 T5 D; W- H
 display(['Fun#',num2str(funNum),' Run#', num2str(run), ', Itr ', num2str(itr), ' Results ', num2str(min(ObjVal))]);! O: [6 f/ H4 }  e1 u
 end
 1 e  a' Y* x4 H 9 c5 B5 O# G5 A+ q9 S% b
 itr=itr+1;
 8 `. Y  H4 L1 v' O      end
 ! K" \3 O* A2 ?1 g/ m
 7 E' L5 O1 _! P! b      toc;0 ^+ f2 G( L: ]/ h- S7 X
 
 ! p) ?* G, F% U# Z: |9 R& Z      % Save the best results at each iteration8 z" h, A, F% {& s* y* ]+ a( n1 k
 BestResults(run)=min(ObjVal);
 : P) ~. l5 ~6 f
 3 ^6 k# w+ k7 U8 S8 m( M) z$ A    end % run
 9 ~; ]9 p, U8 f5 E5 ^+ [
 / X" R7 W3 D$ {% X$ @2 W    fprintf(1, '\n\n Done \n\n'); 2 ?. s2 @1 Q  h7 V0 G
 
 ( Y) O) l" B: pend
 1 P; U% Z* c; Y2 S/ g9 ]0 S5 v+ N三、运行结果' u2 u" v% O7 ^( ]' M
 
   | 
 |