Intelligent optimization algorithm: Gannet optimization algorithm - with code

Intelligent optimization algorithm: Gannet optimization algorithm


Abstract: Gannet Optimization Algorithm (GOA) is a swarm optimization algorithm proposed by Pan et al. in March 2022 based on the predation behavior of ponds. It has the characteristics of strong optimization ability and fast convergence speed.

1. Gannet optimization algorithm

1.1 Population initialization

In GOA, the initial population has NNN only pond my body, the secondiii pond my islandX i X_iXi 的位置, 如公式 (1) 所示:
X i = ( x i 1 , x i 2 , ⋯   , x i D ) , i = 1 , 2 , ⋯   , N , (1) X_i=\left(x_{i 1}, x_{i 2}, \cdots, x_{i D}\right), i=1,2, \cdots, N,\tag{1} Xi=(xi 1,xi2,,xiD),i=1,2,,N,(1)
其中 x i j = r 1 × ( U B j − L B j ) + L B j , i = 1 , 2 , ⋯   , N , j = x_{i j}=r_1 \times\left(U B_j-L B_j\right)+L B_j, i=1,2, \cdots, N, j= xij=r1×(UBjLBj)+LBj,i=1,2,,N,j= 1 , 2 , ⋯   , D 1,2, \cdots, D 1,2,,D , means theiii gannet atjjposition in dimension j , DDD is the dimension of each pond,r 1 r_1r1is [0,1][0,1][0,1 ] random number,UB j U B_jUBjand LB j L B_jLBjRespectively is the jjth jj found in each pondThe upper and lower bounds of dimension j .
In addition, define a storage matrixMXMXMX , used to store the position of individual gannets during each iteration. In the iterative process, if thisMX i M X_iMXiThe value is better than the current X i X_iXivalue, then individual X i X_iXiThe value of MX i M X_iMXiReplaced by the value of . Next, take a [ 0 , 1 ][0,1][0,1 ] random numberrrr, 当 r < 0.5 r<0.5 r<0.5 , the gannet is in the exploration stage; whenr ⩾ 0.5 r \geqslant 0.5rAt 0.5 , Tang I was in the development stage.

1.2 Exploration stage

When gannets find their prey in the air, they use U \mathrm{U} according to the depth of the prey in the waterU -shaped diving pattern andV \mathrm{V}V -shaped diving is used to catch prey. When the prey is at a relatively deep position, the gannet dives in a U-shaped diving manner, as shown in the formula (2):
a = 2 × cos ⁡ ( 2 × π × r 2 ) × t 1 , (2) a=2 \times \cos \left(2 \times \pi \times r_2\right) \times t_1,\tag{2}a=2×cos(2×Pi×r2)×t1,( 2 )
When the prey is at a relatively shallow position, the gannet moves withV \mathrm{V}V -type diving mode diving, as shown in formula (3): where
V
( x ) = { − 1 π ⋅ x + 1 , x ∈ ( 0 , π ) 1 π × x − 1 , x ∈ ( π , 2 π ) , t 1 = 1 − t T max (3) V(x)=\left\{\begin{array}{l}-\frac{1}{\ pi} \cdot x+1, x \in(0, \pi) \\ \frac{1}{\pi} \times x-1, x \in(\pi, 2 \pi)\end{array}, t_1=1-\frac{t}{T_{\text {max }}}\right.\tag{3}V(x)={ Pi1x+1,x(0,p )Pi1×x1,x( p ,2 p ).,t1=1Tmax t( 3 )
, wherettt is the current iteration number,T max T_{\text {max }}Tmax is the maximum number of iterations, r 2 r_2r2and r 3 r_3r3Both are [ 0 , 1 ] [0,1][0,1 ] random number.
Introduce a random variableqqq randomly selects a kind of gannet to update its position, and the position update method of gannet is as follows:
MX i ( t + 1 ) = { X i ( t ) + u 1 + u 2 , q ⩾ 0.5 X i ( t ) + v 1 + v 2 , q < 0.5 (4) M X_i(t+1)=\left\{\begin{array}{l} X_i(t)+u_1+u _2, q \geqslant 0.5 \\ X_i(t)+v_1+v_2, q<0.5 \end{array}\right.\tag{4}MXi(t+1)={ Xi(t)+u1+u2,q0.5Xi(t)+v1+v2,q<0.5(4)
式 (4) 中 u 2 = A × ( X i ( t ) − X r ( t ) ) , v 2 = B × u_2=A \times\left(X_i(t)-X_r(t)\right), v_2=B \times u2=A×(Xi(t)Xr(t)),v2=B× ( X i ( t ) − X m ( t ) ) , A = ( 2 × r 4 − 1 ) × a , B = ( 2 × \left(X_i(t)-X_m(t)\right), \quad A=\left(2 \times r_4-1\right) \times a, \quad B=(2 \times (Xi(t)Xm(t)),A=(2×r41)×a,B=(2× r 5 − 1 ) × b \left.r_5-1\right) \times b r51)×b , wherer 4 r_4r4and r 5 ​​r_5r5Both are [ 0 , 1 ] [0,1][0,1 ] random number,u 1 u_1u1Is [ − a , a ] [-a, a][a,a random number between ] , v 1 v_1v1is [ − b , b ] [-b, b][b,b ] random number betweenX i ( t ) X_i(t)Xi( t ) is theiii pond i bird individual atttPosition at iteration t , X i ( t ) X_i(t)Xi( t ) is the position of the randomly selected individual bird in the current iteration,X m ( t ) X_m(t)Xm( t ) refers to the average value of all individual positions in the current iteration, and its calculation formula is:X m ( t ) = X_m(t)=Xm(t)= 1 N ∑ i = 1 N X i ( t ) \frac{1}{N} \sum_{i=1}^N X_i(t) N1i=1NXi(t)

1.3 Development stage

When I enter the water in the pond, its catching ability CCC greater than or equal toccc , it will suddenly rotate to catch fish; its catching abilityCCC is less thanccc, 则会放弃捕鱼随机游行, 采用Levy 飞行 模型模拟塘鹅游行, 其位置更新如下:
M X i ( t + 1 ) = { t 1 × δ × ( X i ( t ) − X Best  ( t ) ) + X i ( t ) , C ⩾ c X Best  ( t ) − ( X i ( t ) − X Best  ( t ) ) × P × t 1 , C < c (5) \begin{aligned} & M X_i(t+1)= \\ & \begin{cases}t_1 \times \delta \times\left(X_i(t)-X_{\text {Best }}(t)\right)+X_i(t), & C \geqslant c \\ X_{\text {Best }}(t)-\left(X_i(t)-X_{\text {Best }}(t)\right) \times P \times t_1, & C<c\end{cases} \\ & \end{aligned}\tag{5} MXi(t+1)={ t1×d×(Xi(t)XBest (t))+Xi(t),XBest (t)(Xi(t)XBest (t))×P×t1,CcC<c(5)
式 (5) 中, t 1 = 1 − t T max ⁡ , C = 1 R × t 2 , t 2 = 1 + t T max ⁡ t_1=1-\frac{t}{T_{\max }}, C=\frac{1}{R \times t_2}, t_2=1+\frac{t}{T_{\max }} t1=1Tmaxt,C=R×t21,t2=1+Tmaxt,
R = M × v e l 2 L , L = 0.2 + ( 2 − 0.2 ) × r 6 , δ = C × R=\frac{M \times v_{\mathrm{e}} l^2}{L}, \quad L=0.2+(2-0.2) \times r_6, \quad \delta=C \times R=LM×vel2,L=0.2+(20.2)×r6,d=C×
∣ X i ( t ) − X Best  ( t ) ∣ , P = Levy ⁡ ( D ) , Levy ⁡ ( D ) = 0.01 × \left|X_i(t)-X_{\text {Best }}(t)\right|, P=\operatorname{Levy}(D), \operatorname{Levy}(D)=0.01 \times Xi(t)XBest (t),P=Levy(D),Levy(D)=0.01 ×
μ × σ ∣ v ∣ 1 β , σ = ( Γ ( 1 + β ) × sin ⁡ ( π β 2 ) Γ ( 1 + β 2 ) × β × 2 ( β − 1 2 ) ) 1 β \frac{\mu \times \sigma}{|v|^{\frac{1}{\beta}}}, \sigma=\left(\frac{\Gamma(1+\beta)\times \sin \left(\frac{\pi \beta}{2}\right)}{\Gamma\left(\frac{1+\beta}{2}\right) \times \beta \times 2^{\left(\frac{\beta-1}{2}\right)}}\right)^{\frac{1}{\beta}}vb1μ×σ,p=(C (21 + b)×β×2(2b 1)C ( 1 + b ) × s i n (2p b))b1, where, r 6 r_6r6for
[0,1][0,1][0,1 ] random number,M = 2.5 kg M=2.5 \mathrm{~kg}M=2.5 kg  is the mass of Tang I,V el = 1.5 m / s V el=1.5 \mathrm{~m} / \mathrm{s}Well _ _=1.5 m / s  is the speed of the gannet,ccc is a constant, after many experiments,c = 0.2, β = 1.5, X Best ( t ) c=0.2, \beta=1.5, X_{\text {Best }}(t)c=0.2,b=1.5,XBest ( t ) refers to the best performing individual in the current population,μ \muµσ \sigmaσ[ 0 , 1 ] [0,1][0,1 ] random number within.

2. Experimental results

insert image description here

3. References

[1] Qi Huiling, Hu Hongping, Bai Yanping, etc. Prediction of COVID-19 Epidemic Based on Improved Gannet Algorithm Optimizing BP Neural Network [J/OL]. Journal of Shanxi University (Natural Science Edition): 1-10 [2023-07-23]. DOI: 10.13451/j.sxu.ns.2023025.

4.Matlab

5.python

Guess you like

Origin blog.csdn.net/u011835903/article/details/131881811