【智能优化算法】成功历史智能优化器(SHIO)附matlab代码

简介: 【智能优化算法】成功历史智能优化器(SHIO)附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测雷达通信 无线传感器

信号处理图像处理路径规划元胞自动机无人机 电力系统

⛄ 内容介绍

该论文提出了一种称为成功历史智能优化器 (SHIO) 的新型随机群智能算法。它通过基于搜索空间中找到的三个最佳解决方案提出新的探索和开发运动策略来创建新的运动向量,从而为单目标优化问题提供解决方案,其中每个最佳解决方案都存储在内存中并从到目前为止在优化过程中找到的三个最佳解决方案的平均值。拟议的 SHIO 确保了搜索空间探索和使用的效率。为了确认 SHIO 性能,测试了几种性能测量(搜索历史、轨迹和收敛曲线),并使用 SHIO 来解决 (23) 单目标优化基准函数。这些功能已被分类为单峰,多式联运和固定式多式联运。使用了平均值、标准差、最小值和最大值等各种指标,并记录了定量结果。此外,定性结果的轨迹和搜索历史可视化。测试函数和性能指标的结果表明,所提出的算法可以探索各种搜索区域位置,在优化的同时利用潜在的搜索空间位置,避免局部乐观并有效地收敛到全局最优。与比较算法相比,SHIO 在评估的单峰和多峰基准测试中提供了极具竞争力和卓越的结果。请注意,SHIO 算法源代码可在 并记录了定量结果。此外,定性结果的轨迹和搜索历史可视化。测试函数和性能指标的结果表明,所提出的算法可以探索各种搜索区域位置,在优化的同时利用潜在的搜索空间位置,避免局部乐观并有效地收敛到全局最优。与比较算法相比,SHIO 在评估的单峰和多峰基准测试中提供了极具竞争力和卓越的结果。请注意,SHIO 算法源代码可在 并记录了定量结果。此外,定性结果的轨迹和搜索历史可视化。测试函数和性能指标的结果表明,所提出的算法可以探索各种搜索区域位置,在优化的同时利用潜在的搜索空间位置,避免局部乐观并有效地收敛到全局最优。与比较算法相比,SHIO 在评估的单峰和多峰基准测试中提供了极具竞争力和卓越的结果。请注意,SHIO 算法源代码可在 在优化的同时利用潜在的搜索空间位置,避免局部乐观,高效收敛到全局最优。与比较算法相比,SHIO 在评估的单峰和多峰基准测试中提供了极具竞争力和卓越的结果。请注意,SHIO 算法源代码可在 在优化的同时利用潜在的搜索空间位置,避免局部乐观,高效收敛到全局最优。与比较算法相比,SHIO 在评估的单峰和多峰基准测试中提供了极具竞争力和卓越的结果。

⛄ 部分代码

% Success history intelligent optimizer (SHIO) optmization Code

% code for paper: Fakhouri, H. N., Hamad, F., & Alawamrah, A. (2022). Success history intelligent optimizer. The Journal of Supercomputing, 78(5), 6461-6502.

%please give citation of the above paper


% benchmarkfunction = @YourCostFunction

% dimensionension = number of your variables

% part of this code is referenced to : https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo

% we have modified the open source code of GWO equations and code to make SHIO code

%                                                                   %

%   reference of code and credit to : S. Mirjalili, S. M. Mirjalili, A. Lewis             %

%               Grey Wolf Optimizer, Advances in Engineering        %

%               Software , in press,                                %



clear all

clc

visFlag = 0;

SHIO_Particles_number=50; % Number of search agents

Maximum_numbef_of_iterations=100;

% Load details of the selected benchmark function

number_of_runs=3;

for i= [ 1 :1 : 5]

%  for 23 function  use i= [ 1 :1 : 23]


if i== 1

       Function_name = 'F1';  

       display('The best optimal value of the objective funciton found F1 : ');

   end  

   

    if i== 2

       Function_name = 'F2';

        display('The best optimal value of the objective funciton found F2 : ');

    end

   if i== 3

       Function_name = 'F3';  

       display('The best optimal value of the objective funciton found F3 : ');

   end  

   

    if i== 4

       Function_name = 'F4';

        display('The best optimal value of the objective funciton found F4 : ');

   end

   if i== 5

       Function_name = 'F5';  

       display('The best optimal value of the objective funciton found F5 : ');

   end  

    if i== 6

       Function_name = 'F6';

        display('The best optimal value of the objective funciton found F6 : ');

   end  

   if i== 7

       Function_name = 'F7';  

       display('The best optimal value of the objective funciton found F7 : ');

   end  

    if i== 8

       Function_name = 'F8';

        display('The best optimal value of the objective funciton found F8 : ');

   end

   if i== 9

       Function_name = 'F9';  

       display('The best optimal value of the objective funciton found F9 : ');

   end  

    if i== 10

       Function_name = 'F10';

        display('The best optimal value of the objective funciton found F10 : ');

    end  

   if i== 11

       Function_name = 'F11';  

       display('The best optimal value of the objective funciton found F11 : ');

   end  

    if i== 12

       Function_name = 'F12';

        display('The best optimal value of the objective funciton found F12 : ');

   end

   if i== 13

       Function_name = 'F13';  

       display('The best optimal value of the objective funciton found F13 : ');

   end  

    if i== 14

       Function_name = 'F14';

        display('The best optimal value of the objective funciton found F14 : ');

    end

     if i== 15

       Function_name = 'F15';  

       display('The best optimal value of the objective funciton found F15 : ');

   end  

    if i== 16

       Function_name = 'F16';

        display('The best optimal value of the objective funciton found F16 : ');

   end  

   if i== 17

       Function_name = 'F17';  

       display('The best optimal value of the objective funciton found F17 : ');

   end  

    if i== 18

       Function_name = 'F18';

        display('The best optimal value of the objective funciton found F18 : ');

    end

    if i== 19

       Function_name = 'F19';

        display('The best optimal value of the objective funciton found F19 : ');

    end

    if i== 20

       Function_name = 'F20';

        display('The best optimal value of the objective funciton found F20 : ');

    end

    if i== 21

       Function_name = 'F21';

        display('The best optimal value of the objective funciton found F21 : ');

    end

    if i== 22

       Function_name = 'F22';

        display('The best optimal value of the objective funciton found F22 : ');

    end

    if i== 23

       Function_name = 'F23';

        display('The best optimal value of the objective funciton found F23 : ');

    end

   

bestsolutionsofSHIO=zeros(1,number_of_runs);

%bestsolutionsofPSO=zeros(1,number_of_runs);

[lowerbound,upperbound,dimension,benchmarkfunction]=Get_Functions_details(Function_name);


for k= [ 1 :1 : number_of_runs]

[SHIO_best_solution_value,SHIO_best_particle_position,SHIO_convergence_curve, Trajectories,fitness_history, position_history]=SHIOoptmizer(SHIO_Particles_number,Maximum_numbef_of_iterations,lowerbound,upperbound,dimension,benchmarkfunction);

bestsolutionsofSHIO(k)=SHIO_best_solution_value;

disp(['run number', num2str(k)]);

disp(['is', num2str(SHIO_best_solution_value)]);

%[gBestScore, PSO_cg_curve]=PSO(SHIO_Particles_number,Maximum_numbef_of_iterations,lowerbound,upperbound,dimension,benchmarkfunction); % run PSO to compare to results

end

disp(['the avarage for SHIO', num2str(k)]);

mm=mean(bestsolutionsofSHIO);

disp(['the mean OF SHIO is ',num2str(mm)]);


%mm2=mean(bestsolutionsofPSO);

%disp(['the mean OF PSO is ',num2str(mm2)]);


MINSSHIO=min(bestsolutionsofSHIO);

disp(['the min OF SHIO is ',num2str(MINSSHIO)]);


MAXSSHIO=max(bestsolutionsofSHIO);

disp(['the max OF SHIO is ',num2str(MAXSSHIO)]);



disp(['the std for ', num2str(k)]);

stdSHIO=std(bestsolutionsofSHIO);

disp(['the std OF SHIO is ',num2str(stdSHIO)]);

    end

% %***********************************************************

%draw last function values

% %***********************************************************

%draw curve compare with Pso

figure('Position',[500 500 660 290])

%Draw search space

subplot(1,2,1);

func_plot(Function_name);

title('Parameter space')

xlabel('x_1');

ylabel('x_2');

zlabel([Function_name,'( x_1 , x_2 )'])


%Draw objective space

subplot(1,2,2);


semilogy(SHIO_convergence_curve,'Color','r')

hold on

%semilogy(PSO_cg_curve,'Color','b')

%title('Objective space')

xlabel('Iteration');

ylabel('Best score obtained so far');


axis tight


box on




%******************************************************** draw all shapes togather


%please wait it take time


figure('Position',[454   445   894   297])

%Draw search space

subplot(1,5,1);

func_plot(Function_name);

title('Parameter space')

xlabel('x_1');

ylabel('x_2');

zlabel([Function_name,'( x_1 , x_2 )'])

box on

axis tight


subplot(1,5,2);

hold on

for k1 = 1: size(position_history,1)

   for k2 = 1: size(position_history,2)

       plot(position_history(k1,k2,1),position_history(k1,k2,2),'.','markersize',1,'MarkerEdgeColor','k','markerfacecolor','k');

   end

end

plot(SHIO_best_particle_position(1),SHIO_best_particle_position(2),'.','markersize',10,'MarkerEdgeColor','r','markerfacecolor','r');

title('Search history (x1 and x2 only)')

xlabel('x1')

ylabel('x2')

box on

axis tight


subplot(1,5,3);

hold on

plot(Trajectories(1,:));

title('Trajectory of 1st Particle')

xlabel('Iteration#')

box on

axis tight


subplot(1,5,4);

hold on

semilogy(mean(fitness_history),'Color','g', 'LineWidth',2);

title('Average fitness of all Particles')

xlabel('Iteration#')

box on

axis tight


%Draw objective space

subplot(1,5,5);

semilogy(SHIO_convergence_curve,'Color','r')

title('Convergence curve')

xlabel('Iteration#');

ylabel('Best score obtained so far');

box on

axis tight

set(gcf, 'position' , [39         479        1727         267]);

%******************************************************** draw all shapes togather

⛄ 运行结果

⛄ 参考文献

Fakhouri, H. N., Hamad, F., & Alawamrah, A. (2022). Success history intelligent optimizer. The Journal of Supercomputing, 78(5), 6461-6502.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
1天前
|
传感器 算法
基于GA遗传算法的多机无源定位系统GDOP优化matlab仿真
本项目基于遗传算法(GA)优化多机无源定位系统的GDOP,使用MATLAB2022A进行仿真。通过遗传算法的选择、交叉和变异操作,迭代优化传感器配置,最小化GDOP值,提高定位精度。仿真输出包括GDOP优化结果、遗传算法收敛曲线及三维空间坐标点分布图。核心程序实现了染色体编码、适应度评估、遗传操作等关键步骤,最终展示优化后的传感器布局及其性能。
|
2天前
|
机器学习/深度学习 算法 安全
基于深度学习的路面裂缝检测算法matlab仿真
本项目基于YOLOv2算法实现高效的路面裂缝检测,使用Matlab 2022a开发。完整程序运行效果无水印,核心代码配有详细中文注释及操作视频。通过深度学习技术,将目标检测转化为回归问题,直接预测裂缝位置和类别,大幅提升检测效率与准确性。适用于实时检测任务,确保道路安全维护。 简介涵盖了算法理论、数据集准备、网络训练及检测过程,采用Darknet-19卷积神经网络结构,结合随机梯度下降算法进行训练。
|
3天前
|
算法 数据可视化 数据安全/隐私保护
一级倒立摆平衡控制系统MATLAB仿真,可显示倒立摆平衡动画,对比极点配置,线性二次型,PID,PI及PD五种算法
本课题基于MATLAB对一级倒立摆控制系统进行升级仿真,增加了PI、PD控制器,并对比了极点配置、线性二次型、PID、PI及PD五种算法的控制效果。通过GUI界面显示倒立摆动画和控制输出曲线,展示了不同控制器在偏转角和小车位移变化上的性能差异。理论部分介绍了倒立摆系统的力学模型,包括小车和杆的动力学方程。核心程序实现了不同控制算法的选择与仿真结果的可视化。
31 15
|
3天前
|
算法
基于SOA海鸥优化算法的三维曲面最高点搜索matlab仿真
本程序基于海鸥优化算法(SOA)进行三维曲面最高点搜索的MATLAB仿真,输出收敛曲线和搜索结果。使用MATLAB2022A版本运行,核心代码实现种群初始化、适应度计算、交叉变异等操作。SOA模拟海鸥觅食行为,通过搜索飞行、跟随飞行和掠食飞行三种策略高效探索解空间,找到全局最优解。
|
5天前
|
机器学习/深度学习 数据采集 算法
基于GWO灰狼优化的CNN-GRU-SAM网络时间序列回归预测算法matlab仿真
本项目基于MATLAB2022a,展示了时间序列预测算法的运行效果(无水印)。核心程序包含详细中文注释和操作视频。算法采用CNN-GRU-SAM网络,结合灰狼优化(GWO),通过卷积层提取局部特征、GRU处理长期依赖、自注意力机制捕捉全局特征,最终实现复杂非线性时间序列的高效预测。
|
5天前
|
传感器 算法 物联网
基于粒子群算法的网络最优节点部署优化matlab仿真
本项目基于粒子群优化(PSO)算法,实现WSN网络节点的最优部署,以最大化节点覆盖范围。使用MATLAB2022A进行开发与测试,展示了优化后的节点分布及其覆盖范围。核心代码通过定义目标函数和约束条件,利用PSO算法迭代搜索最佳节点位置,并绘制优化结果图。PSO算法灵感源于鸟群觅食行为,适用于连续和离散空间的优化问题,在通信网络、物联网等领域有广泛应用。该算法通过模拟粒子群体智慧,高效逼近最优解,提升网络性能。
|
6天前
|
机器学习/深度学习 存储 算法
近端策略优化(PPO)算法的理论基础与PyTorch代码详解
近端策略优化(PPO)是深度强化学习中高效的策略优化方法,广泛应用于大语言模型的RLHF训练。PPO通过引入策略更新约束机制,平衡了更新幅度,提升了训练稳定性。其核心思想是在优势演员-评论家方法的基础上,采用裁剪和非裁剪项组成的替代目标函数,限制策略比率在[1-ϵ, 1+ϵ]区间内,防止过大的策略更新。本文详细探讨了PPO的基本原理、损失函数设计及PyTorch实现流程,提供了完整的代码示例。
114 10
近端策略优化(PPO)算法的理论基础与PyTorch代码详解
|
1月前
|
算法 数据安全/隐私保护 计算机视觉
基于Retinex算法的图像去雾matlab仿真
本项目展示了基于Retinex算法的图像去雾技术。完整程序运行效果无水印,使用Matlab2022a开发。核心代码包含详细中文注释和操作步骤视频。Retinex理论由Edwin Land提出,旨在分离图像的光照和反射分量,增强图像对比度、颜色和细节,尤其在雾天条件下表现优异,有效解决图像去雾问题。
|
1月前
|
算法 数据可视化 安全
基于DWA优化算法的机器人路径规划matlab仿真
本项目基于DWA优化算法实现机器人路径规划的MATLAB仿真,适用于动态环境下的自主导航。使用MATLAB2022A版本运行,展示路径规划和预测结果。核心代码通过散点图和轨迹图可视化路径点及预测路径。DWA算法通过定义速度空间、采样候选动作并评估其优劣(目标方向性、障碍物距离、速度一致性),实时调整机器人运动参数,确保安全避障并接近目标。
148 68
|
1月前
|
算法 决策智能
基于SA模拟退火优化算法的TSP问题求解matlab仿真,并对比ACO蚁群优化算法
本项目基于MATLAB2022A,使用模拟退火(SA)和蚁群优化(ACO)算法求解旅行商问题(TSP),对比两者的仿真时间、收敛曲线及最短路径长度。SA源于金属退火过程,允许暂时接受较差解以跳出局部最优;ACO模仿蚂蚁信息素机制,通过正反馈发现最优路径。结果显示SA全局探索能力强,ACO在路径优化类问题中表现优异。

热门文章

最新文章