人工蜂群算法(二)

ABC算法步骤推荐这个,一步一步讲的很通透, http://mf.erciyes.edu.tr/abc/pub/Step%20by%20Step%20Procedure%20of%20ABC.pdf

跟着用MATLAB 写了下代码。


%/* ABC algorithm coded using MATLAB language */
clear all
close all
clc
global objfun D ub lb


%注:这里没有说明objfun是什么,但是屏现有的知识,可以判断,它对应学习资料《step by step procedure of
%ABC》上的f(x)= (x_1)^2+(x_2)^2

%Foods [FoodNumber][D]; /*Foods is the population of food sources. Each row of Foods matrix is a vector holding D parameters to be optimized. The number of rows of Foods matrix equals to the FoodNumber*/
%                       /*汉语解释Foods[][],它代表了食物源集,二维矩阵,不难理解,每行代表某食物源的D个属性,行数FoodNumber等于食物源数量*/
%ObjVal[FoodNumber];  /*f is a vector holding objective function values associated with food sources */
%                     /*ObjVal[]是个向量,存储了目标函数值*/
%Fitness[FoodNumber]; /*fitness is a vector holding fitness (quality) values associated with food sources*/
%                     /*Fitness[]是个向量,存储了fitness 值*/
%trial[FoodNumber]; /*trial is a vector holding trial numbers through which solutions can not be improved*/
%                   /*trial 是个向量,证明哪个食物源没被提高*/
%prob[FoodNumber]; /*prob is a vector holding probabilities of food sources (solutions) to be chosen*/
%                  /*prob 存储概率*/
%solution [D]; /*New solution (neighbour) produced by v_{ij}=x_{ij}+\phi_{ij}*(x_{kj}-x_{ij}) j is a randomly chosen parameter and k is a randomlu chosen solution different from i*/
%              /*solution [D] 产生一个新的食物源,用的公式
  • 9
    点赞
  • 50
    收藏
    觉得还不错? 一键收藏
  • 21
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 21
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值