智能优化算法:跳蛛优化算法
摘要:跳蛛优化算法(Jumping Spider Optimization Algorithm,JSOA)是于2021年提出的一种新型智能优化算法,该算法通过模拟跳蛛的狩猎行为来达到寻优的目的,具有收敛速度快,寻优能力强的特点。
1.算法原理
跳蛛狩猎行为包括:迫害,跳上猎物,搜索猎物,信息素。
1.1 迫害
迫害当蜘蛛不在可以跳跃捕捉猎物的距离内时,它会通过做一些隐秘的动作靠近,直到达到可以跳跃捕捉猎物的距离。迫害策略可以用匀速直线运动来表示,见等式(1)
x
i
=
1
2
a
t
2
+
v
o
t
(1)
x_{i}=\frac{1}{2} a t^{2}+v_{o} t\tag{1}
xi=21at2+vot(1)
其中
x
i
x_i
xi为跟随蜘蛛的位置,
t
t
t是时间,
v
0
v_0
v0是初始速度,a是加速度,
a
=
v
t
a=\frac{v}{t}
a=tv,其中
v
=
x
−
x
0
v=x-x0
v=x−x0。
对于优化算法,每次迭代可以认为为一段时间,设置每次迭代时间为1,初始速度设置为0。因此式(1)可以改写成:
x
i
(
g
+
1
)
=
1
2
(
x
i
→
(
g
)
−
x
⃗
r
(
g
)
)
(2)
x_{i}(g+1)=\frac{1}{2}\left(\overrightarrow{x_{i}}(g)-\vec{x}_{r}(g)\right) \tag{2}
xi(g+1)=21(xi(g)−xr(g))(2)
其中
x
i
(
g
+
1
)
x_i(g+1)
xi(g+1)代表个体迭代后的新位置,
x
i
(
g
)
x_i(g)
xi(g)代表个体当前位置,
x
r
(
g
)
x_r(g)
xr(g)为随机选择个体的位置
1.2 跳上猎物
跳蛛跟着猎物向它扑去。跳蛛的狩猎策略向猎物跳跃可以表示为抛射运动:
x
i
→
(
g
+
1
)
=
x
⃗
i
(
g
)
tan
(
α
)
−
g
x
⃗
i
2
(
g
)
2
V
o
2
cos
2
(
α
)
α
=
ϕ
π
180
(3)
\begin{array}{l} \overrightarrow{x_{i}}(g+1)=\vec{x}_{i}(g) \tan (\alpha)-\frac{g \vec{x}_{i}^{2}(g)}{2 V_{o}^{2} \cos ^{2}(\alpha)} \\ \alpha=\frac{\phi \pi}{180} \end{array} \tag{3}
xi(g+1)=xi(g)tan(α)−2Vo2cos2(α)gxi2(g)α=180ϕπ(3)
其中
x
i
(
g
+
1
)
x_i(g+1)
xi(g+1)代表个体迭代后的新位置,
x
i
(
g
)
x_i(g)
xi(g)代表个体当前位置,
V
0
V_0
V0设置为
100
m
m
/
s
e
g
100mm/seg
100mm/seg,
g
g
g是重力加速度(
9.80665
m
/
s
2
9.80665m/s^2
9.80665m/s2),
ϕ
\phi
ϕ是0到1之间随机数。
1.3 搜索猎物
跳蛛在周围环境中进行随机搜索,以找到猎物。本文提出了两个数学函数:局部搜索和全局搜索,用于该模型的建模搜索。
局部搜索:
x
i
→
(
g
+
1
)
=
x
best
→
(
g
)
+
w
a
l
k
(
1
2
−
ε
)
(4)
\overrightarrow{x_{i}}(g+1)=\overrightarrow{x_{\text {best }}}(g)+w a l k\left(\frac{1}{2}-\varepsilon\right) \tag{4}
xi(g+1)=xbest (g)+walk(21−ε)(4)
其中
x
i
(
g
+
1
)
x_i(g+1)
xi(g+1)代表个体迭代后的新位置,
x
best
→
(
g
)
\overrightarrow{x_{\text {best }}}(g)
xbest (g)是最优个体,walk是(-2,2)之间的均匀随机数。
ε
\varepsilon
ε是(0,1)之间的随机数。
全局搜索:
x
i
→
(
g
+
1
)
=
x
best
→
(
g
)
+
(
x
best
→
(
g
)
−
x
worst
→
(
g
)
)
λ
(5)
\overrightarrow{x_{i}}(g+1)=\overrightarrow{x_{\text {best }}}(g)+\left(\overrightarrow{x_{\text {best }}}(g)-\overrightarrow{x_{\text {worst }}}(g)\right) \lambda \tag{5}
xi(g+1)=xbest (g)+(xbest (g)−xworst (g))λ(5)
其中
x
i
(
g
+
1
)
x_i(g+1)
xi(g+1)代表个体迭代后的新位置,
x
best
→
(
g
)
\overrightarrow{x_{\text {best }}}(g)
xbest (g)是最优个体,
x
worst
→
(
g
)
\overrightarrow{x_{\text {worst}}}(g)
xworst(g)是最差个体,$\lambda $是[0,1]之间的柯西随机数。
1.4 信息素
信息素是由个体产生并分泌到外部的化学物质,它们是同一物种的其他个体感知的嗅觉,它们引起行为改变。蜘蛛信息素在求偶交配中,起着显著的作用,信息素计算如下:
pheromone
(
i
)
=
Fitness
max
−
Fitness
(
i
)
Fitness
max
−
Fitness
min
(6)
\text { pheromone }(i)=\frac{\text { Fitness }_{\max }-\text { Fitness }(i)}{\text { Fitness }_{\max }-\text { Fitness }_{\min }} \tag{6}
pheromone (i)= Fitness max− Fitness min Fitness max− Fitness (i)(6)
其中
pheromone
(
i
)
\text { pheromone }(i)
pheromone (i)为个体i的信息素,
Fitness
max
\text { Fitness }_{\max }
Fitness max为最大适应度值,
Fitness
min
\text { Fitness }_{\min}
Fitness min为最小适应度值,
Fitness
(
i
)
\text { Fitness }(i)
Fitness (i)为当前个体适应度值。
当个体的信息素
≤
0.3
\leq 0.3
≤0.3时采用下式进行更新:
x
i
→
(
g
)
=
x
⃗
best
(
g
)
+
1
2
(
x
r
1
→
(
g
)
−
(
−
1
)
σ
x
r
2
→
(
g
)
)
(7)
\overrightarrow{x_{i}}(g)=\vec{x}_{\text {best }}(g)+\frac{1}{2}\left(\overrightarrow{x_{r_{1}}}(g)-(-1)^{\sigma} \overrightarrow{x_{r_{2}}}(g)\right) \tag{7}
xi(g)=xbest (g)+21(xr1(g)−(−1)σxr2(g))(7)
其中
x
i
(
g
)
x_i(g)
xi(g)是搜索个体位置,
x
⃗
best
\vec{x}_{\text {best }}
xbest 是最优个体位置,
x
r
1
→
,
x
r
2
→
\overrightarrow{x_{r_{1}}},\overrightarrow{x_{r_{2}}}
xr1,xr2是随机选择的两个不相同的个体。
σ
∈
{
0
,
1
}
\sigma\in\{0,1\}
σ∈{0,1}
算法伪代码如下:
1: Procedure JSOA
2: Generate the initial population randomly (A set of spiders, search agents)
3: while iteration < Max Number of Iterations do
4: if random < 0.5 then Attack or Search?
5: if random < 0.5 then
6: Strategy 1: Attack by persecution, Equation (2)
7: Else
8: Strategy 2: Attack by jumping on the prey, Equation (3)
9: End if
10: else
11: if random < 0.5 then
12: Strategy 3: Search for prey by local search, Equation (4).
13: else
14: Strategy 3: Search for prey by global search, Equation (5).
15: end if
16: end if
17: Update search agents that have low pheromone rate (computed by Equations (9) and (10)).
See Algorithm 1.
18: Calculate x new , the fitness value of the search agents
19: if x new < x ∗ then
20: x ∗ = x new
21: end if
22: Iteration = Iteration + 1
23: end while
24: Display x ∗ , the best optimal solution
25: End procedur
2.实验结果
3.参考文献
[1] Morales-Cepeda A B . A Bio-Inspired Method for Mathematical Optimization Inspired by Arachnida Salticidade[J]. Mathematics, 2021, 10.