1 内容介绍
人类学习优化(HumanLearningOptimizationAlgorithm,HLO)算法是由Wang等人于2014年提出的一种通过模拟人类学习机制进行全局优化的元启发类算法。该算法收敛速度快,全局寻优能力强不易陷入局部最优等优点,且设置参数少、算法简单易实现,已在多个应用问题上表现良好的性能。HLO算法中的每个个体可以通过3个学习算子即随机学习算子、个体学习算子和社会学习算子来模拟人类的3种学习行为进行寻优
2 仿真代码
function Rpopus= B2R(popus,dim,Xmax,Xmin)
%% Description
% 1.This function is to transform the binary code to real code to caculate
% the fitness function.
% 2.Input is the binary matrix popus with size [popsize,m].
% 3.Output is the real matrix Rpopus with size [popsize,1].
%% code starts
[popsize m] = size(popus);
bit = m / dim;
Rpopus = zeros(popsize,dim);
for i = 1:popsize
for d = 1:dim
for j = 1 + (d-1) * bit:d * bit
Rpopus(i,d) = Rpopus(i,d) + (popus(i,j) * 2^( d * bit -j));
end
Rpopus(i,d) = Xmin + (Xmax - Xmin) * (Rpopus(i,d) / ( 2^bit - 1));
end
end
end
3 运行结果
4 参考文献
[1] Wang L , Yang R , Ni H , et al. A human learning optimization algorithm and its application to multi-dimensional knapsack problems[J]. Applied Soft Computing, 2015.