✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
This paper introduces a new stochastic bio-inspired optimization algorithm, denoted as seasons optimization (SO) algorithm.This algorithm is inspired by the growth cycle of trees in diferent seasons of a year. It is an iterative and population-based algorithm working with a population of initial solutions known as a forest. Each individual in the forest is referred to as a tree. Until the termination conditions are satisfed, the trees in the forest are updated to a new generation by applying four operators similar to the trees’ life cycles in nature: renew, competition, seeding, and resistance. These operators hopefully cause the trees to converge towards the global optimum of the optimization problem. The efectiveness of the proposed SO algorithm is evaluated using multi-variable single-objective test problems and compared with several well-known baseline and state-of-the-art algorithms. The results show that the proposed algorithm outperformed its counterparts in terms of solution quality and fnding the global optimum on most benchmark functions.
⛄ 部分代码
clear all;
clc;
close all
%% Problem Statement
ProblemParams.CostFuncName = 'F4';
objFunc= 'F4';
[fobj, lowerbound, upperbound, globalCost, dimension]=GetBenchmarkFunction(ProblemParams.CostFuncName);
ProblemParams.CostFuncName=fobj;
ProblemParams.lb=lowerbound;
ProblemParams.ub=upperbound;
ProblemParams.NPar = dimension;
ProblemParams.gcost=globalCost;
ProblemParams.VarMin =ProblemParams.lb;
ProblemParams.VarMax = ProblemParams.ub;
if numel(ProblemParams.VarMin)==1
ProblemParams.VarMin=repmat(ProblemParams.VarMin,1,ProblemParams.NPar);
ProblemParams.VarMax=repmat(ProblemParams.VarMax,1,ProblemParams.NPar);
end
ProblemParams.SearchSpaceSize = ProblemParams.VarMax - ProblemParams.VarMin;
AlgorithmParams.NumOfTrees = 8;
AlgorithmParams.NumOfYears = 50;
AlgorithmParams.Pmin = 0.4;
AlgorithmParams.Pmax = 0.6;
%% Main Loop
for year= 1:AlgorithmParams.NumOfYears
p=AlgorithmParams.Pmax-(year/AlgorithmParams.NumOfYears)*(AlgorithmParams.Pmax-AlgorithmParams.Pmin); %pr, ps and pw are in the range [0.4, 0.6]
AlgorithmParams.RenewRate=p;
AlgorithmParams.SeedingRate=p;
AlgorithmParams.ColdThreshold=p;
AlgorithmParams.CompetitionRate = p;
%% Spring Season
if (year==1)
InitialTrees = CreateForest(AlgorithmParams, ProblemParams);
Forest=InitialTrees;
InitialCost = feval(ProblemParams.CostFuncName,InitialTrees);
Forest(:,end+1) = InitialCost;
else
Forest = Renew(Forest, Seeds, AlgorithmParams, ProblemParams);
end
%% Summer Season (Growth & Competition)
[Forest] = Competition (Forest, AlgorithmParams, ProblemParams, year);
%% Autumn Season
Seeds = Seeding(Forest,AlgorithmParams, ProblemParams);
s=size(Seeds,1);
AlgorithmParams.s=s;
%% Winter Season
Forest = Resistance(Forest,AlgorithmParams, ProblemParams);
Costs = Forest(:,end);
MinimumCost(year) = min(Costs);
fprintf('Minimum Cost in Iteration %d is %3.16f \n', year,MinimumCost(year));
end
figure;
subplot(121)
func_plot(objFunc);
title(objFunc)
xlabel('x_1');
ylabel('x_2');
zlabel([objFunc,'( x_1 , x_2 )'])
subplot(122)
semilogy(MinimumCost,'LineWidth',3);
xlabel('Iterations');
ylabel('Best fitness obtained so far');
legend('SOA');
box on;
axis tight;
grid off;
⛄ 运行结果
⛄ 参考文献
Emami, Hojjat. “Seasons Optimization Algorithm.” Engineering with Computers, vol. 38, no. 2, Springer Science and Business Media LLC, Aug. 2020, pp. 1845–65, doi:10.1007/s00366-020-01133-5.