【智能优化算法-倭黑猩猩算法】基于倭黑猩猩优化算法求解多目标优化问题附matlab代码

1 内容介绍

非传统的优化工具已经证明了它们在解决各种优化问题方面的潜力。这些问题处理单个目标或多个/多个目标。倭黑猩猩优化器(BO)是一种智能自适应元启发式优化算法,灵感来自倭黑猩猩的社会行为和繁殖策略。文献中没有研究扩展这个 BO 来解决多目标优化问题。本文提出了一种多目标 Bonobo 优化器 (MOBO) 来解决不同的优化问题。本文提出了三个不同版本的 MOBO,每个版本都使用不同的方法,例如自适应网格方法的非支配排序;一种使用拥挤距离方法对人口进行排序的排序方案;分解技术,其中解决方案是通过将一个多目标问题分解为多个单目标问题来获得的。提议的 MOBO 的所有三个不同版本的性能已经在一组 30 个多样化的基准测试功能上进行了测试,并将结果与文献中可用的其他四种著名的多目标优化技术的结果进行了比较。获得的结果表明,与其他算法相比,所提出算法的前两个版本在收敛性和多样性方面表现出色或具有竞争力。

tled attacker, barrier, chaser, and driver are employed for simulating the diverse intelligence. Moreover, the four main steps of hunting, driving, blocking, and attacking, are implemented. Afterward, the algorithm is tested on 30 well-known benchmark functions, and the results are compared to four newly proposed meta-heuristic algorithms in term of convergence speed, the probability of getting stuck in local minimums, and the accuracy of obtained results. The results indicate that the ChOA outperforms the other benchmark optimization algorithms.

2 仿真代码

function [new_pops] = NondominatedSort_and_filling(pop, nobj, ncon, nreal, nbin)
N = size(pop,1);
fitsize = N/2;
[sorted_ranks, rankID] = sort(pop(:,nobj+ncon+nreal+nbin+2));
parentID = []; front = 1; front_array = [];
while size(parentID,2) < fitsize
    for i=1:N
        if sorted_ranks(i) ~= front
            break
        end
        front_array = [front_array rankID(i)];
    end
    size_check = size(parentID,2) + size(front_array,2);
    if size_check == fitsize
        parentID = [parentID front_array];
        break
    elseif size_check < fitsize
        parentID = [parentID front_array];
        sorted_ranks(1:size(front_array,2)) = [];
        rankID(1:size(front_array,2)) = [];
        N = N - size(front_array,2);
        front = front+1;
        front_array = [];
    else
        miss_size = fitsize - (size_check - size(front_array,2));
        n_consviol = nobj+ncon+nreal+nbin+1;
        n_rank= nobj+ncon+nreal+nbin+2;
        n_crowd = n_rank+1;

        if ncon==0,% if the problem does not have any constraints
           
            % sort crowding distance and select miss_size number of top individuals  
            % and add them to the parent pop
            [~, distID] = sort(pop(front_array,n_crowd), 'descend');
            parentID = [parentID front_array(distID(1:miss_size))];
            
        else % if the problem have constraints
            
            %calculate the number of the feasible individuals
            feasible_ind=find(pop(front_array,n_consviol)==0);
            feasible_ind=(front_array(feasible_ind));
            number_feasible_ind=length(feasible_ind);
            
            if  number_feasible_ind > miss_size,   
                % sort feasible individuals based on crowdind distance 
                % select the best miss_size of them and add them to parent
                % pop
                [~, distID] = sort(pop(feasible_ind,n_crowd), 'descend');
                parentID = [parentID feasible_ind(distID(1:miss_size))];       
            elseif number_feasible_ind == miss_size,
                parentID = [parentID feasible_ind]; 
            else % where number_feasible_ind < miss_size,
                % sort based on the constraint violation,
                [~, consviolationID] = sort(pop(front_array,n_consviol), 'descend');
                parentID = [parentID front_array(consviolationID(1:miss_size))];
            end
        end
    end
end
new_pops = pop(parentID,:);
end


function pop = Rank_and_Crowding_Distance_Calculation(pop, nobj, ncon, nreal, nbin)
global INF
N = size(pop,1);
P = [pop (1:N)'];
obj_max = max(pop(:,1:nobj));
obj_min = min(pop(:,1:nobj));
r = 1;
while N ~= 0
    % NON-DOMINATION SORTING
    p = simple_sort(N,P,nobj,ncon,nreal,nbin);
    n_p = size(p,2);
    globID = P(p,end);
    % ASSIGN THE RANKS OF INDIVIDUALS
    pop(globID,nobj+ncon+nreal+nbin+2) = r;
    % COMPUTE THE CROWDING DISTANCE
    if n_p == 1
        pop(globID,end) = INF;
    elseif n_p == 2
        pop(globID(1),end) = INF;
        pop(globID(2),end) = INF;
    else
        d = zeros(n_p,1);
        for i=1:nobj
            [~, m_ID] = sort(pop(globID,i));
            m_ID = globID(m_ID);
            d(1) = INF; d(end) = INF;
            for j=2:n_p-1
                d(j,1) = d(j,1) + abs((pop(m_ID(j+1),i)-pop(m_ID(j-1),i))) / (obj_max(1,i)-obj_min(1,i));
            end
        end
        pop(m_ID,end) = d;
    end
    r = r+1;
    N = N - n_p;
    P(p,:) = [];
end
%--------------------------------------------------------------------------------------------
function p = simple_sort(N,P,nobj,ncon,nreal,nbin)
p = [];
j_dom_i = 0;
for i=1:N
    for j=1:N
        if j ~= i
            j_dom_i = DominanceChecking(P(j,:), P(i,:), nobj, ncon, nreal, nbin); 
            % 1: j dominates i; -1: i dominates j; 0: both are non-dominated.
            if j_dom_i == 1
                break
            end
        end
    end
    if j_dom_i ~= 1
        p=[p i];
    end
    j_dom_i = 0;
end
 

3 运行结果

4 参考文献

[1] Das A K ,  Nikum A K ,  Krishnan S V , et al. Multi-objective Bonobo Optimizer (MOBO): an intelligent heuristic for multi-criteria optimization[J]. Knowledge and Information Systems, 2020, 62(6).

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值