【优化求解】基于樽海鞘算法求解单目标问题matlab代码

160 阅读1分钟

1 简介

这个算法是 Mirjalili 等人2017年在文章《Salp Swarm Algorithm:A bio-inspired optimizer for engineering design problems》中介绍的一个模拟樽海鞘生物的智能优化算法。它对于一些优化问题具有很强的优越性,当然它也会包含一些类似于粒子群等算法相关的内容。

2 部分代码

%---------------------------------------------------------------------%

%  Salp Swarm Algorithm (SSA) source codes demo version               %

%---------------------------------------------------------------------%

%---Inputs-----------------------------------------------------------

% feat     : feature vector ( Instances x Features )

% label    : label vector ( Instances x 1 )

% N        : Number of salps

% max_Iter : Maximum number of iterations

%---Output-----------------------------------------------------------

% sFeat    : Selected features (instances x features)

% Sf       : Selected feature index

% Nf       : Number of selected features

% curve    : Convergence curve

%--------------------------------------------------------------------

%% Salp Swarm Algorithm

clc, clear, close; 

% Benchmark data set 

load ionosphere.mat; 

% Set 20% data as validation set

ho = 0.2; 

% Hold-out method

HO = cvpartition(label,'HoldOut',ho);

% Parameter setting

N        = 10;

max_Iter = 100; 

% Salp Swarm Algorithm

[sFeat,Sf,Nf,curve] = jSSA(feat,label,N,max_Iter,HO);

% Plot convergence curve

plot(1:max_Iter,curve);

xlabel('Number of iterations');

ylabel('Fitness Value');

title('SSA'); grid on;


3 仿真结果

4 参考文献

[1]陈涛, 王梦馨, & 黄湘松. (2018). 基于樽海鞘群算法的无源时差定位. 电子与信息学报, 40(7), 7.

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

5 MATLAB代码与数据下载地址

见博客主页