💥1 概述
文献来源:
本文旨在研究混沌引力搜索算法( CGSA )在求解焊接梁设计( WBD )、压缩弹簧设计( CSD )和压力容器设计( PVD )等机械工程设计框架中的性能。
本研究将十个混沌映射与引力常数相结合,以增加引力搜索算法( GSA )的开发能力。此外,CGSA还用于保持引力常数的自适应能力。此外,混沌映射被用于克服标准GSA的早熟收敛和陷入局部极小的问题。
📚2 运行结果
部分代码:
function [Fbest,Lbest,BestChart]=GSA(Benchmark_Function_ID,N,Max_Iteration,ElitistCheck,min_flag,Rpower) %V: Velocity. %a: Acceleration. %M: Mass. Ma=Mp=Mi=M; %dim: Dimension of the test function. %N: Number of agents. %X: Position of agents. dim-by-N matrix. %R: Distance between agents in search space. %[low-up]: Allowable range for search space. %Rnorm: Norm in eq.8. %Rpower: Power of R in eq.7. Rnorm=2; %get allowable range and dimension of the test function. [down,up,dim]=benchmark_functions_details(Benchmark_Function_ID); %random initialization for agents. X=initialization(dim,N,up,down); %create the best so far chart and average fitnesses chart. BestChart=[]; V=zeros(dim,N); for iteration=1:Max_Iteration % iteration %Checking allowable range. X=space_bound(X,up,down); %Evaluation of agents. fitness=evaluateF(X,Benchmark_Function_ID); if min_flag==1 [best, best_X]=min(fitness); %minimization. else [best best_X]=max(fitness); %maximization. end if iteration==1 Fbest=best;Lbest=X(:,best_X); end if min_flag==1 if best<Fbest %minimization. Fbest=best;Lbest=X(:,best_X); end else if best>Fbest %maximization Fbest=best;Lbest=X(:,best_X); end end BestChart=[BestChart Fbest]; %Calculation of M. eq.14-20 [M]=massCalculation(fitness,min_flag); %Calculation of Gravitational constant. eq.13. G=Gconstant(iteration,Max_Iteration); %Calculation of accelaration in gravitational field. eq.7-10,21. a=Gfield(M,X,G,Rnorm,Rpower,ElitistCheck,iteration,Max_Iteration); %Agent movement. eq.11-12 [X,V]=move(X,a,V); end %iteration
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。