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

作品展示网站源码sq网站推广

作品展示网站源码,sq网站推广,商城网站建设价格低,南京市住房建设网站一. 真菌生长优化算法(FGO) 真菌生长优化算法(Fungal Growth Optimizer,FGO)是一种新型的自然启发式元启发式算法,其灵感来源于自然界中真菌的生长行为。该算法通过模拟真菌的菌丝尖端生长、分支和孢子萌发…

一. 真菌生长优化算法(FGO)

真菌生长优化算法(Fungal Growth Optimizer,FGO)是一种新型的自然启发式元启发式算法,其灵感来源于自然界中真菌的生长行为。该算法通过模拟真菌的菌丝尖端生长、分支和孢子萌发等行为,提供了一系列的探索和开发操作符,以解决复杂的优化问题。FGO算法在多个领域展现出了良好的性能,尤其是在解决高维问题和避免陷入局部最优方面具有显著优势。
在这里插入图片描述

1、算法原理

FGO算法的核心在于模拟真菌的三种主要生长行为:菌丝尖端生长、分支和孢子萌发。这些行为在算法中分别对应不同的搜索策略,以实现对解空间的有效探索和开发。

  1. 菌丝尖端生长(Hyphal Tip Growth)
    菌丝尖端生长是真菌寻找营养物质的主要方式。在FGO算法中,这一行为通过模拟菌丝在搜索空间中的线性生长来实现。菌丝会根据环境中的营养浓度调整其生长方向,以找到营养丰富的区域。这种行为在算法中提供了主要的探索能力,帮助算法在解空间中广泛搜索。

  2. 分支(Branching)
    分支行为允许真菌从现有的菌丝侧枝上生长出新的菌丝,以进一步探索周围的环境。在FGO算法中,分支行为通过在现有解的基础上生成新的解来实现,从而增强了算法的探索能力。这种机制有助于算法在解空间中发现更多的潜在最优解。

  3. 孢子萌发(Spore Germination)
    孢子萌发是真菌繁殖的重要方式。在FGO算法中,孢子萌发行为通过在搜索空间中随机生成新的解来实现。这些新的解在算法的早期阶段具有较高的随机性,随着算法的进行,它们的位置会逐渐调整到更接近当前最优解的区域。这种机制有助于算法在保持种群多样性的同时,逐步收敛到最优解。

2、算法流程

输入:种群规模 N N N,最大迭代次数 t max ⁡ t_{\max} tmax,随机数 r 0 , r 10 , r 2 , r 8 r_0, r_{10}, r_2, r_8 r0,r10,r2,r8,以及其他相关参数。

输出:最优解 S ∗ S^* S

  1. 初始化

    • 使用公式 (1) 初始化 N N N 个菌丝个体 S i t S_i^t Sit
    • 评估每个 S i t S_i^t Sit 的适应度值,并确定适应度值最高的个体作为当前最优解 S ∗ S^* S
    • 设置迭代计数器 t = 1 t = 1 t=1
  2. 迭代过程

    • t < t max ⁡ t < t_{\max} t<tmax 时,执行以下步骤:
      • 生成两个随机数 r 0 r_0 r0 r 10 r_{10} r10,取值范围为 [0, 1]。
      • 如果 r 0 < r 10 r_0 < r_{10} r0<r10,执行菌丝尖端生长行为:
        • 对于每个菌丝个体 i = 1 i = 1 i=1 N N N
          • 根据公式 (24) 和 (23) 计算能量 E i E_i Ei 和概率 p i p_i pi
          • 如果 p i < E i p_i < E_i pi<Ei(探索阶段 I):
            • 使用公式 (8) 更新 S i t + 1 S_i^{t+1} Sit+1
          • 否则(开发阶段 I):
            • 使用公式 (22) 更新 S i t + 1 S_i^{t+1} Sit+1
          • 如果新解 S i t + 1 S_i^{t+1} Sit+1 的适应度值小于当前解 S i t S_i^t Sit 的适应度值:
            • 更新当前解 S i t = S i t + 1 S_i^t = S_i^{t+1} Sit=Sit+1
        • 迭代计数器加 1, t = t + 1 t = t + 1 t=t+1
      • 否则,执行菌丝分支和孢子萌发行为:
        • 对于每个菌丝个体 i = 1 i = 1 i=1 N N N
          • 生成两个随机数 r 2 r_2 r2 r 8 r_8 r8,取值范围为 [0, 1]。
          • 如果 r 2 < 0.5 r_2 < 0.5 r2<0.5(菌丝分支):
            • 使用公式 (30) 更新 S i t + 1 S_i^{t+1} Sit+1
          • 否则(孢子萌发):
            • 使用公式 (31) 更新 S i t + 1 S_i^{t+1} Sit+1
          • 如果新解 S i t + 1 S_i^{t+1} Sit+1 的适应度值小于当前解 S i t S_i^t Sit 的适应度值:
            • 更新当前解 S i t = S i t + 1 S_i^t = S_i^{t+1} Sit=Sit+1
        • 迭代计数器加 1, t = t + 1 t = t + 1 t=t+1
  3. 结束条件

    • 当迭代次数 t t t 达到最大迭代次数 t max ⁡ t_{\max} tmax 时,算法结束。
    • 输出最优解 S ∗ S^* S

3、 详细步骤说明

  1. 初始化

    • 随机生成 N N N 个初始菌丝个体,每个个体代表一个潜在的解。
    • 评估每个个体的适应度值,找到当前最优解 S ∗ S^* S
  2. 菌丝尖端生长行为

    • 通过比较随机数 r 0 r_0 r0 r 10 r_{10} r10,决定是否执行菌丝尖端生长行为。
    • 对于每个菌丝个体,计算其能量 E i E_i Ei 和概率 p i p_i pi
    • 根据 p i p_i pi E i E_i Ei 的关系,决定是进行探索阶段 I 还是开发阶段 I。
    • 使用相应的公式更新菌丝个体的位置。
    • 如果新位置的适应度值更好,则接受新位置。
  3. 菌丝分支和孢子萌发行为

    • 如果不执行菌丝尖端生长行为,则执行菌丝分支和孢子萌发行为。
    • 对于每个菌丝个体,生成随机数 r 2 r_2 r2 r 8 r_8 r8
    • 根据 r 2 r_2 r2 的值,决定是进行菌丝分支还是孢子萌发。
    • 使用相应的公式更新菌丝个体的位置。
    • 如果新位置的适应度值更好,则接受新位置。
  4. 迭代更新

    • 每次更新后,检查是否满足终止条件(达到最大迭代次数)。
    • 如果满足条件,则输出最优解;否则,继续下一次迭代。
      参考文献:
      [1]Abdel-Basset M, Mohamed R, Abouhawwash M. Fungal growth optimizer: A novel nature-inspired metaheuristic algorithm for stochastic optimization[J]. Computer Methods in Applied Mechanics and Engineering, 2025, 437: 117825.

二、核心MATLAB代码

% The Fungal Growth Optimizer
function [Gb_Fit,Gb_Sol,Conv_curve]=FGO(N,Tmax,ub,lb,dim,Fun_No,fhd)
%%%%-------------------Definitions--------------------------%%
%%
Gb_Sol=zeros(1,dim); % A vector to include the best-so-far solution
Gb_Fit=inf; % A Scalar variable to include the best-so-far score
Conv_curve=zeros(1,Tmax);
%%-------------------Controlling parameters--------------------------%%
%%
M=0.6; %% Determines the tradeoff percent between exploration and exploitation operators.
Ep=0.7; %% Determines the probability of environmental effect on hyphal growth
R=0.9; %% Determines the speed of convergence to the best-so-far solution
%%---------------Initialization----------------------%%
%%
S=initialization(N,dim,ub,lb); % Initialize the S of crested porcupines
t=0; %% Function evaluation counter
%%---------------------Evaluation-----------------------%%
for i=1:N%% Test suites of CEC-2014, CEC-2017, CEC-2020, and CEC-2022fit(i)=feval(fhd, S(i,:)',Fun_No);
end
% Update the best-so-far solution
[Gb_Fit,index]=min(fit);
Gb_Sol=S(index,:);
%% A new vector to store the best-so-far position for each hyphae
Sp=S;
opt=Fun_No*100; %% Best-known fitness
%%  Optimization Process of FGO
while t<Tmax && opt~=Gb_Fit%% ----------------------------------------------------------------------------- %%if t <= Tmax/2 %% Compute the the nutrient allocation according to (12)nutrients = rand(N); % Allocate more randomly to encourage fluctuation exploitationelsenutrients = fit;  % Exploitation phase: allocate based on fitnessendnutrients = nutrients / sum(nutrients)+2*rand; % Normalize nutrient allocation according to (13)%% ----------------------------------------------------------------------------- %%if rand<rand %% Hyphal tip growth behavior %%for i=1:Na=randi(N);b=randi(N);c=randi(N);while a==i | a==b | c==b | c==a ||c==i |b==ia=randi(N);b=randi(N);c=randi(N);endp=(fit(i)-min(fit))/(max(fit)-min(fit)+eps); %%% Compute p_i according to (23)Er=M+(1-t/(Tmax)).*(1-M); %%% Compute Er according to (24)if p<ErF=(fit(i)/(sum(fit))).*rand*(1-t/(Tmax))^(1-t/(Tmax)); %% Calculate F according to (5) and (6)E=exp(F);  %% Calculate E according to (4)r1=rand(1,dim);r2=rand;U1=r1<r2; %% Binary vectorS(i,:) = (U1).*S(i,:)+(1-U1).*(S(i,:)+E.*(S(a,:)-S(b,:))); %% Generate the new hyphal growth according to (9)elseEc = (rand(1, dim) - 0.5) .* rand.*(S(a,:)-S(b,:)); % Compute the additional exploratory step using (17)if rand<rand %% Hypha growing in the opposite direction of nutrient-rich areas %De2 = rand(1,dim).* (S(i,:) - Gb_Sol).*(rand(1,dim)>rand); %% Compute De2 according to (16) %%S(i,:) = S(i,:) + De2 .* nutrients(i)+Ec*(rand>rand); %% Compute the new growth for the ith hyphal using (15)else %% Growth direction toward nutrient-rich areaDe = rand.* (S(a, :) - S(i, :)) + rand(1,dim).* ((rand>rand*2-1).*Gb_Sol - S(i, :)).*(rand()>R); %% Compute De according to (11) %%S(i,:) = S(i,:) + De .* nutrients(i)+Ec*(rand>Ep); %% Compute the new growth for the ith hyphal using (14)endend%% Return the search agents that exceed the search space's boundsfor j=1:size(S,2)if  S(i,j)>ub(j)S(i,j)=lb(j)+rand*(ub(j)-lb(j));elseif  S(i,j)<lb(j)S(i,j)=lb(j)+rand*(ub(j)-lb(j));endend% Calculate the fitness value of the newly generated solutionnF=feval(fhd, S(i,:)',Fun_No);%% update Global & Local best solutionif  fit(i)<nFS(i,:)=Sp(i,:);    % Update local best solutionelseSp(i,:)=S(i,:);fit(i)=nF;%% update Global best solutionif  fit(i)<=Gb_FitGb_Sol=S(i,:);    % Update global best solutionGb_Fit=fit(i);endendt=t+1; % Move to the next generationif t>TmaxbreakendConv_curve(t)=Gb_Fit;endif  t>Tmaxbreak;endelser5=rand;for i=1:Nrr=rand(1,dim);a=randi(N);b=randi(N);c=randi(N);while a==i | a==b | c==b | c==a ||c==i |b==ia=randi(N);b=randi(N);c=randi(N);endif rand<0.5 %% Hyphal branchingEL=1+exp(fit(i)/(sum(fit)))*(rand>rand); %% Compute the growth rate of the hypha produced via lateral branching using (29)Dep1=(S(b,:)-S(c,:)); %% Compute Dep1 using (26)Dep2=(S(a,:)-Gb_Sol); %% Compute Dep1 using (27)r1=rand(1,dim);r2=rand;U1=r1<r2; %% Binary vectorS(i,:)= S(i,:).*U1+(S(i,:)+ r5.*Dep1.*EL+ (1-r5).*Dep2.*EL).*(1-U1); % Generate the new branch for the ith hyphal using (30)else %% Spore germinationsig=(rand>rand*2-1); %% 1 or -1F=(fit(i)/(sum(fit))).*rand*(1-t/(Tmax))^(1-t/(Tmax)); %% Calculate F according to (5) and (6)E=exp(F);  %% Calculate E according to (4)for j=1:size(S,2)mu=sig.*rand.*E;if rand>randS(i,j)=(((t/(Tmax))*Gb_Sol(j)+(1-t/(Tmax))*S(a,j))+S(b,j))/2.0 + mu * abs((S(c,j)+S(a,j)+S(b,j))/3.0-S(i,j));      % Eq. (31)endendend%% Return the search agents that exceed the search space's boundsfor j=1:size(S,2)if  S(i,j)>ub(j)S(i,j)=lb(j)+rand*(ub(j)-lb(j));elseif  S(i,j)<lb(j)S(i,j)=lb(j)+rand*(ub(j)-lb(j));endend% Calculate the fitness value of the newly generated solutionnF=feval(fhd, S(i,:)',Fun_No);%% update Global & Local best solutionif  fit(i)<nFS(i,:)=Sp(i,:);    % Update local best solutionelseSp(i,:)=S(i,:);fit(i)=nF;%% update Global best solutionif  fit(i)<=Gb_FitGb_Sol=S(i,:);    % Update global best solutionGb_Fit=fit(i);endendt=t+1; % Move to the next generationif t>TmaxbreakendConv_curve(t)=Gb_Fit;end %% End for iend %% End Ifif  t>Tmaxbreak;end
end%% End while
end
%_________________________________________________________________________%
%  Fungal Growth Optimizer source code demo 1.0               %
%  Developed in MATLAB R2019A                                      %
%                                                                         %
%                                                                         %
%   Main paper: Fungal Growth Optimizer: A Novel Nature-inspired Metaheuristic Algorithm for Stochastic Optimization                       %
%                  %
%                                                                         %
%_________________________________________________________________________%
% This function initialize the first population of search agents
function Positions=initialization(SearchAgents_no,dim,ub,lb)
Boundary_no= length(ub); % numnber of boundaries
% If the boundaries of all variables are equal and user enter a signle
% number for both ub and lb
if Boundary_no==1Positions=rand(SearchAgents_no,dim).*(ub-lb)+lb;
end
% If each variable has a different lb and ub
if Boundary_no>1for i=1:dimub_i=ub(i);lb_i=lb(i);Positions(:,i)=rand(SearchAgents_no,1).*(ub_i-lb_i)+lb_i;      end
end

文章转载自:
http://dinncowinegrower.ydfr.cn
http://dinncohohhot.ydfr.cn
http://dinncoreconfirmation.ydfr.cn
http://dinncoviscoelasticity.ydfr.cn
http://dinncomoll.ydfr.cn
http://dinncomeningococcus.ydfr.cn
http://dinncoincentive.ydfr.cn
http://dinncodefeat.ydfr.cn
http://dinncoroentgenise.ydfr.cn
http://dinncoperistalsis.ydfr.cn
http://dinnconapoleonize.ydfr.cn
http://dinncoportiere.ydfr.cn
http://dinncodespairingly.ydfr.cn
http://dinncogadbee.ydfr.cn
http://dinncohootnanny.ydfr.cn
http://dinncosubsocial.ydfr.cn
http://dinncoschoolboy.ydfr.cn
http://dinncobaldly.ydfr.cn
http://dinncomst.ydfr.cn
http://dinncoabuzz.ydfr.cn
http://dinncospringwater.ydfr.cn
http://dinncolexical.ydfr.cn
http://dinncocontessa.ydfr.cn
http://dinncoparaplasm.ydfr.cn
http://dinncorigged.ydfr.cn
http://dinncoprosper.ydfr.cn
http://dinncoilliberally.ydfr.cn
http://dinncogarfish.ydfr.cn
http://dinncodecathlete.ydfr.cn
http://dinncorivadavia.ydfr.cn
http://dinncofilasse.ydfr.cn
http://dinncotriplice.ydfr.cn
http://dinncoprearrangement.ydfr.cn
http://dinncoforasmuch.ydfr.cn
http://dinncomummify.ydfr.cn
http://dinncoballista.ydfr.cn
http://dinncocaulicolous.ydfr.cn
http://dinncoxenomorphic.ydfr.cn
http://dinncoabreact.ydfr.cn
http://dinncobinder.ydfr.cn
http://dinncoshort.ydfr.cn
http://dinncoobfusticated.ydfr.cn
http://dinncofar.ydfr.cn
http://dinncoimprovvisatore.ydfr.cn
http://dinncooneiric.ydfr.cn
http://dinncogallinule.ydfr.cn
http://dinncotreehopper.ydfr.cn
http://dinncoisd.ydfr.cn
http://dinncogrampus.ydfr.cn
http://dinncotransliterator.ydfr.cn
http://dinncodaylight.ydfr.cn
http://dinncorandomicity.ydfr.cn
http://dinncoanthropophuism.ydfr.cn
http://dinncopoikilitic.ydfr.cn
http://dinncomurrain.ydfr.cn
http://dinncoisotach.ydfr.cn
http://dinncoamuse.ydfr.cn
http://dinncokcia.ydfr.cn
http://dinncowuchang.ydfr.cn
http://dinncodemandeur.ydfr.cn
http://dinncodeviationist.ydfr.cn
http://dinncostrontium.ydfr.cn
http://dinncoepiphylline.ydfr.cn
http://dinncoconky.ydfr.cn
http://dinncohearse.ydfr.cn
http://dinncoturnout.ydfr.cn
http://dinncoconferee.ydfr.cn
http://dinncointerborough.ydfr.cn
http://dinncofertilisation.ydfr.cn
http://dinncodistress.ydfr.cn
http://dinncogallinacean.ydfr.cn
http://dinncooverslept.ydfr.cn
http://dinncocasse.ydfr.cn
http://dinncohooper.ydfr.cn
http://dinncodestoolment.ydfr.cn
http://dinncodiscursiveness.ydfr.cn
http://dinncoreducer.ydfr.cn
http://dinncoecology.ydfr.cn
http://dinncofilibeg.ydfr.cn
http://dinncoskipjack.ydfr.cn
http://dinncohyperhidrosis.ydfr.cn
http://dinncocolloquize.ydfr.cn
http://dinncocavern.ydfr.cn
http://dinncourologic.ydfr.cn
http://dinncootolaryngology.ydfr.cn
http://dinncovaporish.ydfr.cn
http://dinncogenal.ydfr.cn
http://dinncoeumenides.ydfr.cn
http://dinncolampoonist.ydfr.cn
http://dinncospringtime.ydfr.cn
http://dinncocybernetics.ydfr.cn
http://dinncoconstate.ydfr.cn
http://dinncolatvia.ydfr.cn
http://dinncoexacerbation.ydfr.cn
http://dinncoexpressions.ydfr.cn
http://dinncoeudaimonism.ydfr.cn
http://dinncopragmatistic.ydfr.cn
http://dinncoembryotrophe.ydfr.cn
http://dinncopreponderate.ydfr.cn
http://dinncohormuz.ydfr.cn
http://www.dinnco.com/news/124177.html

相关文章:

  • 旅行网站信息技术化建设阿里指数网站
  • 免费网站建设 godaddy百度seo快速排名
  • 网站建设流程与步骤百度云登录
  • 杭州网站建设公司seo服务的内容
  • 如何给网站做右侧导航栏长春网站建设
  • 武汉影楼网站建设网站建设详细方案模板
  • b2b外贸网站建设拼多多女装关键词排名
  • 网站建设与研发深圳网络营销推广中心
  • 轻量应用服务器做网站网站优化技巧
  • 如何开外贸网店黄石市seo关键词优化怎么做
  • 枣阳网站建设_枣阳山水数码千锋教育可靠吗
  • 企业网站介绍网络销售培训学校
  • 呼伦贝尔北京网站建设windows优化大师手机版
  • 工信部门备案网站获取的icp备案号广告公司名字
  • 2023年电脑端网游企业关键词优化推荐
  • 网站开发全包公司网站设计方案
  • 安装wordpress linux正规网络公司关键词排名优化
  • 松江做网站多少钱百度实时热搜榜
  • 黟县网站建设竞价推广遇到恶意点击怎么办
  • ps制作网站首页潍坊住房公积金管理中心
  • 成都品牌设计网站临沂森拓网络科技有限公司
  • 做网站需要雇什么人微商引流推广
  • 政府门户网站的模块软文一般发布在哪些平台
  • 傻瓜式做网站软件广告设计与制作
  • 广东网站制作多少钱营业推广促销
  • 大都会app官方下载抚顺优化seo
  • 旅游在哪个网站做攻略企业营销网站制作
  • 网站平台做推广搜索引擎关键词怎么优化
  • 网站建设通知书东莞网站建设平台
  • 小公司网站模版推广普通话的内容