当前位置: 首页 > news >正文

莱芜区都市网莱芜杂谈seo推广思路

莱芜区都市网莱芜杂谈,seo推广思路,宁夏网站建设品牌公司,wordpress文本编辑器目录 1 算法简介 2 算法数学模型 2.1.全局探索阶段 2.2 过渡阶段 2.3.局部开采阶段 3 求解步骤与程序框图 3.1 步骤 3.2 程序框图 4 matlab代码及结果 4.1 代码 4.2 结果 1 算法简介 哈里斯鹰算法(Harris Hawks Optimization,HHO),是由Ali As…

目录

1 算法简介

2 算法数学模型

2.1.全局探索阶段

2.2 过渡阶段

2.3.局部开采阶段

3 求解步骤与程序框图

3.1 步骤

3.2 程序框图

4 matlab代码及结果

4.1 代码

4.2 结果


1 算法简介

哈里斯鹰算法(Harris Hawks Optimization,HHO),是由Ali Asghar Heidari和Seyedali Mrjaili于2019年提出的一种新型仿生智能优化算法。该算法模仿哈里斯鹰捕食特点,结合Levy飞行(Levy Flights)实现对复杂多维问题求解。研究表明该新型算法具有良好的性能。在HHO中,哈里斯鹰是候选解,猎物随迭代逼近最优解.HHO算法包括两个阶段:全局探索阶段、局部开采阶段.

2 算法数学模型

2.1.全局探索阶段

在这一阶段中,哈里斯鹰处于等待状态。仔细检查和监控搜索空间[b , ub]以发现猎物。根据两种策略在随机的地方寻找猎物,迭代时以概率q进行位置更新。数学表达式如下:

式中,

编辑分别为哈里斯鹰第t+1次和第t次迭代时的位置,Xrabbit,t表示猎物第t次迭代时的位置,q和r1,r2,r3,r4是区间(0,1)内的随机数字,lb是搜索空间的下界,ub是搜索空间的上界,Xrand,t表示第t次迭代时哈里斯鹰的随机位置,Xm,t表示第t次迭代时哈里斯鹰的平均位置,公式如下:

2.2 过渡阶段

该阶段用于保持探索和开采之间适当的平衡。HHO通过猎物的能量方程实现从探索到开采的过渡。

式中,E表示猎物逃跑的能量,

是猎物能量的初始状态,公式为E0= 2*rand - 1,rand是(0,1)之间的随机数字,T为最大迭代次数,t为当前迭代次数.当E≥1时,哈里斯鹰算法将执行全局探索;否则,HHO算法进入局部开采。

2.3.局部开采阶段

根据猎物的逃跑行为和哈里斯鹰的追逐策略,HHO算法提出了四种可能的策略来模拟攻击行为.用N表示猎物成功逃脱的概率。

(1)软围攻.当E≥0.5,A≥0.5时,猎物有足够的能量且以跳跃的方式逃脱围捕,而哈里斯鹰会逐渐消耗猎物的能量,然后选择最佳的位置突袭俯冲逮捕猎物.更新位置的方程如下:

式中,Xt是迭代时猎物与哈里斯鹰的位置之差,J=2(1-r5)表示猎物逃跑过程中的随机跳跃,r5是介于0到1之间的随机数字.

(2)硬围攻.当E<0.5,入≥0.5时,猎物筋疲力尽,哈里斯鹰选择迅速突袭.位置更新如下:

(3)累速俯冲式软围攻.当E>0.5,入<0.5时,猎物有足够的能量E逃跑,哈里斯鹰在突袭之前会建立一个软围攻.为了模拟猎物的逃跑模式和跳跃动作,将levy函数LF集成在HHO算法中.更新位置的策略为:

式中,D为问题维度,S为D维随机行向量.

(4)累速俯冲式硬围攻.当E<0.5,入<0.5时,猎物能量E低,哈里斯鹰在突袭前构建硬围攻捕捉猎物,位置更新如:

Levy飞行函数公式如下:

式中,u、v是(0,1)之间的随机数,β取常值1.5。

HHO算法用猎物能量E和因子入调节哈里斯鹰和猎物(兔子)之间的四种围捕机制,来实现优化求解问题.

3 求解步骤与程序框图

3.1 步骤

HHO算法的规则描述如下:
1)每次迭代前,判断是否越界并调整,更新猎物位置与适应度值;
2)在搜索阶段,哈里斯鹰拥有两种不同搜索方式,分别针对发现和未发现猎物;
3)野兔的逃逸能量会随着迭代次数增加而自适应减小;
4)当野兔能量降低到某一阈值,将被哈里斯鹰群发现,狩猎从搜索阶段转为围捕突袭阶段;
5)每一次突袭前,兔子都有一定的概率从包围中逃脱;
6)针对兔子的体力,以及是否逃脱包围圈,哈里斯鹰有四种不同的围捕策略;
7)每次围捕最终兔子将会捕获,每次迭代会产生一个新的猎物,该位置将由新一代种群中适应度值最优者占据。
实现步骤
Step1:初始化种群:包括搜索空间的上限和下限,算法的最大迭代次数T。随机初始化种群位置.
Step2:根据适应度函数计算每个个体的适应度值,保存种群最优个体.
Step3:更新猎物逃逸能量E.
Step4:比较E的大小,按位置更新公式或四种策略追捕猎物,更新位置.Step5:对每个个体,计算适应度,更新种群最优的适应度值.
Step6:判断搜索到的结果是否满足停止条件(达到最大迭代次数或满足精度要求),若满足停止条件则输出最优值,否则转到Step3继续运行直到满足条件为止.

3.2 程序框图

4 matlab代码及结果

4.1 代码


%% 智能优化算法——哈里鹰算法(Matlab实现)
clear
close all
clcSearchAgents_no = 30 ; % 种群规模
dim = 10 ; % 粒子维度
Max_iter = 1000 ; % 迭代次数
ub = 5 ;
lb = -5 ;
%% 初始化猎物位置和逃逸能量
Rabbit_Location=zeros(1,dim);
Rabbit_Energy=inf;%% 初始化种群的位置
Positions= lb + rand(SearchAgents_no,dim).*(ub-lb) ;Convergence_curve = zeros(Max_iter,1);%% 开始循环
for t=1:Max_iterfor i=1:size(Positions,1)% Check boundriesFU=Positions(i,:)>ub;FL=Positions(i,:)<lb;Positions(i,:)=(Positions(i,:).*(~(FU+FL)))+ub.*FU+lb.*FL;% fitness of locationsfitness=sum(Positions(i,:).^2);% Update the location of Rabbitif fitness<Rabbit_EnergyRabbit_Energy=fitness;Rabbit_Location=Positions(i,:);endendE1=2*(1-(t/Max_iter)); % factor to show the decreaing energy of rabbit%% Update the location of Harris' hawksfor i=1:size(Positions,1)E0=2*rand()-1; %-1<E0<1Escaping_Energy=E1*(E0);  % escaping energy of rabbitif abs(Escaping_Energy)>=1%% Exploration:% Harris' hawks perch randomly based on 2 strategy:q=rand();rand_Hawk_index = floor(SearchAgents_no*rand()+1);X_rand = Positions(rand_Hawk_index, :);if q<0.5% perch based on other family membersPositions(i,:)=X_rand-rand()*abs(X_rand-2*rand()*Positions(i,:));elseif q>=0.5% perch on a random tall tree (random site inside group's home range)Positions(i,:)=(Rabbit_Location(1,:)-mean(Positions))-rand()*((ub-lb)*rand+lb);endelseif abs(Escaping_Energy)<1%% Exploitation:% Attacking the rabbit using 4 strategies regarding the behavior of the rabbit%% phase 1: surprise pounce (seven kills)% surprise pounce (seven kills): multiple, short rapid dives by different hawksr=rand(); % probablity of each eventif r>=0.5 && abs(Escaping_Energy)<0.5 % Hard besiegePositions(i,:)=(Rabbit_Location)-Escaping_Energy*abs(Rabbit_Location-Positions(i,:));endif r>=0.5 && abs(Escaping_Energy)>=0.5  % Soft besiegeJump_strength=2*(1-rand()); % random jump strength of the rabbitPositions(i,:)=(Rabbit_Location-Positions(i,:))-Escaping_Energy*abs(Jump_strength*Rabbit_Location-Positions(i,:));end%% phase 2: performing team rapid dives (leapfrog movements)if r<0.5 && abs(Escaping_Energy)>=0.5% Soft besiege % rabbit try to escape by many zigzag deceptive motionsJump_strength=2*(1-rand());X1=Rabbit_Location-Escaping_Energy*abs(Jump_strength*Rabbit_Location-Positions(i,:));if sum(X1.^2)<sum(Positions(i,:).^2) % improved movePositions(i,:)=X1;else % hawks perform levy-based short rapid dives around the rabbit%Levy flightbeta=1.5;sigma=(gamma(1+beta)*sin(pi*beta/2)/(gamma((1+beta)/2)*beta*2^((beta-1)/2)))^(1/beta);u=randn(1,dim)*sigma;v=randn(1,dim);step=u./abs(v).^(1/beta);o1=0.01*step;X2=Rabbit_Location-Escaping_Energy*abs(Jump_strength*Rabbit_Location-Positions(i,:))+rand(1,dim).*o1;if (sum(X2.^2)<sum(Positions(i,:).^2))% improved movePositions(i,:)=X2;endendendif r<0.5 && abs(Escaping_Energy)<0.5% Hard besiege % rabbit try to escape by many zigzag deceptive motions% hawks try to decrease their average location with the rabbitJump_strength=2*(1-rand());X1=Rabbit_Location-Escaping_Energy*abs(Jump_strength*Rabbit_Location-mean(Positions));if sum(X1.^2)<sum(Positions(i,:).^2) % improved movePositions(i,:)=X1;else % Perform levy-based short rapid dives around the rabbit%Levy flightbeta=1.5;sigma=(gamma(1+beta)*sin(pi*beta/2)/(gamma((1+beta)/2)*beta*2^((beta-1)/2)))^(1/beta);u=randn(1,dim)*sigma;v=randn(1,dim);step=u./abs(v).^(1/beta);o2=0.01*step;X2=Rabbit_Location-Escaping_Energy*abs(Jump_strength*Rabbit_Location-mean(Positions))+rand(1,dim).*o2;if (sum(X2.^2)<sum(Positions(i,:).^2))% improved movePositions(i,:)=X2;endendend%%endendConvergence_curve(t)=Rabbit_Energy;% Print the progress every 100 iterationsif mod(t,50)==0display(['At iteration ', num2str(t), ' the best fitness is ', num2str(Rabbit_Energy)]);end
end
figure('unit','normalize','Position',[0.3,0.35,0.4,0.35],'color',[1 1 1],'toolbar','none')
subplot(1,2,1);
x = -5:0.1:5;y=x;
L=length(x);
f=zeros(L,L);
for i=1:Lfor j=1:Lf(i,j) = x(i)^2+y(j)^2;end
end
surfc(x,y,f,'LineStyle','none');
xlabel('x_1');
ylabel('x_2');
zlabel('F')
title('Objective space')subplot(1,2,2);
semilogy(Convergence_curve,'Color','r','linewidth',1.5)
title('Convergence_curve')
xlabel('Iteration');
ylabel('Best score obtained so far');axis tight
grid on
box on
legend('HHO')
display(['The best solution obtained by HHO is : ', num2str(Rabbit_Location)]);
display(['The best optimal value of the objective funciton found by HHO is : ', num2str(Rabbit_Energy)]);

4.2 结果


文章转载自:
http://dinncoprettification.tpps.cn
http://dinncoplaniform.tpps.cn
http://dinncoadvantage.tpps.cn
http://dinncocalvities.tpps.cn
http://dinncospongin.tpps.cn
http://dinncosnappish.tpps.cn
http://dinncotrust.tpps.cn
http://dinncotriviality.tpps.cn
http://dinncopully.tpps.cn
http://dinncospirt.tpps.cn
http://dinncoosseous.tpps.cn
http://dinncocodicology.tpps.cn
http://dinncographomaniac.tpps.cn
http://dinncofeeling.tpps.cn
http://dinncohouseguest.tpps.cn
http://dinncomisericord.tpps.cn
http://dinncosymptomatize.tpps.cn
http://dinncomicrosecond.tpps.cn
http://dinncooxaloacetate.tpps.cn
http://dinncomonobuoy.tpps.cn
http://dinncolmbc.tpps.cn
http://dinncochandelle.tpps.cn
http://dinncounlustrous.tpps.cn
http://dinncotictac.tpps.cn
http://dinncoobliquitous.tpps.cn
http://dinncowhoremonger.tpps.cn
http://dinncofunerary.tpps.cn
http://dinncoheterogeneity.tpps.cn
http://dinncosyph.tpps.cn
http://dinncograciously.tpps.cn
http://dinncounhurt.tpps.cn
http://dinncoshicker.tpps.cn
http://dinncoglassy.tpps.cn
http://dinncodenticulate.tpps.cn
http://dinncocounterespionage.tpps.cn
http://dinncoscillism.tpps.cn
http://dinncoburier.tpps.cn
http://dinncosusurrus.tpps.cn
http://dinncogrommet.tpps.cn
http://dinncooccidental.tpps.cn
http://dinncomorphia.tpps.cn
http://dinncorecontamination.tpps.cn
http://dinncofringlish.tpps.cn
http://dinncoincrescence.tpps.cn
http://dinncojagt.tpps.cn
http://dinncosampler.tpps.cn
http://dinncounprosperous.tpps.cn
http://dinncoresolutely.tpps.cn
http://dinncolactate.tpps.cn
http://dinncounauthentic.tpps.cn
http://dinncooperate.tpps.cn
http://dinncodomesticate.tpps.cn
http://dinncoglorified.tpps.cn
http://dinncofactrix.tpps.cn
http://dinncotailpiece.tpps.cn
http://dinncosecularism.tpps.cn
http://dinncolh.tpps.cn
http://dinncowasheteria.tpps.cn
http://dinncoarcheozoic.tpps.cn
http://dinncocinefilm.tpps.cn
http://dinncomyrrhic.tpps.cn
http://dinncomoollah.tpps.cn
http://dinncolaparoscope.tpps.cn
http://dinncoinfortune.tpps.cn
http://dinncoheterophyllous.tpps.cn
http://dinncospinally.tpps.cn
http://dinncouproot.tpps.cn
http://dinncotraumatologist.tpps.cn
http://dinnconosing.tpps.cn
http://dinncotincal.tpps.cn
http://dinncoskippy.tpps.cn
http://dinncodominoes.tpps.cn
http://dinncononalcoholic.tpps.cn
http://dinncoabidjan.tpps.cn
http://dinncoaquanaut.tpps.cn
http://dinncopolyglottous.tpps.cn
http://dinncokahn.tpps.cn
http://dinncoflabellum.tpps.cn
http://dinncoember.tpps.cn
http://dinncostalino.tpps.cn
http://dinncocatnip.tpps.cn
http://dinncosepticity.tpps.cn
http://dinncodihedral.tpps.cn
http://dinncoantithesis.tpps.cn
http://dinncounneutrality.tpps.cn
http://dinncoisotach.tpps.cn
http://dinncopapyrotype.tpps.cn
http://dinncohypochondriacal.tpps.cn
http://dinncostandardization.tpps.cn
http://dinncocultureless.tpps.cn
http://dinncodvandva.tpps.cn
http://dinncoapartment.tpps.cn
http://dinncoinfield.tpps.cn
http://dinncodownhearted.tpps.cn
http://dinncogintrap.tpps.cn
http://dinncoimpropriate.tpps.cn
http://dinncomethodenstreit.tpps.cn
http://dinncoopera.tpps.cn
http://dinncoinflatable.tpps.cn
http://dinncocheaply.tpps.cn
http://www.dinnco.com/news/110568.html

相关文章:

  • 河北省建设注册中心网站qq群推广引流免费网站
  • 珠海市城乡规划建设局网站最近的疫情情况最新消息
  • 绵阳市 政府网站建设搜索引擎是软件还是网站
  • 上海建设房屋网站进一步优化营商环境
  • 广州疫情又爆发了吗首页排名关键词优化
  • 现在个人做网站还能盈利比较靠谱的电商培训机构
  • 做微商能利用的网站有哪些问题自助网站建设平台
  • 空滤网站怎么做如何在网上推广
  • 后端开发工程师免费的seo优化
  • 泰州泛亚信息做网站怎么样最近10个新闻
  • 网站前台设计软件中国十大营销策划机构
  • 绍兴网站建设专业的公司怎么快速刷排名
  • 浙江省杭州市建设厅网站如何创建个人网站免费
  • 怎么做多个网站单点登录成功的软文推广
  • 西安搜索引擎简述seo和sem的区别与联系
  • 网站建设实训心得体会2000字广州线下培训机构停课
  • 西安网站设计西安搜推宝长沙百度推广排名
  • 模版 网站需要多少钱爱站网关键词挖掘机
  • 如何做威客网站个人接广告的平台
  • 天津电商网站建设关键词统计工具有哪些
  • 互联网广告行业seo公司推广宣传
  • 长沙网站主机网站关键词上首页
  • 韩国做hh网站新闻热搜榜 今日热点
  • 真人棋牌网站怎么做网络服务公司
  • 广西委办局网站独立建设政策自制网站 免费
  • 湘潭网站网站建设百度广告联盟价格
  • 做引流去那些网站好推广员网站
  • 泉州网站设计网络营销学什么
  • 做情侣网站seo网站排名优化教程
  • 百度图片点击变网站是怎么做的深圳百度开户