智能优化算法:海洋捕食者算法
摘要:海洋捕食者算法 ( Marine Predators Algorithm,MPA) 是Afshin Faramarzi 等人于 2020 年提出的一种新型元启发式优化算法,其灵感来源于海洋适者生存理论,即海洋捕食者通过在Lévy 游走或布朗游走之间选择最佳觅食策略。具有寻优能力强等特点。
1.算法原理
MPA 优化过程数学描述如下:
(1)初始化阶段。与大多数元启发式算法类似,MPA 随机在搜索空间范围内初始化猎物位置来启动优化过程。数学描述如下:
X
0
=
X
m
i
n
+
r
a
n
d
(
X
m
a
x
−
X
m
i
n
)
(1)
X_0 = X_{min}+rand(X_{max}-X_{min})\tag{1}
X0=Xmin+rand(Xmax−Xmin)(1)
式中:
X
m
a
x
X_{max}
Xmax 、
X
m
i
n
X_{min}
Xmin 为搜索空间范围;
r
a
n
d
(
)
rand( )
rand()为[0,1]内的随机数。
(2) MPA 优化阶段。在迭代初期,当捕食者速度比猎物速度快时,基于勘探策略的 MPA 优化过程数学描述如下:
{
s
t
e
p
s
i
z
e
i
=
R
B
⨂
(
E
l
i
t
e
i
−
R
B
⨂
P
r
e
y
i
)
P
r
e
y
i
=
P
r
e
y
i
+
P
.
R
⨂
s
t
e
p
s
i
z
e
i
i
=
1
,
2
,
.
.
.
,
n
.
I
t
e
r
<
1
3
M
a
x
_
I
t
e
r
(2)
\begin{cases} stepsize_i = R_B \bigotimes(Elite_i-R_B\bigotimes Prey_i)\\ Prey_i=Prey_i+P.R\bigotimes stepsize_i \end{cases} i=1,2,...,n. Iter<\frac{1}{3}Max\_Iter \tag{2}
{stepsizei=RB⨂(Elitei−RB⨂Preyi)Preyi=Preyi+P.R⨂stepsizeii=1,2,...,n.Iter<31Max_Iter(2)
式中:
s
t
e
p
s
i
z
e
stepsize
stepsize 为移动步长;
R
B
R_B
RB 为呈正态分布的布朗游走随机向量;
E
l
i
t
e
i
Elite_i
Elitei 为由顶级捕食者构造的精英矩阵;
P
r
e
y
i
Prey_i
Preyi为与精英矩阵具有相同维数的猎物矩阵;
⨂
\bigotimes
⨂为逐项乘法运算符;
P
P
P等于 0.5;
R
R
R为[0,1]内均匀随机向量;
n
n
n 为种群规模;
I
t
e
r
Iter
Iter、
M
a
x
_
I
t
e
r
Max\_Iter
Max_Iter 分别为当前和最大迭代次数。
在迭代中期,当捕食者与猎物速度相同时,猎物基于 Lévy游走策略负责开发;捕食者基于布朗游走策略负责勘探,并逐渐由勘探策略转向开发策略。开发和勘探的数学描述如下:
{
s
t
e
p
s
i
z
e
i
=
R
L
⨂
(
E
l
i
t
e
i
−
R
L
⨂
P
r
e
y
i
)
P
r
e
y
i
=
P
r
e
y
i
+
P
.
R
⨂
s
t
e
p
s
i
z
e
i
i
=
1
,
2
,
.
.
.
,
n
/
2.
1
3
M
a
x
_
I
t
e
r
<
I
t
e
r
<
2
3
M
a
x
_
I
t
e
r
(3)
\begin{cases} stepsize_i = R_L \bigotimes(Elite_i-R_L\bigotimes Prey_i)\\ Prey_i=Prey_i+P.R\bigotimes stepsize_i \end{cases} i=1,2,...,n/2. \frac{1}{3}Max\_Iter<Iter<\frac{2}{3}Max\_Iter \tag{3}
{stepsizei=RL⨂(Elitei−RL⨂Preyi)Preyi=Preyi+P.R⨂stepsizeii=1,2,...,n/2.31Max_Iter<Iter<32Max_Iter(3)
{ s t e p s i z e i = R B ⨂ ( R B ⨂ P r e y i − E l i t e i ) P r e y i = E l i t e i + P . C F ⨂ s t e p s i z e i i = n / 2 , . . . , n . 1 3 M a x _ I t e r < I t e r < 2 3 M a x _ I t e r (4) \begin{cases} stepsize_i = R_B \bigotimes(R_B\bigotimes Prey_i - Elite_i)\\ Prey_i=Elite_i + P.CF\bigotimes stepsize_i \end{cases} i=n/2,...,n. \frac{1}{3}Max\_Iter<Iter<\frac{2}{3}Max\_Iter \tag{4} {stepsizei=RB⨂(RB⨂Preyi−Elitei)Preyi=Elitei+P.CF⨂stepsizeii=n/2,...,n.31Max_Iter<Iter<32Max_Iter(4)
式中: R L R_L RL 为 呈 Lévy 分 布 的 随 机 向 量; C F = ( 1 − I t e r / M a x _ I t e r ) ( 2 I t e r / M a x _ I t e r ) CF = (1-Iter/Max\_Iter)^{(2Iter/Max\_Iter)} CF=(1−Iter/Max_Iter)(2Iter/Max_Iter),为控制捕食者移动步长的自适应参数;其他参数意义同上。
在迭代终期,当捕食者速度比猎物速度慢时,捕食者基于Lévy 游走采用开发策略。其数学描述如下:
{
s
t
e
p
s
i
z
e
i
=
R
L
⨂
(
E
l
i
t
e
i
−
R
L
⨂
P
r
e
y
i
)
P
r
e
y
i
=
P
r
e
y
i
+
P
.
C
F
⨂
s
t
e
p
s
i
z
e
i
i
=
1
,
2
,
.
.
.
,
n
.
I
t
e
r
>
2
3
M
a
x
_
I
t
e
r
(5)
\begin{cases} stepsize_i = R_L \bigotimes(Elite_i-R_L\bigotimes Prey_i)\\ Prey_i=Prey_i+P.CF\bigotimes stepsize_i \end{cases} i=1,2,...,n. Iter>\frac{2}{3}Max\_Iter \tag{5}
{stepsizei=RL⨂(Elitei−RL⨂Preyi)Preyi=Preyi+P.CF⨂stepsizeii=1,2,...,n.Iter>32Max_Iter(5)
式中:其他参数意义同上。
(3)FADs 效应或涡流。鱼类聚集装置(FADs)或涡流效应通常改变海洋捕食者觅食行为,这一策略能使 MPA 在寻优过程中克服早熟收敛问题,逃离局部极值。其数学描述如下:
{
P
r
e
y
i
=
P
r
e
y
i
+
C
F
[
X
m
i
n
+
R
L
⨂
(
X
m
a
x
−
X
m
i
n
)
]
⨂
U
r
≤
F
A
D
s
P
r
e
y
i
+
[
F
A
D
s
(
1
−
r
)
+
r
]
(
P
r
e
y
r
1
−
P
r
e
y
r
2
)
r
>
F
A
D
s
(6)
\begin{cases} Prey_i = Prey_i+CF[X_{min}+R_L\bigotimes(X_{max}-X_{min})]\bigotimes U\ r\leq FADs \\ Prey_i+[FADs(1-r)+r](Prey_{r1}-Prey_{r2})\ r>FADs \end{cases} \tag{6}
{Preyi=Preyi+CF[Xmin+RL⨂(Xmax−Xmin)]⨂U r≤FADsPreyi+[FADs(1−r)+r](Preyr1−Preyr2) r>FADs(6)
式中:FADs为影响概率,取 0.2;
U
U
U为二进制向量;
r
r
r 为[0,1]内随机数;
r
1
r_1
r1、
r
2
r_2
r2 分别为猎物矩阵的随机索引。
算法流程:
步骤1:设定算法参数,初始化种群。
步骤2:计算适应度值,记录最优位置
步骤3:捕食者根据迭代阶段,从式(2)-(6)中选择对应的更新方式,更新捕食者位置
步骤4:计算适应度值,更新最优位置
步骤5:判断是否满足停止条件,如果不满足则重复步骤3-5,否则输出算法最优结果。
2.实验结果
3.参考文献
[1]胡顺强,崔东文.基于海洋捕食者算法优化的长短期记忆神经网络径流预测[J].中国农村水利水电,2021(02):78-82+90.
4.Matlab代码
算法相关应用
改进算法matlab代码
名称 | 说明或者参考文献 |
---|---|
多子群改进的海洋捕食者算法(MSMPA) | [1]张磊,刘升,高文欣,郭雨鑫.多子群改进的海洋捕食者算法[J/OL].微电子学与计算机:1-9[2021-11-01].https://doi.org/10.19304/J.ISSN1000-7180.2021.0062. |
融合混沌对立和分组学习的海洋捕食者算法(MSIMAP) | [1]马驰,曾国辉,黄勃,刘瑾.融合混沌对立和分组学习的海洋捕食者算法[J/OL].计算机工程与应用:1-14[2021-11-02].http://kns.cnki.net/kcms/detail/11.2127.TP.20210730.1554.011.html. |
算法相关应用
名称 | 说明或者参考文献 |
---|---|
基于海洋捕食者算法的无线传感器网(WSN)覆盖优化 | https://blog.csdn.net/u011835903/article/details/109262039(原理一样,只是优化算法用海洋捕食者算法) |
个人资料介绍