【智能优化算法】反对流定向算法MATLAB代码

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

个人主页:Matlab科研工作室

个人信条:格物致知。

⛄ 内容介绍

反对流定向算法MATLAB代码

⛄ 部分代码

% Opposition Flow Direction Algorithm (OFDA) source Code Version 1.0

%

% Developed in MATLAB R2018b

%

% Author and programmer: 

% Dr Manoj Kumar Naik

% Faculty of Engineering and Technology, Siksha O Anusandhan, Bhubaneswar, Odisha ?751030, India 

%_____________________________________________________________________________________________________           

% Please cite to the main paper:

% R. Panda, M. Swain, M. K. Naik, S. Agrawal, and A. Abraham, 

% 揂 Novel Practical Decisive Row-class Entropy-based Technique for Multilevel Threshold Selection 

% Using Opposition Flow Directional Algorithm,?IEEE Access, p. 1, 2022, doi: 10.1109/ACCESS.2022.3215082.

%

% This program using the framework of FDA by SEYEDALI MIRJALILI

% https://seyedalimirjalili.com/projects

%_____________________________________________________________________________________________________

clearvars

close all

clc

disp('The OFDA is tracking the problem');

alpha=30; % Number of flow

Function_name='F3' % Name of the test function that can be from F1 to F23 

MaxIT=500; % Maximum number of iterations

[lb,ub,dim,fobj]=Get_Functions_details(Function_name); % Function details

Times=11; %Number of independent times you want to run the OFDA

display(['Number of independent runs: ', num2str(Times)]);

for i=1:Times

[Destination_fitness(i),bestPositions(i,:),Convergence_curve(i,:)]=OFDA(alpha,MaxIT,lb,ub,dim,fobj);

display(['The optimal fitness of OFDA is: ', num2str(Destination_fitness(i))]);

end

[bestfitness,index]=min(Destination_fitness);

disp('--------Best Fitness, Average Fitness, Standard Deviation and Best Solution--------');

display(['The best fitness of OFDA is: ', num2str(bestfitness)]);

display(['The average fitness of OFDA is: ', num2str(mean(Destination_fitness))]);

display(['The standard deviation fitness of OFDA is: ', num2str(std(Destination_fitness))]);

display(['The best location of OFDA is: ', num2str(bestPositions(index,:))]);

figure('Position',[269   240   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(Convergence_curve(index,:),'LineWidth',3);

xlabel('Iterations');

ylabel('Best fitness obtained so far');

legend('OFDA');

box on;

axis tight;

grid off;

⛄ 运行结果

【智能优化算法】反对流定向算法MATLAB代码_第1张图片

【智能优化算法】反对流定向算法MATLAB代码_第2张图片

【智能优化算法】反对流定向算法MATLAB代码_第3张图片

⛄ 参考文献

R. Panda, M. Swain, M. K. Naik, S. Agrawal, and A. Abraham,  Novel Practical Decisive Row-class Entropy-based Technique for Multilevel Threshold Selection Using Opposition Flow Directional Algorithm,?IEEE Access, p. 1, 2022, doi: 10.1109/ACCESS.2022.3215082.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

你可能感兴趣的:(优化求解,matlab,算法,开发语言)