多目标杜鹃搜索 (MOCS)优化算法(Matlab代码实现)

 个人主页:研学社的博客 

欢迎来到本博客❤️❤️

博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

目录

1 概述

2 运行结果

3 参考文献

4 Matlab代码及文章阅读

1 概述

工程中的大多数设计优化问题通常是高度非线性的,在复杂的约束条件下涉及许多不同的设计变量。这些约束可以写成简单的边界,如材料特性范围,也可以写成非线性关系,包括最大应力、最大挠度、最小承载能力和几何构型。这种非线性通常导致多模态响应。随后,局部搜索算法(如hillclimbing和Nelder-Mead下坡单纯形方法)不适用,应仅使用全局算法以获得最优解。

Yang和Deb(2009)开发了一种新的元启发式优化算法,称为Cuckoo Search(CS)。本文使用一些标准测试函数和新设计的随机测试函数进行了更广泛的比较研究。然后,我们应用CS算法解决工程设计优化问题,包括弹簧和焊接梁结构的设计。CS获得的最优解远优于高效粒子群优化器获得的最佳解。我们将讨论CS中使用的独特搜索功能及其对进一步研究的启示。

2 运行结果

多目标杜鹃搜索 (MOCS)优化算法(Matlab代码实现)_第1张图片

部分代码:

for j=1:n,
    s=nest(j,:);
    %% Levy flights by Mantegna's algorithm
    u=randn(size(s))*sigma;
    v=randn(size(s));
    step=u./abs(v).^(1/beta);
    stepsize=0.1*step.*(s-best);
    % Now the actual random walks or flights
    s=s+stepsize.*randn(size(s));
   % Apply simple bounds/limits
   nest(j,:)=simplebounds(s,Lb,Ub);
end

%% Replace some nests by constructing new solutions/nests
function new_nest=empty_nests(nest,Lb,Ub,pa)
% A fraction of worse nests are discovered with a probability pa
[n,d]=size(nest);
% The solutions represented by cuckoos to be discovered or not 
% with a probability pa. This action is implemented as a status vector
K=rand(size(nest))>pa; 
%% New solution by biased/selective random walks
stepsize=rand(1,d).*(nest(randperm(n),:)-nest(randperm(n),:));
new_nest=nest+stepsize.*K;
for j=1:size(new_nest,1)
    s=new_nest(j,:);
    new_nest(j,:)=simplebounds(s,Lb,Ub);  
end

% Application of simple bounds
function s=simplebounds(s,Lb,Ub)
  % Apply the lower bound
  ns_tmp=s;
  I=ns_tmp   ns_tmp(I)=Lb(I);
  
  % Apply the upper bounds 
  J=ns_tmp>Ub;
  ns_tmp(J)=Ub(J);
  % Update this new move 
  s=ns_tmp;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Objective functions 
function f = obj_funs(x, m)
% Zitzler-Deb-Thiele's funciton No 3 (ZDT function 3)
% M = # of objectives
% d = # of variables/dimensions
d=length(x);  % d=30 for ZDT 3
% First objective f1
f(1) = x(1);
g=1+9/29*sum(x(2:d));
h=1-sqrt(f(1)/g)-f(1)/g*sin(10*pi*f(1));
% Second objective f2
f(2) = g*h;
%%%%%%%%%%%%%%%%%% end of the definitions of obojectives %%%%%%%%%%%%%%%%%%

function new_Sol = Select_pop(nest, m, ndim, npop)
% The input population to this part has twice (ntwice) of the needed 
% population size (npop). Thus, selection is done based on ranking and 
% crowding distances, calculated from the non-dominated sorting
ntwice= size(nest,1);
% Ranking is stored in column Krank
Krank=m+ndim+1;
% Sort the population of size 2*npop according to their ranks
[~,Index] = sort(nest(:,Krank)); sorted_nest=nest(Index,:);
% Get the maximum rank among the population
RankMax=max(nest(:,Krank)); 

3 参考文献

部分理论来源于网络,如有侵权请联系删除。

多目标杜鹃搜索 (MOCS)优化算法(Matlab代码实现)_第2张图片

4 Matlab代码及文章阅读

你可能感兴趣的:(#,单,多目标智能算法,算法,多目标布谷鸟,MOCS)