zl程序教程

您现在的位置是:首页 >  其他

当前栏目

[机器学习] 人工鱼群算法

2023-04-18 12:40:19 时间

转载于http://blog.csdn.net/wp_csdn/article/details/54577567

1、起源

  人工鱼群算法是李晓磊等人于2002年在动物群体智能行为研究的基础上提出的一种新型方盛优化算法,该算法根据水域中鱼生存数目最多的地方就是本水域中富含营养物质最多的地方这一特点来模拟鱼群的觅食行为而实现寻优。算法主要利用鱼的三大基本行为:觅食、聚群和追尾行为,采用自上而下的寻优模式从构造个体的底层行为开始,通过鱼群中各个体的局部寻优,达到全局最优值在群体中凸显出来的目的。

  该方法采用自下而上的寻优思路,首先设计单个个体的感知、行为机制,然后将一个或一群实体放置在环境中,让他们在环境的交互作用中解决问题。


2、生态学基础

  在一片水域中,鱼存在的数目最多的地方就是本水域富含营养物质最多的地方,依据这一特点来模仿鱼群的觅食、聚群、追尾等行为,从而实现全局最优,这就是鱼群算法的基本思想。鱼类活动中,觅食行为、群聚行为、追尾行为和随机行为与寻优命题的解决有较为密切的关系,如何利用简单有效的方式来构造和实现这些行为将是算法实现的主要为题。


3、人工鱼的结构模型

  人工鱼是真实鱼抽象化、虚拟化的一个实体,其中封装了自身数据和一系列行为,可以接受环境的刺激信息,做出相应的活动。其所在的环境由问题的解空间和其他人工鱼的状态,它在下一时刻的行为取决于自身的状态和环境的状态,并且它还通过自身的活动来影响环境,进而影响其他人工鱼的活动。

  人工鱼对外的感知是依靠视觉来实现的,人工鱼的模型中使用如下方法实现人工鱼的虚拟视觉:

<span style="display:inline-block; position:relative; width:12.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-2"><span class="msubsup" id="MathJax-Span-3"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-4" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">V=X+VisuanlRand()

<span style="display:inline-block; position:relative; width:17.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-24"><span class="msubsup" id="MathJax-Span-25"><span style="display:inline-block; position:relative; width:2.302em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-26" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">next=X+XVX||XVX||StepRand()

其中 <span style="display:inline-block; position:relative; width:3.202em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-74"><span class="mi" id="MathJax-Span-75" style="font-family:MathJax_Math-italic">Rand() 为随机函数,产生0到1之间的随机数, <span style="display:inline-block; position:relative; width:2.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-82"><span class="mi" id="MathJax-Span-83" style="font-family:MathJax_Math-italic">S<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">tep 为步长。

 

人工鱼视觉的概念
人工鱼视觉的概念

 

3.1、人工鱼中封装的变量和函数

变量部分:人工鱼的总数 <span style="display:inline-block; position:relative; width:0.903em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-88"><span class="mi" id="MathJax-Span-89" style="font-family:MathJax_Math-italic">N<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em"> 、人工鱼个体的状态 <span style="display:inline-block; position:relative; width:8.603em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-91"><span class="mi" id="MathJax-Span-92" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">=(x1,x2,...,xn) (其中 <span style="display:inline-block; position:relative; width:7.553em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-112"><span class="msubsup" id="MathJax-Span-113"><span style="display:inline-block; position:relative; width:0.903em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-114" style="font-family:MathJax_Math-italic">xi(i=1,2,...,n) 为寻优的变量)、人工鱼移动的最大步长 <span style="display:inline-block; position:relative; width:2.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-130"><span class="mi" id="MathJax-Span-131" style="font-family:MathJax_Math-italic">S<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">tep 、人工鱼的视野Visual、尝试次数 <span style="display:inline-block; position:relative; width:6.202em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-136"><span class="mi" id="MathJax-Span-137" style="font-family:MathJax_Math-italic">T<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">rynumber 、拥挤度因子 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-148"><span class="mi" id="MathJax-Span-149" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 、人工鱼个体 <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-151"><span class="mi" id="MathJax-Span-152" style="font-family:MathJax_Math-italic">i,j 之间的距离 <span style="display:inline-block; position:relative; width:6.053em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-156"><span class="msubsup" id="MathJax-Span-157"><span style="display:inline-block; position:relative; width:1.103em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-158" style="font-family:MathJax_Math-italic">d<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">ij=|xixj|
函数部分:人工鱼当前所在位置食物浓度表示为 <span style="display:inline-block; position:relative; width:4.053em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-178"><span class="mi" id="MathJax-Span-179" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">=f(x) <span style="display:inline-block; position:relative; width:0.802em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-186"><span class="mi" id="MathJax-Span-187" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em"> 为目标函数值)、人工鱼各种行为函数(觅食行为 <span style="display:inline-block; position:relative; width:2.952em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-189"><span class="mi" id="MathJax-Span-190" style="font-family:MathJax_Math-italic">P<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">rey() 、聚群行为 <span style="display:inline-block; position:relative; width:4.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-197"><span class="mi" id="MathJax-Span-198" style="font-family:MathJax_Math-italic">S<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">warm() 、追尾行为 <span style="display:inline-block; position:relative; width:3.802em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-206"><span class="mi" id="MathJax-Span-207" style="font-family:MathJax_Math-italic">F<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">ollow() 、随机行为 <span style="display:inline-block; position:relative; width:3.302em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-216"><span class="mi" id="MathJax-Span-217" style="font-family:MathJax_Math-italic">M<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">ove() 以及行为评价函数 <span style="display:inline-block; position:relative; width:4.803em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-224"><span class="mi" id="MathJax-Span-225" style="font-family:MathJax_Math-italic">E<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">valuate() )。

3.2、人工鱼的四种基本行为算法描述

3.2.1、觅食行为 <span style="display:inline-block; position:relative; width:2.943em; height:0px; font-size:125%"><span style="position:absolute; top:-2.734em; left:0.001em"><span class="mrow" id="MathJax-Span-236"><span class="mi" id="MathJax-Span-237" style="font-family:MathJax_Math-italic">P<span style="display:inline-block; overflow:hidden; height:1px; width:0.119em">rey()

  这是鱼趋向食物的一种活动,一般认为它是通过视觉或味觉来感知水中的食物量或食物浓度来选择行动的方向。设置人工鱼当前状态,并在其感知范围内随机选择另一个状态,如果得到的状态的目标函数大于当前的状态,则向新选择得到的状态靠近一步,反之,重新选取新状态,判断是否满足条件,选择次数达到一定数量后,如果仍然不满足条件,则随机移动一步。
算法描述:人工鱼 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-244"><span class="msubsup" id="MathJax-Span-245"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-246" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 在其视野内随机选择一个状态 <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-249"><span class="msubsup" id="MathJax-Span-250"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-251" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j

<span style="display:inline-block; position:relative; width:12.603em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-254"><span class="msubsup" id="MathJax-Span-255"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-256" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j=Xi+VisuanlRand()

分别计算 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-278"><span class="msubsup" id="MathJax-Span-279"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-280" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-283"><span class="msubsup" id="MathJax-Span-284"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-285" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j 的目标函数值 <span style="display:inline-block; position:relative; width:0.953em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-288"><span class="msubsup" id="MathJax-Span-289"><span style="display:inline-block; position:relative; width:0.953em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-290" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">i <span style="display:inline-block; position:relative; width:1.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-293"><span class="msubsup" id="MathJax-Span-294"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-295" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j ,如果发现 <span style="display:inline-block; position:relative; width:1.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-298"><span class="msubsup" id="MathJax-Span-299"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-300" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j <span style="display:inline-block; position:relative; width:0.953em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-303"><span class="msubsup" id="MathJax-Span-304"><span style="display:inline-block; position:relative; width:0.953em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-305" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">i 好,则 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-308"><span class="msubsup" id="MathJax-Span-309"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-310" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-313"><span class="msubsup" id="MathJax-Span-314"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-315" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j 的方向移动一部:
<span style="display:inline-block; position:relative; width:18.003em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-318"><span class="msubsup" id="MathJax-Span-319"><span style="display:inline-block; position:relative; width:2.152em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-320" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">t+1i=Xti+XjXti||XjXti||StepRand()

否则, <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-377"><span class="msubsup" id="MathJax-Span-378"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-379" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 继续在其视野内选择状态 <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-382"><span class="msubsup" id="MathJax-Span-383"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-384" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j ,判断是否满足前进条件,反复尝试 <span style="display:inline-block; position:relative; width:6.753em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-387"><span class="mi" id="MathJax-Span-388" style="font-family:MathJax_Math-italic">T<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">raynumber次后,仍没有满足前进条件,则执行随机行为。

 

3.2.2、聚群行为 <span style="display:inline-block; position:relative; width:4.001em; height:0px; font-size:125%"><span style="position:absolute; top:-2.734em; left:0.001em"><span class="mrow" id="MathJax-Span-400"><span class="mi" id="MathJax-Span-401" style="font-family:MathJax_Math-italic">S<span style="display:inline-block; overflow:hidden; height:1px; width:0.031em">warm()

  大量或少量的鱼聚集成群,进行集体觅食和躲避敌害,这是它们在进化过程中形成的一种生存方式。人工鱼探索当前邻居内的伙伴数量,并计算伙伴的中心位置,然后把新得到的中心位置的目标函数与当前位置的目标函数相比较,如果中心位置的目标函数优于当前位置的目标函数并且不是很拥挤,则当前位置向中心位置移动一步,否则执行觅食行为。鱼聚群时会遵守两条规则:一是尽量向邻近伙伴的中心移动,二是避免过分拥挤。
算法描述:人工鱼 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-409"><span class="msubsup" id="MathJax-Span-410"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-411" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 搜索当前视野内( <span style="display:inline-block; position:relative; width:6.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-414"><span class="msubsup" id="MathJax-Span-415"><span style="display:inline-block; position:relative; width:1.103em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-416" style="font-family:MathJax_Math-italic">d<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">ij<Vaisual )的伙伴数目 <span style="display:inline-block; position:relative; width:1.103em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-430"><span class="msubsup" id="MathJax-Span-431"><span style="display:inline-block; position:relative; width:1.103em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-432" style="font-family:MathJax_Math-italic">nf 和中心位置 <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-435"><span class="msubsup" id="MathJax-Span-436"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-437" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">c ,若 <span style="display:inline-block; position:relative; width:5.402em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-440"><span class="msubsup" id="MathJax-Span-441"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-442" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">c/nf>δYi ,则表明伙伴中心位置状态较优且不太拥挤,则 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-456"><span class="msubsup" id="MathJax-Span-457"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-458" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 朝伙伴的中心位置移动一步:

<span style="display:inline-block; position:relative; width:18.003em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-461"><span class="msubsup" id="MathJax-Span-462"><span style="display:inline-block; position:relative; width:2.152em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-463" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">t+1i=Xti+XcXti||XcXti||StepRand()

否则进行觅食行为。

 

3.2.3、追尾行为 <span style="display:inline-block; position:relative; width:3.825em; height:0px; font-size:125%"><span style="position:absolute; top:-2.734em; left:0.001em"><span class="mrow" id="MathJax-Span-520"><span class="mi" id="MathJax-Span-521" style="font-family:MathJax_Math-italic">F<span style="display:inline-block; overflow:hidden; height:1px; width:0.119em">ollow()

  当某一条鱼或几条鱼发现食物时,它们附近的鱼会尾随而来,导致更远处的鱼也会尾随过来。人工鱼探索周围邻居鱼的最优位置,当最优位置的目标函数值大于当前位置的目标函数值并且不是很拥挤,则当前位置向最优邻居鱼移动一步,否则执行觅食行为。
算法描述:人工鱼 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-530"><span class="msubsup" id="MathJax-Span-531"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-532" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 搜索当前视野内( <span style="display:inline-block; position:relative; width:6.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-535"><span class="msubsup" id="MathJax-Span-536"><span style="display:inline-block; position:relative; width:1.103em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-537" style="font-family:MathJax_Math-italic">d<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">ij<Vaisual )的伙伴中函数 <span style="display:inline-block; position:relative; width:1.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-551"><span class="msubsup" id="MathJax-Span-552"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-553" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j 最优伙伴 <span style="display:inline-block; position:relative; width:1.203em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-556"><span class="msubsup" id="MathJax-Span-557"><span style="display:inline-block; position:relative; width:1.203em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-558" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">j ,如果 <span style="display:inline-block; position:relative; width:5.402em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-561"><span class="msubsup" id="MathJax-Span-562"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-563" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j/nf>δYi ,表明最优伙伴的周围不太拥挤,则 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-577"><span class="msubsup" id="MathJax-Span-578"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-579" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 朝词伙伴移动一步:

<span style="display:inline-block; position:relative; width:18.053em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-582"><span class="msubsup" id="MathJax-Span-583"><span style="display:inline-block; position:relative; width:2.152em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-584" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">t+1i=Xji+XjXti||XjXti||StepRand()

否则执行觅食行为。

 

3.2.4、随机行为 <span style="display:inline-block; position:relative; width:3.266em; height:0px; font-size:125%"><span style="position:absolute; top:-2.734em; left:0.001em"><span class="mrow" id="MathJax-Span-641"><span class="mi" id="MathJax-Span-642" style="font-family:MathJax_Math-italic">M<span style="display:inline-block; overflow:hidden; height:1px; width:0.09em">ove()

  它是觅食行为的一个缺省行为,指人工鱼在视野内随机移动。当发现食物时,会向食物逐渐增多的方向快速的移动。
算法描述人工鱼 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-649"><span class="msubsup" id="MathJax-Span-650"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-651" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">i 随机移动一步,到达一个新的状态:

<span style="display:inline-block; position:relative; width:13.652em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-654"><span class="msubsup" id="MathJax-Span-655"><span style="display:inline-block; position:relative; width:2.152em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-656" style="font-family:MathJax_Math-italic">X<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">t+1i=Xti+VisuanlRand()

 


4、人工鱼群算法描述

公告牌是记录最优人工鱼个体状态的地方。每条人工鱼在执行完一次迭代后将自身当前状态与公告牌中记录的状态进行比较,如果优于公告牌中的状态则用自身状态更新公告牌中的状态,否则公告牌的状态不变。当整个算法的迭代结束后,公告牌的值就是最优解。
行为评价是用来反映鱼自主行为的一种方式,在解决优化问题时选用两种方式评价:一种是选择最优行为执行;另一种是选择较优方向。对于解决极大值问题,可以使用试探法,即模拟执行群聚、追尾等行为,然后评价行动后的值选择最优的来执行,缺省的行为为觅食行为。
迭代终止条件:通常的方法是判断连续多次所得值得均方差小鱼允许的误差;或判断聚集于某个区域的人工鱼的数目达到某个比例;或连续多次所得的均值不超过已寻找的极值;或限制最大迭代次数。若满足终止条件,则输出公告牌的最优记录;否则继续迭代。
人工鱼群算法的步骤

  1. 初始化设置,包括种群规模 <span style="display:inline-block; position:relative; width:0.903em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-684"><span class="mi" id="MathJax-Span-685" style="font-family:MathJax_Math-italic">N<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em"> 、没条人工鱼的初始位置、人工鱼的视野 <span style="display:inline-block; position:relative; width:3.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-687"><span class="mi" id="MathJax-Span-688" style="font-family:MathJax_Math-italic">V<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">isual 、步长 <span style="display:inline-block; position:relative; width:1.802em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-695"><span class="mi" id="MathJax-Span-696" style="font-family:MathJax_Math-italic">step 、拥挤度因子 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-701"><span class="mi" id="MathJax-Span-702" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 、重复次数 <span style="display:inline-block; position:relative; width:6.202em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-704"><span class="mi" id="MathJax-Span-705" style="font-family:MathJax_Math-italic">T<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">rynumber
  2. 计算初始鱼群各个体的适应值,取最优人工鱼状态及其值赋予给公告牌;
  3. 对每个个体进行评价,对其要执行的行为进行选择,包括觅食、聚群、追尾和随机行为;
  4. 执行人工鱼的行为,更新自己,生成新鱼群;
  5. 评价所有个体。若某个体优于公告牌,则将公告牌更新为该个体;
  6. 当公告牌上最优解达到满意误差界内或者达到迭代次数上限时算法结束,否则转步骤3。

5、人工鱼群算法的寻优原理

  人工鱼群算法在寻优的过程中,可能会集结在几个局部最优解的周围,使人工鱼跳出局部最优解,实现全局寻优的因素主要有:

  • 觅食行为中重复次数较少时,为人工鱼提供了随机移动的机会,从而可能跳出局部最优解;
  • 随机步长使得人工鱼在前往局部最优解的途中,有可能转向全局最优解;
  • 拥挤度因子 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-716"><span class="mi" id="MathJax-Span-717" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 限制了聚群的规模,使得人工鱼能够更广泛的寻优;
  • 聚群行为能够促使少出陷于局部最优解的人工鱼趋向全局最优解的人工鱼方向聚集,从而逃出局部最优解;
  • 追尾行为加快了人工鱼向更优状态游动。

6、参数设置与性能

6.1、收敛基础

  人工鱼群算法中,觅食行为奠定了算法收敛的基础;聚群行为增强了算法收敛的稳定性;追尾行为增强了算法收敛的快速性和全局性;其评价行为也对算法收敛的速度和稳定性提供了保障。

6.2、各种参数对收敛性的影响

  人工鱼群算法有5个基本参数:群规模 <span style="display:inline-block; position:relative; width:0.903em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-719"><span class="mi" id="MathJax-Span-720" style="font-family:MathJax_Math-italic">N<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em"> 、人工鱼的视野 <span style="display:inline-block; position:relative; width:3.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-722"><span class="mi" id="MathJax-Span-723" style="font-family:MathJax_Math-italic">V<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">isual 、步长 <span style="display:inline-block; position:relative; width:1.802em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-730"><span class="mi" id="MathJax-Span-731" style="font-family:MathJax_Math-italic">step 、拥挤度因子 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-736"><span class="mi" id="MathJax-Span-737" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 、重复次数 <span style="display:inline-block; position:relative; width:6.202em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-739"><span class="mi" id="MathJax-Span-740" style="font-family:MathJax_Math-italic">T<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">rynumber
1. 视野 <span style="display:inline-block; position:relative; width:3.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-751"><span class="mi" id="MathJax-Span-752" style="font-family:MathJax_Math-italic">V<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">isual :由于视野对算法中个行为都有较大影响,因此,它的变化对收敛性能影响也比较复杂。当视野范围较小时,人工鱼的觅食行为和随机行为比较突出;视野范围较大时,人工鱼的追尾行为和聚群行为将变得比较突出,相应的算法的复杂度也会有所上升。总的来说:视野越大,越容易使人工鱼发现全局最优解并收敛。
2. 步长 <span style="display:inline-block; position:relative; width:1.802em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-759"><span class="mi" id="MathJax-Span-760" style="font-family:MathJax_Math-italic">step :对于固定步长,随着步长的增加,收敛的速度得到了一定的加速,但在超过一定的范围后,有使得收敛速度减缓,步长过大时会出现震荡现象而大大影响收敛速度。采用随机步长的方式在一定程度上防止了震荡现象的发生,并使得该参数的敏感度大大降低了,但最快的收敛速度还是最优固定步长的收敛速度,所以,对于特定的优化问题,我们可以考虑采用合适的固定步长或者变尺度方法来提高收敛速度。
3. 群规模 <span style="display:inline-block; position:relative; width:0.903em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-765"><span class="mi" id="MathJax-Span-766" style="font-family:MathJax_Math-italic">N<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em"> :人工鱼的数目越多,跳出局部最优解的能力越强,同时,收敛的速度也越快。当然,付出的代价就是算法每次迭代的计算量也越大,因此,在使用过程中,满足稳定收敛的前提下,应当尽可能的减少个图数目。
4. 尝试次数 <span style="display:inline-block; position:relative; width:6.202em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-768"><span class="mi" id="MathJax-Span-769" style="font-family:MathJax_Math-italic">T<span style="display:inline-block; overflow:hidden; height:1px; width:0.102em">rynumber :尝试次数越多,人工鱼的觅食行为能力越强,收敛的效率也越高。在局部极值突出的情况下,应该适当的减少以增加人工鱼随机游动的概率,克服局部最优解。
5. 拥挤度因子 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-780"><span class="mi" id="MathJax-Span-781" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> :在求极大值问题中, <span style="display:inline-block; position:relative; width:10.703em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-783"><span class="mi" id="MathJax-Span-784" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">=1/(αnmax),α(0,1] ;在求极小值问题中, <span style="display:inline-block; position:relative; width:8.953em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-809"><span class="mi" id="MathJax-Span-810" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">=αnmax,α(0,1] 。其中 <span style="display:inline-block; position:relative; width:0.653em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-829"><span class="mi" id="MathJax-Span-830" style="font-family:MathJax_Math-italic">α 为极值接近水平, <span style="display:inline-block; position:relative; width:2.052em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-832"><span class="msubsup" id="MathJax-Span-833"><span style="display:inline-block; position:relative; width:2.052em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-834" style="font-family:MathJax_Math-italic">nmax 为期望在该邻域内聚集的最大人工鱼数目。拥挤度因子与 <span style="display:inline-block; position:relative; width:1.103em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-841"><span class="msubsup" id="MathJax-Span-842"><span style="display:inline-block; position:relative; width:1.103em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-843" style="font-family:MathJax_Math-italic">nf 相结合,通过人工鱼是否执行追尾和聚群行为对优化结果产生影响。以极大值为例(极小值的情况正好与极大值相反), <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-846"><span class="mi" id="MathJax-Span-847" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 越大,表明允许的拥挤程度越小,人工鱼摆脱局部最优解的能力越强;但是收敛速度会有所减缓,这主要因为人工鱼在逼近最优解的同时,会因避免过分拥挤而随机走开或者受其他人工鱼的排斥作用,不能精确逼近极值点。可见,虽然 <span style="display:inline-block; position:relative; width:0.453em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-849"><span class="mi" id="MathJax-Span-850" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em"> 的引入避免了人工鱼过度拥挤而陷入局部最优解,但是另一方面,该参数会使得位于极值点附件的人工鱼之间存在相互排斥的影响,而难以想极值点精确逼近。所以,对于某些局部极值不是很严重的具体问题,可以忽略拥挤的因素,从而在简化算法的同时也加快算法的收敛速度和提高结果的精确程度。


对追尾行为的描述
对追尾行为的描述

上图中,人工鱼 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-852"><span class="msubsup" id="MathJax-Span-853"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-854" style="font-family:MathJax_Math-italic">af0 为人工鱼 <span style="display:inline-block; position:relative; width:2.302em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-860"><span class="msubsup" id="MathJax-Span-861"><span style="display:inline-block; position:relative; width:2.302em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-862" style="font-family:MathJax_Math-italic">af15 在各自视野内的最优人工鱼,其食物浓度为 <span style="display:inline-block; position:relative; width:1.002em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-870"><span class="msubsup" id="MathJax-Span-871"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-872" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-875"><span class="msubsup" id="MathJax-Span-876"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-877" style="font-family:MathJax_Math-italic">C<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">1 为以 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-880"><span class="msubsup" id="MathJax-Span-881"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-882" style="font-family:MathJax_Math-italic">af0 为圆心,以视野为半径的圆,即能探知 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-888"><span class="msubsup" id="MathJax-Span-889"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-890" style="font-family:MathJax_Math-italic">af0 的最远距离,人工鱼越靠近 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-896"><span class="msubsup" id="MathJax-Span-897"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-898" style="font-family:MathJax_Math-italic">af0 ,状态越优。在极大值情况下:当 <span style="display:inline-block; position:relative; width:3.452em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-904"><span class="mi" id="MathJax-Span-905" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">nf1 时,所有人工鱼 <span style="display:inline-block; position:relative; width:2.302em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-912"><span class="msubsup" id="MathJax-Span-913"><span style="display:inline-block; position:relative; width:2.302em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-914" style="font-family:MathJax_Math-italic">af15 都执行追尾行为,向 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-922"><span class="msubsup" id="MathJax-Span-923"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-924" style="font-family:MathJax_Math-italic">af0 移动;当 <span style="display:inline-block; position:relative; width:3.452em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-930"><span class="mi" id="MathJax-Span-931" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">nf>1 时,若 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-938"><span class="msubsup" id="MathJax-Span-939"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-940" style="font-family:MathJax_Math-italic">C<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">2 的食物浓度为 <span style="display:inline-block; position:relative; width:3.052em; height:0px; font-size:125%"><span style="position:absolute; top:-2.698em; left:0.003em"><span class="mrow" id="MathJax-Span-943"><span class="msubsup" id="MathJax-Span-944"><span style="display:inline-block; position:relative; width:1.002em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-945" style="font-family:MathJax_Math-italic">Y<span style="display:inline-block; overflow:hidden; height:1px; width:0.202em">j/δnf 的等浓度食物圈,则 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-955"><span class="msubsup" id="MathJax-Span-956"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-957" style="font-family:MathJax_Math-italic">C<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">2 <span style="display:inline-block; position:relative; width:1.153em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-960"><span class="msubsup" id="MathJax-Span-961"><span style="display:inline-block; position:relative; width:1.153em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-962" style="font-family:MathJax_Math-italic">C<span style="display:inline-block; overflow:hidden; height:1px; width:0.053em">1 之间的人工鱼 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-965"><span class="msubsup" id="MathJax-Span-966"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-967" style="font-family:MathJax_Math-italic">af1 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-973"><span class="msubsup" id="MathJax-Span-974"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-975" style="font-family:MathJax_Math-italic">af2 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-981"><span class="msubsup" id="MathJax-Span-982"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-983" style="font-family:MathJax_Math-italic">af3 执行追尾行为,向 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-989"><span class="msubsup" id="MathJax-Span-990"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-991" style="font-family:MathJax_Math-italic">af0 移动,人工鱼 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-997"><span class="msubsup" id="MathJax-Span-998"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-999" style="font-family:MathJax_Math-italic">af4 <span style="display:inline-block; position:relative; width:1.403em; height:0px; font-size:125%"><span style="position:absolute; top:-2.298em; left:0.003em"><span class="mrow" id="MathJax-Span-1005"><span class="msubsup" id="MathJax-Span-1006"><span style="display:inline-block; position:relative; width:1.403em; height:0px"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mi" id="MathJax-Span-1007" style="font-family:MathJax_Math-italic">af5 执行觅食行为。此时 <span style="display:inline-block; position:relative; width:1.552em; height:0px; font-size:125%"><span style="position:absolute; top:-2.548em; left:0.003em"><span class="mrow" id="MathJax-Span-1013"><span class="mi" id="MathJax-Span-1014" style="font-family:MathJax_Math-italic">δ<span style="display:inline-block; overflow:hidden; height:1px; width:0.003em">nf越大,执行追尾行为的人工鱼越少,反之越多。

 


7、人工鱼群算法的特点

  1. 只需比较目标函数值,对目标函数的性质要求不高;
  2. 对初值的要求不高,随机产生或设置为固定值均可,鲁棒性强;
  3. 对参数设定的要求不高,容许范围大;
  4. 收敛速度较慢,但是具备并行处理能力;
  5. 具备较好的全局寻优能力,能快速跳出局部最优点;
  6. 对于一些精读要求不高的场合,可以用它快速得到一个可行解;
  7. 不需要问题的严格机理模型,甚至不需要问题的精确描述,这使得它的应用范围得以延伸。