怎么用matlab代码解决单目标优化问题

发布时间:2022-10-13 17:19:48 作者:iii
来源:亿速云 阅读:148

这篇“怎么用matlab代码解决单目标优化问题”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“怎么用matlab代码解决单目标优化问题”文章吧。

部分代码

%_______________________________________________________________________________________%
%  Sea-Horse optimizer (SHO)
%  Developed in MATLAB R2018a
%  optimization problems.
%  Applied Intelligence
%_______________________________________________________________________________________%
clear all 
clc
close all
popsize=30; % Number of search agents
Max_iter=100; % Maximum iteration
F_name='F4'; % Name of the test function that can be from F1 to F23 (Table 2,3,4 in the paper)
[LB,UB,Dim,fobj]=BenchmarkFunctions(F_name);% Load details of the selected benchmark function
tic
[ObjectiveFitness,ObjectivePosition,Convergence_curve,Trajectories,fitness_history, population_history]=SHO(popsize,Max_iter,LB,UB,Dim,fobj);
time=toc;
figure('Position',[454   445   694   297]);
subplot(1,2,1);
func_plot(F_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([F_name,'( x_1 , x_2 )'])
subplot(1,2,2);
semilogy(1:Max_iter,Convergence_curve,'color','r','linewidth',2.5);
title('Convergence curve');
xlabel('Iteration');
ylabel('Best score obtained so far')
display(['The running time is:', num2str(time)]);
display(['The best solution obtained by SHO is : ', num2str(ObjectiveFitness)]);
display(['The best optimal sea horse of the objective funciton found by SHO is : ', num2str(ObjectivePosition)]);

运行结果

怎么用matlab代码解决单目标优化问题

怎么用matlab代码解决单目标优化问题

怎么用matlab代码解决单目标优化问题

以上就是关于“怎么用matlab代码解决单目标优化问题”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注亿速云行业资讯频道。

推荐阅读:
  1. python如何实现单目标、多目标、多尺度、自定义特征的KCF跟踪算法
  2. 使用python3怎么实现一个单目标粒子群算法

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

matlab

上一篇:matlab如何实现图像降噪

下一篇:matlab怎么实现风电功率

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》