├── Practical issues - 开源用 ├── 1. Four engineering constrained design problems.zip ├── 10.Optimization of vehicle scheduling for cold chain distribution logistics of a dairy product enterprise.zip ├── 11.Plasma trajectory planning for 6R industrial robots.zip ├── 12.The problem of TSP and its variants.zip ├── 2. AFO algorithm optimises neural networks.zip ├── 3. Aviation scheduling - multi-sector scheduling.zip ├── 4. Flexible workshop scheduling.zip ├── 5. Grid map - robot routing.zip ├── 6. Logistics centre site selection issues.zip ├── 7. Multi-row layout of the workshop combined with AGV zoning.zip ├── 8. Oil plant - 3D map - aircraft pathfinding.zip ├── 9. Optimisation of power system bus types based on tide calculation.zip └── readme.txt ├── README.md ├── UpdateLog.txt └── benchmark functions ├── AFO1.m ├── AFO2.m ├── AFO3.m ├── Get_Functions_details.m ├── README.md ├── UpdateLog.txt ├── checkX.m ├── fitFCN_BX.m ├── func_plot.m └── main1.m /Practical issues - 开源用/1. Four engineering constrained design problems.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/1. Four engineering constrained design problems.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/10.Optimization of vehicle scheduling for cold chain distribution logistics of a dairy product enterprise.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/10.Optimization of vehicle scheduling for cold chain distribution logistics of a dairy product enterprise.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/11.Plasma trajectory planning for 6R industrial robots.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/11.Plasma trajectory planning for 6R industrial robots.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/12.The problem of TSP and its variants.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/12.The problem of TSP and its variants.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/2. AFO algorithm optimises neural networks.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/2. AFO algorithm optimises neural networks.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/3. Aviation scheduling - multi-sector scheduling.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/3. Aviation scheduling - multi-sector scheduling.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/4. Flexible workshop scheduling.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/4. Flexible workshop scheduling.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/5. Grid map - robot routing.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/5. Grid map - robot routing.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/6. Logistics centre site selection issues.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/6. Logistics centre site selection issues.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/7. Multi-row layout of the workshop combined with AGV zoning.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/7. Multi-row layout of the workshop combined with AGV zoning.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/8. Oil plant - 3D map - aircraft pathfinding.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/8. Oil plant - 3D map - aircraft pathfinding.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/9. Optimisation of power system bus types based on tide calculation.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TwilightArchonYz/A-new-Nature-inspired-optimization-algorithm-AFO/ff0127161d33fe20d0e4df996fb5e3e9c900208d/Practical issues - 开源用/9. Optimisation of power system bus types based on tide calculation.zip -------------------------------------------------------------------------------- /Practical issues - 开源用/readme.txt: -------------------------------------------------------------------------------- 1 | This is a simple collection of applications containing a number of practical application problems being solved by the AFO algorithm, with more practical applications to be added subsequently 2 | (1) The four industrial design problems with constraints mentioned in the paper 3 | (2) Optimising the weights and thresholds of neural networks 4 | (3) Aviation scheduling - multi-sector 5 | (4) Flexible shop floor scheduling 6 | (5) Raster maps - robot pathfinding 7 | (6) Logistics centre location problem: factory-centre-demand point 8 | (7) Multi-row shop floor scheduling - considering AVG partitioning 9 | (8) Oil plant-unmanned aircraft up path planning 10 | (9) Power system bus optimization based on tide calculation 11 | (10) Optimization study of cold chain distribution logistics vehicle scheduling for a dairy company 12 | (11) Plasma processing trajectory planning for 6R industrial robots 13 | (12) TSP problem and its variants 14 | Notes. 15 | (1) All code is written using matlab 2021a, but there may be compatibility problems between matlab 2021a and previous versions, and garbled codes may appear. If the code is garbled, use txt to open it and copy the code from txt to .m file 16 | (2) Improved algorithms for AFO will be added later, as well as more application examples. The lab has participated in and completed hundreds of applications based on swarm intelligence, including power systems, workshop scheduling, logistics and distribution, site layout, UAV path planning, robot path planning, complex network optimisation, resource scheduling, optimisation of various machine learning algorithms and other directions. The lab will continue to select classic cases to add to this code collection, so please stay tuned. If you need code for a particular direction, please leave a message or contact us by email. 17 | (3) Our lab has published a large number of high-level improvement algorithms, which will be added to this code collection one after another, so please pay attention to them. 18 | 19 | 这是一个简单的应用集合,包含了一些实际应用问题被AFO算法求解,后续会添加更多的实际应用案例 20 | (1)论文中提及的四种带约束的工业设计问题 21 | (2)优化神经网络的权值和阈值 22 | (3)航空调度-多扇区 23 | (4)柔性车间调度 24 | (5)栅格地图-机器人寻路 25 | (6)物流中心选址问题:工厂-中心-需求点 26 | (7)多行车间调度-考虑AVG分区 27 | (8)石油厂区-无人机了路径规划 28 | (9)基于潮流计算的电力系统总线优化 29 | (10)某乳制品企业冷链配送物流车辆调度优化研究 30 | (11)面向6R工业机器人等离子加工轨迹规划 31 | (12)TSP问题及其变种问题 32 | 注意: 33 | (1)所有代码使用matlab2021a编写,但matlab 2021a和之前版本可能存在兼容问题,有可能出现乱码。如果乱码,使用txt打开,再将txt中的代码复制到.m文件当中 34 | (2)后续会添加AFO的改进算法,以及更多的应用案例。本实验室参与并完成了各类基于群智能优化的应用项目数百例,涉及电力系统,车间调度,物流配送,选址布局,无人机路径规划、机器人路径规划,复杂网络优化,资源调度,优化各类机器学习算法等各个方向。本实验室会继续挑选经典案例添加到本代码集合当中,请及时关注。如果需要某个方向的代码,可以留言或者邮箱联系。 35 | (3)本实验室发表过大量高水平改进算法,会陆续添加到本代码集中,请多多关注。 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A-new-nature-inspired-optimization-algorithm-AFO 2 | A new nature-inspired optimization algorithm: Aptenodytes Forsteri Optimization algorithm (AFO) 3 | %%--------------------------------------------%% 4 | 5 | Paper 6 | 7 | Yang Z, Deng L B, Wang Y, et al. Aptenodytes Forsteri Optimization: Algorithm and applications[J]. Knowledge-Based Systems, 2021, 232: 107483. 8 | 9 | %%--------------------------------------------%% 10 | 11 | 更新日志 Updating Log 12 | 13 | 2022.3.25 14 | 15 | Version 1.3 16 | 17 | It is experimentally found that the gradient estimation strategy is less efficient in most cases. Here the replacement is Gaussian perturbation with a perturbation step of x_c the average distance from x 18 | 19 | x_new=x_c+Rn*(x_r1-x_r2).*Dm 20 | 21 | where x_new is the new individual position; Rn is a 1xN matrix of random numbers obeying normal distribution; x_r1 and x_r2 are the positions of the r1st and r2nd penguins in the population, r1 and r2 are randomly generated, and Dm is the average distance of x_c from all penguins in the population in each dimension, a 1xN matrix. 22 | 23 | Ps:Perturbation step of x_c distance x_m is also a good choice, interested in their own experiments. 24 | 25 | 实验发现,在大多数情况下,梯度估计策略的效率较低。这里的替换是高斯扰动,扰动步长为x_c,与x的平均距离为x 26 | 27 | x_new=x_c+Rn*(x_r1-x_r2).*Dm 28 | 29 | 其中,x_new是新个体位置; Rn是一个1xN的随机数矩阵,服从正态分布; x_r1和x_r2是种群中第r1和第r2只企鹅的位置,r1和r2随机生成,Dm是x_c距离种群中所有企鹅在每一个维度上的平均距离,是一个1xN的矩阵。 30 | 31 | 注:可以讲基准参考从当前企鹅位置X替换为企鹅记忆中最优位置X_m. 32 | 33 | %%--------------------------------------------%% 34 | 这里有两个文件夹,一个是AFO在标准测试集上的实验的代码,一个是AFO在一些实际问题上的应用 35 | 除去论文提到的四个工业设计问题,还有其他问题再该集合当中,具体目录如下 36 | (1)论文中提及的四种带约束的工业设计问题 37 | (2)优化神经网络的权值和阈值 38 | (3)航空调度-多扇区 39 | (4)柔性车间调度 40 | (5)栅格地图-机器人寻路 41 | (6)物流中心选址问题:工厂-中心-需求点 42 | (7)多行车间调度-考虑AVG分区 43 | (8)石油厂区-无人机路径规划 44 | (9)基于潮流计算的电力系统总线优化 45 | (10)某乳制品企业冷链配送物流车辆调度优化研究 46 | (11)面向6R工业机器人等离子加工轨迹规划 47 | (12)TSP问题及其变种问题 48 | 注意: 49 | (1)所有代码使用matlab2021a编写,但matlab 2021a和之前版本可能存在兼容问题,有可能出现乱码。如果乱码,使用txt打开,再将txt中的代码复制到.m文件当中 50 | (2)后续会添加AFO的改进算法,以及更多的应用案例。本实验室参与并完成了各类基于群智能优化的应用项目数百例,涉及电力系统,车间调度,物流配送,选址布局,无人机路径规划、机器人路径规划,复杂网络优化,资源调度,优化各类机器学习算法等各个方向。本实验室会继续挑选经典案例添加到本代码集合当中,请及时关注。如果需要某个方向的代码,可以留言或者邮箱联系。 51 | (3)本实验室发表过大量高水平改进算法,会陆续添加到本代码集中,请多多关注。 52 | 53 | There are two folders, one for the code of AFO experiments on the standard test set and one for the application of AFO to some practical problems 54 | In addition to the four industrial design problems mentioned in the thesis, there are other problems in the collection, which are listed below 55 | (1) The four industrial design problems with constraints mentioned in the paper 56 | (2) Optimising the weights and thresholds of neural networks 57 | (3) Aviation scheduling: multi-sector 58 | (4) Flexible workshop scheduling 59 | (5) Raster maps: robot pathfinding 60 | (6) Logistics centre location problem: factory-centre-demand point 61 | (7) Multi-row shop floor layout considering AVG partitioning 62 | (8) Oil plants: UAVs for path planning 63 | (9) Power system bus optimization based on tide calculation 64 | (10) Optimization study of cold chain distribution logistics vehicle scheduling for a dairy company 65 | (11) Plasma processing trajectory planning for 6R industrial robots 66 | (12) TSP problem and its variant problems 67 | 68 | Notes. 69 | (1) All code is written using matlab 2021a, but there may be compatibility problems between matlab 2021a and previous versions, and garbled codes may appear. If the code is garbled, use txt to open it and copy the code from txt to .m file 70 | (2) Improved algorithms for AFO will be added later, as well as more application examples. The lab has participated in and completed hundreds of applications based on swarm intelligence, including power systems, workshop scheduling, logistics and distribution, site layout, UAV path planning, robot path planning, complex network optimisation, resource scheduling, optimisation of various machine learning algorithms and other directions. The lab will continue to select classic cases to add to this code collection, so please stay tuned. If you need code for a particular direction, please leave a message or contact us by email. 71 | (3) Our lab has published a large number of high-level improvement algorithms, which will be added to this code collection one after another, so please pay attention to them. 72 | %%--------------------------------------------%% 73 | Copy right 74 | 你可以免费使用本代码库中的所有代码,但是请注明出处并引用相关的参考文献。 75 | You are free to use all the code in this code base, but please give credit and cite the relevant references. 76 | %%--------------------------------------------%% 77 | 作者:杨喆 78 | 邮箱:454170989@qq.com 79 | 学校:英国曼彻斯特大学 80 | Author:Yang Zhe 81 | E-mail: 454170989@qq.com 82 | School: University of Manchester, UK 83 | %%--------------------------------------------%% 84 | 逍遥一世 85 | 人生如梦未醒时,一半年华皆梦中。 86 | 自言行乐朝朝是,岂料浮生渐渐忙。 87 | 年年九陌看春还,旧隐空劳梦寐间。 88 | 弥起长恨欢娱少,繁星闪烁度华年。 89 | 浮生未歇几时欢,心系虚妄怎逍遥。 90 | 91 | 人心多是少相投,非识尘中上品流。 92 | 人是人非意颇同,较量此事尽归空。 93 | 无为政化求真理,方表深仁大道雄。 94 | 铸鼎铭钟封爵邑,功名让与英雄立。 95 | 浮生聚散是浮萍,何须日夜苦蝇营。 96 | 97 | 笑看沧海欲成尘,王母花前别众真。 98 | 千岁却归天上去,一心珍重世间人。 99 | 直上五云云路稳,紫鸾朱凤自来迎。 100 | 人间天上尽修行,七宝山高混太清。 101 | 自觉浮生幻化事,逍遥快乐实善哉。 102 | 103 | ——逍遥浮世,与道俱成 104 | %%--------------------------------------------%% 105 | [![View A-new-Nature-inspired-optimization-algorithm-AFO on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://ww2.mathworks.cn/matlabcentral/fileexchange/85700-a-new-nature-inspired-optimization-algorithm-afo) 106 | -------------------------------------------------------------------------------- /UpdateLog.txt: -------------------------------------------------------------------------------- 1 | Update log. 2 | 2021.9.3 3 | Version 1.2 4 | This update adds a collection of practical applications of AFO, including some practical application problems solved by the AFO algorithm, and more practical applications will be added later. 5 | (1) The four industrial design problems with constraints mentioned in the paper 6 | (2) Optimising the weights and thresholds of neural networks 7 | (3) Aviation scheduling: multi-sector 8 | (4) Flexible workshop scheduling 9 | (5) Raster maps: robot pathfinding 10 | (6) Logistics centre location problem: factory-centre-demand point 11 | (7) Multi-row shop floor layout considering AVG partitioning 12 | (8) Oil plants: UAVs for path planning 13 | (9) Power system bus optimization based on tide calculation 14 | (10) Optimization study of cold chain distribution logistics vehicle scheduling for a dairy company 15 | (11) Plasma processing trajectory planning for 6R industrial robots 16 | (12) TSP problem and its variant problems 17 | Notes. 18 | (1) All code is written using matlab 2021a, but there may be compatibility problems between matlab 2021a and previous versions, and garbled codes may appear. If the code is garbled, use txt to open it and copy the code from txt to .m file 19 | (2) Improved algorithms for AFO will be added later, as well as more application examples. The lab has participated in and completed hundreds of applications based on swarm intelligence, including power systems, workshop scheduling, logistics and distribution, site layout, UAV path planning, robot path planning, complex network optimisation, resource scheduling, optimisation of various machine learning algorithms and other directions. The lab will continue to select classic cases to add to this code collection, so please stay tuned. If you need code for a particular direction, please leave a message or contact us by email. 20 | (3) Our lab has published a large number of high-level improvement algorithms, which will be added to this code collection one after another, so please pay attention to them. 21 | 22 | 本次更新添加了AFO的实际应用集合,包含了一些实际应用问题被AFO算法求解,后续会添加更多的实际应用案例 23 | (1)论文中提及的四种带约束的工业设计问题 24 | (2)优化神经网络的权值和阈值 25 | (3)航空调度-多扇区 26 | (4)柔性车间调度 27 | (5)栅格地图-机器人寻路 28 | (6)物流中心选址问题:工厂-中心-需求点 29 | (7)多行车间调度-考虑AVG分区 30 | (8)石油厂区-无人机了路径规划 31 | (9)基于潮流计算的电力系统总线优化 32 | (10)某乳制品企业冷链配送物流车辆调度优化研究 33 | (11)面向6R工业机器人等离子加工轨迹规划 34 | (12)TSP问题及其变种问题 35 | 注意: 36 | (1)所有代码使用matlab2021a编写,但matlab 2021a和之前版本可能存在兼容问题,有可能出现乱码。如果乱码,使用txt打开,再将txt中的代码复制到.m文件当中 37 | (2)后续会添加AFO的改进算法,以及更多的应用案例。本实验室参与并完成了各类基于群智能优化的应用项目数百例,涉及电力系统,车间调度,物流配送,选址布局,无人机路径规划、机器人路径规划,复杂网络优化,资源调度,优化各类机器学习算法等各个方向。本实验室会继续挑选经典案例添加到本代码集合当中,请及时关注。如果需要某个方向的代码,可以留言或者邮箱联系。 38 | (3)本实验室发表过大量高水平改进算法,会陆续添加到本代码集中,请多多关注。 39 | 40 | 41 | 42 | 43 | Update log. 44 | 1. 2021.1.1 45 | Version 1.0 46 | All experiments of the paper are run based on this version, except for the experiments of running time. 47 | 48 | 2. 2021.1.7 49 | Version 1.1 50 | The runtime experiments of the paper are based on this version 51 | Disadvantages of Version 1.0 52 | (1) Too slow 53 | (2) The total number of evaluations is T*(N+m) after the catastrophe strategy is triggered, and m is the number of times the catastrophe strategy is triggered. 54 | However, this problem will not affect the results of this experiment because the maximum number of iterations of the experiment is 50, and the catastrophe strategy will basically not be triggered. 55 | 56 | Updated content of Version 1.1 57 | (1) Optimization based on the advantages of MATLAB. The problem of too slow speed is solved. 58 | The core reason for the excessive slowness was that strategy 2 did not use matrix operations in version 1.0. 59 | Note: In order to use matrix operations, this version updates all individuals of the population when using the third strategy, but calculates the fitness value only for those individuals that are eligible. The total number of evaluations is still T*N. 60 | If you want to rewrite this code in another language, we suggest you refer to AFO1. AFO2 is optimized for MATLAB and may not be suitable for your language. 61 | (2) After using the catastrophe strategy, the current iteration number +1,the total evaluation number reverts to T*N 62 | 63 | Author: Zhe Yang 64 | E-mail: 454170989@qq.com 65 | School:University of Manchester 66 | 67 | 更新日志: 68 | 1、2021.1.1 69 | 版本 1.0 70 | 论文所有的实验基于该版本运行,除运行时间的实验。 71 | 缺点: 72 | (1)速度过慢 73 | (2)灾变策略触发后,总评价次数为T*(N+m),m为灾变策略的触发次数。但是,该问题不会影响本实验的结果,因为实验最大迭代次数为50,灾变策略基本不会触发。 74 | 2、2021.1.7 75 | 版本 1.1 76 | 论文的运行时间实验基于该版本 77 | 更新内容: 78 | (1)基于MATLAB的优点,进行优化。解决了速度过慢的问题。 79 | 速度过慢的原因是,(1)策略2在1.0版本中未使用矩阵运算。(2)在编程时使用了结构体,结构体的传递和操作严重减缓程序速度 80 | 注1:为了使用矩阵运算,该版本在使用第三种策略时,对种群的全部个体进行更新,但仅对符合条件的个体,计算适应度值。总评价次数仍为T*N。 81 | 注2: 减少了调用结构体的次数,如果最求更快的速度,可进一步改写程序,删除所有的结构体,直接传递变量 82 | (2)使用灾变策略后,当前迭代次数+1,总评价次数恢复为T*N 83 | 84 | 作者:杨喆 85 | 邮箱:454170989@qq.com 86 | 学校:曼彻斯特大学 87 | 88 | 89 | -------------------------------------------------------------------------------- /benchmark functions/AFO1.m: -------------------------------------------------------------------------------- 1 | function [bestY,bestX,recording]=AFO(x,y,option,data) 2 | %% Authority 3 | % Author: Zhe Yang 4 | % E-mail: 454170989@qq.com 5 | % School:University of Manchester 6 | %% Input 7 | % x----positions of initialized populaiton 8 | % y----fitnesses of initialized populaiton 9 | % option-----parameters set of the algorithm 10 | % data------Pre-defined parameters 11 | % This parameter is used for solving complex problems is passing case data 12 | %% outPut 13 | % bestY ----fitness of best individual 14 | % bestX ----position of best individual 15 | % recording ---- somme data was recorded in this variable 16 | %% initialization 17 | pe=option.pe; 18 | L=option.L; 19 | gap0=option.gap0; 20 | gap=gap0; 21 | dim=option.dim; 22 | recording.bestFit=zeros(option.maxIteration+1,1); 23 | recording.meanFit=zeros(option.maxIteration+1,1); 24 | At=randn(option.numAgent,option.dim); 25 | count=1; 26 | %% center of population 27 | [y_c,position]=min(y); 28 | x_c=x(position(1),:); 29 | At_c=At(position(1),:); 30 | %% memory of population 31 | y_m=y; 32 | x_m=x; 33 | %% update recording 34 | recording.bestFit=y_c; 35 | recording.meanFit=mean(y_m); 36 | %% main loop 37 | for iter=1:option.maxIteration 38 | %Dmp(['AFO,iter:',num2str(iter),',minFit:',num2str(y_c)]) 39 | %% Moving Strategy I for center of population 40 | if rem(iter, gap)==0 41 | c0=exp(-30*(iter-gap0)/option.maxIteration); % EQ.2-11 42 | Dx=ones(1,dim); 43 | Dx=c0*Dx/norm(Dx)*norm(option.v_ub-option.v_lb)/2; %EQ.2-12 44 | % +¡÷x 45 | for j=1:dim 46 | tempX(j,:)=x_c; 47 | tempX(j,j)=x_c(1,j)+Dx(j); 48 | if tempX(j,j)>option.ub(j) 49 | tempX(j,j)=option.ub(j); 50 | Dx(1,j)=tempX(j,j)-x_c(1,j); 51 | end 52 | if tempX(j,j)option.v_ub)=G0(1,G0(1,:)>option.v_ub)/max(G0(1,G0(1,:)>option.v_ub))*max(option.v_ub(G0(1,:)>option.v_ub)); 68 | G0(1,G0(1,:)option.ub(j) 77 | tempX(j+dim,j)=option.ub(j); 78 | Dx(1,j)=tempX(j,j)-x_c(1,j); 79 | end 80 | if tempX(j+dim,j)option.v_ub)=G0(1,G0(1,:)>option.v_ub)/max(G0(1,G0(1,:)>option.v_ub))*max(option.v_ub(G0(1,:)>option.v_ub)); 96 | G0(1,G0(1,:)(no-dim*2)/(option.numAgent-dim*2)*(option.maxIteration-iter)/option.maxIteration 135 | gap=max(option.gapMin,gap-option.dec); %EQ.2-15 136 | end 137 | else 138 | for i=1:option.numAgent 139 | p =tanh(abs(y(i)-y_c)); %EQ.2-30 140 | if randL 202 | for i=1:option.numAgent 203 | x(i,:)=(option.ub-option.lb)*rand+option.lb; 204 | y(i)=option.fobj(x(i,:),option,data); 205 | if y(i)ub(j) 80 | tempX(j,j)=ub(j); 81 | Dx(1,j)=tempX(j,j)-x_c(1,j); 82 | end 83 | if tempX(j,j)v_ub)=G0(1,G0(1,:)>v_ub)/max(G0(1,G0(1,:)>v_ub))*max(v_ub(G0(1,:)>v_ub)); 99 | G0(1,G0(1,:)ub(j) 107 | tempX(j+dim,j)=ub(j); 108 | Dx(1,j)=tempX(j,j)-x_c(1,j); 109 | end 110 | if tempX(j+dim,j)v_ub)=G0(1,G0(1,:)>v_ub)/max(G0(1,G0(1,:)>v_ub))*max(v_ub(G0(1,:)>v_ub)); 126 | G0(1,G0(1,:)ub)=ub(tempX(j,:)>ub); 142 | tempY(j,:)=fobj(tempX(j,:)); 143 | end 144 | else 145 | N=numAgent-2*dim; 146 | r1=exp(-10*(0:N-1)/(N-1)); 147 | unitG=norm(Dx)/norm(G0); %EQ.2-19 148 | if unitG~=1 149 | r2=1:-(1-unitG)/(N-1):unitG; 150 | a=r1.*r2; %EQ.2-17 151 | else 152 | a=r1; 153 | end 154 | for j=2*dim+(1:N) 155 | tempX(j,:)=x_c+G0*a(j-2*dim); %EQ,2-20 156 | tempX(j,tempX(j,:)ub)=ub(tempX(j,:)>ub); 158 | tempY(j,:)=fobj(tempX(j,:)); 159 | end 160 | end 161 | [minY,no]=min(tempY); 162 | if minY(no-dim*2)/(numAgent-dim*2)*(maxIteration-iter)/maxIteration 167 | gap=max(gapMin,gap-dec); %EQ.2-15 168 | end 169 | else 170 | R1=rand(numAgent,dim); 171 | R2=rand(numAgent,dim); 172 | R3=rand(numAgent,dim); 173 | Rn=rand(numAgent,dim); 174 | indexR1=ceil(rand(numAgent,dim)*numAgent); 175 | indexR2=ceil(rand(numAgent,dim)*numAgent); 176 | std0=exp(-20*iter/maxIteration)*(v_ub-v_lb)/2; 177 | std1=std(x_m); 178 | % In order to use matrix operations, all individuals of the population are updated. 179 | % Although more individuals were updated, the running time of the algorithm dropped tremendously. 180 | % This is because MATLAB is extremely good at matrix operations. 181 | % If you want to rewrite this code in another language, we suggest you refer to AFO1. 182 | % AFO2 is optimized for MATLAB and may not be suitable for your language. 183 | for j=1:dim 184 | x_m1(:,j)=x_m(indexR1(:,j),j); 185 | x_m2(:,j)=x_m(indexR2(:,j),j); 186 | y_m1(:,j)=y_m(indexR1(:,j)); 187 | y_m2(:,j)=y_m(indexR2(:,j)); 188 | AI(:,j)=R1(:,j).*sign(y_m1(:,j)-y_m2(:,j)).*(x_m1(:,j)-x_m2(:,j)); 189 | if std1(j)<=std0(j) 190 | position=find(AI(:,j)==0); 191 | AI(position,j)=Rn(position,j)*(v_ub(j)-v_lb(j))/2; 192 | position=find(AI(:,j)~=0); 193 | AI(position,j)=R2(:,j).*sign(y_m1(:,j)-y_m2(:,j)).*sign(x_m1(:,j)-x_m2(:,j))*(v_ub(j)-v_lb(j))/2; 194 | end 195 | end 196 | for i=1:numAgent 197 | p =tanh(abs(y(i)-y_c)); %EQ.2-30 198 | if randub)=ub(x(i,:)>ub); 204 | tempY(i,:)=y(i); 205 | y(i)=fobj(x(i,:)); 206 | if tempY(i,:)ub)=ub(x(i,:)>ub); 225 | y(i)=fobj(x(i,:)); 226 | end 227 | 228 | if y(i)L 254 | for i=1:numAgent 255 | x(i,:)=(ub-lb)*rand+lb; 256 | y(i)=fobj(x(i,:)); 257 | if y(i)(no-dim*2)/(numAgent-dim*2)*(maxIteration-iter)/maxIteration 82 | gap=max(gapMin,gap-dec); %EQ.2-15 83 | end 84 | else 85 | R1=rand(numAgent,dim); 86 | R2=rand(numAgent,dim); 87 | R3=rand(numAgent,dim); 88 | Rn=rand(numAgent,dim); 89 | indexR1=ceil(rand(numAgent,dim)*numAgent); 90 | indexR2=ceil(rand(numAgent,dim)*numAgent); 91 | std0=exp(-20*iter/maxIteration)*(v_ub-v_lb)/2; 92 | std1=std(x_m); 93 | % In order to use matrix operations, all individuals of the population are updated. 94 | % Although more individuals were updated, the running time of the algorithm dropped tremendously. 95 | % This is because MATLAB is extremely good at matrix operations. 96 | % If you want to rewrite this code in another language, we suggest you refer to AFO1. 97 | % AFO2 is optimized for MATLAB and may not be suitable for your language. 98 | for j=1:dim 99 | x_m1(:,j)=x_m(indexR1(:,j),j); 100 | x_m2(:,j)=x_m(indexR2(:,j),j); 101 | y_m1(:,j)=y_m(indexR1(:,j)); 102 | y_m2(:,j)=y_m(indexR2(:,j)); 103 | AI(:,j)=R1(:,j).*sign(y_m1(:,j)-y_m2(:,j)).*(x_m1(:,j)-x_m2(:,j)); 104 | if std1(j)<=std0(j) 105 | position=find(AI(:,j)==0); 106 | AI(position,j)=Rn(position,j)*(v_ub(j)-v_lb(j))/2; 107 | position=find(AI(:,j)~=0); 108 | AI(position,j)=R2(:,j).*sign(y_m1(:,j)-y_m2(:,j)).*sign(x_m1(:,j)-x_m2(:,j))*(v_ub(j)-v_lb(j))/2; 109 | end 110 | end 111 | for i=1:numAgent 112 | p =tanh(abs(y(i)-y_c)); %EQ.2-30 113 | if randub)=ub(x(i,:)>ub); 119 | tempY(i,:)=y(i); 120 | y(i)=fobj(x(i,:)); 121 | if tempY(i,:)ub)=ub(x(i,:)>ub); 140 | y(i)=fobj(x(i,:)); 141 | end 142 | 143 | if y(i)L 169 | for i=1:numAgent 170 | x(i,:)=(ub-lb)*rand+lb; 171 | y(i)=fobj(x(i,:)); 172 | if y(i)a)+k.*((-x-a).^m).*(x<(-a)); 345 | end -------------------------------------------------------------------------------- /benchmark functions/README.md: -------------------------------------------------------------------------------- 1 | # A-new-Nature-inspired-optimization-algorithm-AFO 2 | A new Nature-inspired optimization algorithm: Aptenodytes Forsteri Optimization algorithm (AFO) 3 | 4 | The code for the AFO algorithm and the use of the algorithm to solve the shifted classical benchmark functions. 5 | 6 | Update log. 7 | 8 | 2021.1.1 9 | 10 | Version 1.0 11 | 12 | All experiments of the paper are run based on this version, except for the experiments of running time. 13 | 14 | 2021.1.7 15 | 16 | Version 1.1 17 | 18 | The runtime experiments of the paper are based on this version 19 | 20 | Disadvantages of Version 1.0 21 | 22 | (1) Too slow 23 | 24 | (2) The total number of evaluations is T*(N+m) after the catastrophe strategy is triggered, and m is the number of times the catastrophe strategy is triggered. 25 | However, this problem will not affect the results of this experiment because the maximum number of iterations of the experiment is 50, and the catastrophe strategy will basically not be triggered. 26 | 27 | Updated content of Version 1.1 28 | 29 | (1) Optimization based on the advantages of MATLAB. The problem of too slow speed is solved. 30 | The core reason for the excessive slowness was that strategy 2 did not use matrix operations in version 1.0. 31 | 32 | Note1: In order to use matrix operations, this version updates all individuals of the population when using the third strategy, but calculates the fitness value only for those individuals that are eligible. The total number of evaluations is still T*N. 33 | 34 | Note2:If you want to rewrite this code in another language, we suggest you refer to AFO1. AFO2 is optimized for MATLAB and may not be suitable for your language. 35 | 36 | (2) After using the catastrophe strategy, the current iteration number +1,the total evaluation number reverts to T*N 37 | 38 | Author: Zhe Yang 39 | 40 | E-mail: 454170989@qq.com 41 | 42 | School:University of Manchester 43 | 44 | 更新日志: 45 | 46 | 1、2021.1.1 47 | 48 | 版本 1.0 49 | 50 | 论文所有的实验基于该版本运行,除运行时间的实验。 51 | 52 | 2、2021.1.7 53 | 54 | 版本 1.1 55 | 56 | 论文的运行时间实验基于该版本 57 | 58 | 版本 1.0的缺点: 59 | 60 | (1)速度过慢 61 | 62 | (2)灾变策略触发后,总评价次数为T*(N+m),m为灾变策略的触发次数。但是,该问题不会影响本实验的结果,因为实验最大迭代次数为50,灾变策略基本不会触发。 63 | 64 | 更新内容: 65 | 66 | (1)基于MATLAB的优点,进行优化。解决了速度过慢的问题。 67 | 68 | 速度过慢的原因是,(1)策略2在1.0版本中未使用矩阵运算。(2)在编程时使用了结构体,结构体的传递和操作严重减缓程序速度 69 | 70 | 注1:为了使用矩阵运算,该版本在使用第三种策略时,对种群的全部个体进行更新,但仅对符合条件的个体,计算适应度值。总评价次数仍为T*N。 71 | 72 | 注2: 减少了调用结构体的次数,如果最求更快的速度,可进一步改写程序,删除所有的结构体,直接传递变量 73 | 74 | (2)使用灾变策略后,当前迭代次数+1,总评价次数恢复为T*N 75 | 76 | 作者:杨喆 77 | 78 | 邮箱:454170989@qq.com 79 | 80 | 学校:曼彻斯特大学 81 | 82 | 83 | -------------------------------------------------------------------------------- /benchmark functions/UpdateLog.txt: -------------------------------------------------------------------------------- 1 | Update log. 2 | 1. 2021.1.1 3 | Version 1.0 4 | All experiments of the paper are run based on this version, except for the experiments of running time. 5 | 6 | 2. 2021.1.7 7 | Version 1.1 8 | The runtime experiments of the paper are based on this version 9 | Disadvantages of Version 1.0 10 | (1) Too slow 11 | (2) The total number of evaluations is T*(N+m) after the catastrophe strategy is triggered, and m is the number of times the catastrophe strategy is triggered. 12 | However, this problem will not affect the results of this experiment because the maximum number of iterations of the experiment is 50, and the catastrophe strategy will basically not be triggered. 13 | 14 | Updated content of Version 1.1 15 | (1) Optimization based on the advantages of MATLAB. The problem of too slow speed is solved. 16 | The core reason for the excessive slowness was that strategy 2 did not use matrix operations in version 1.0. 17 | Note: In order to use matrix operations, this version updates all individuals of the population when using the third strategy, but calculates the fitness value only for those individuals that are eligible. The total number of evaluations is still T*N. 18 | If you want to rewrite this code in another language, we suggest you refer to AFO1. AFO2 is optimized for MATLAB and may not be suitable for your language. 19 | (2) After using the catastrophe strategy, the current iteration number +1,the total evaluation number reverts to T*N 20 | 2. 2022.3.25 21 | Version 1.2 22 | It is experimentally found that the gradient estimation strategy is less efficient in most cases. Here the replacement is Gaussian perturbation with a perturbation step of x_c the average distance from x 23 | Perturbation step of x_c distance x_m is also a good choice, interested in their own experiments. 24 | 25 | Author: Zhe Yang 26 | E-mail: 454170989@qq.com 27 | School:University of Manchester 28 | 29 | 更新日志: 30 | 1、2021.1.1 31 | 版本 1.0 32 | 论文所有的实验基于该版本运行,除运行时间的实验。 33 | 缺点: 34 | (1)速度过慢 35 | (2)灾变策略触发后,总评价次数为T*(N+m),m为灾变策略的触发次数。但是,该问题不会影响本实验的结果,因为实验最大迭代次数为50,灾变策略基本不会触发。 36 | 2、2021.1.7 37 | 版本 1.1 38 | 论文的运行时间实验基于该版本 39 | 更新内容: 40 | (1)基于MATLAB的优点,进行优化。解决了速度过慢的问题。 41 | 速度过慢的原因是,(1)策略2在1.0版本中未使用矩阵运算。(2)在编程时使用了结构体,结构体的传递和操作严重减缓程序速度 42 | 注1:为了使用矩阵运算,该版本在使用第三种策略时,对种群的全部个体进行更新,但仅对符合条件的个体,计算适应度值。总评价次数仍为T*N。 43 | 注2: 减少了调用结构体的次数,如果最求更快的速度,可进一步改写程序,删除所有的结构体,直接传递变量 44 | (2)使用灾变策略后,当前迭代次数+1,总评价次数恢复为T*N 45 | 3、2022.3.25 46 | 版本 1.2 47 | 经实验发现,梯度估计策略在大多数情况下效率较低。这里替换为高斯扰动,扰动步长为x_c距离x的平均距离 48 | 扰动步长为x_c距离x_m也是一个不错的选择,有兴趣可以自行实验 49 | 50 | 作者:杨喆 51 | 邮箱:454170989@qq.com 52 | 学校:曼彻斯特大学 53 | 54 | 55 | -------------------------------------------------------------------------------- /benchmark functions/checkX.m: -------------------------------------------------------------------------------- 1 | function x=checkX(x,option,data) 2 | x(xoption.ub)=option.ub(x>option.ub); 4 | end -------------------------------------------------------------------------------- /benchmark functions/fitFCN_BX.m: -------------------------------------------------------------------------------- 1 | function y=fitFCN_BX(x,option,data) 2 | global option 3 | y=option.fobj0(x+option.XB); 4 | end -------------------------------------------------------------------------------- /benchmark functions/func_plot.m: -------------------------------------------------------------------------------- 1 | %_________________________________________________________________________% 2 | % Whale Optimization Algorithm (WOA) source codes demo 1.0 % 3 | % % 4 | % Developed in MATLAB R2011b(7.13) % 5 | % % 6 | % Author and programmer: Seyedali Mirjalili % 7 | % % 8 | % e-Mail: ali.mirjalili@gmail.com % 9 | % seyedali.mirjalili@griffithuni.edu.au % 10 | % % 11 | % Homepage: http://www.alimirjalili.com % 12 | % % 13 | % Main paper: S. Mirjalili, A. Lewis % 14 | % The Whale Optimization Algorithm, % 15 | % Advances in Engineering Software , in press, % 16 | % DOI: http://dx.doi.org/10.1016/j.advengsoft.2016.01.008 % 17 | % % 18 | %_________________________________________________________________________% 19 | 20 | % This function draw the benchmark functions 21 | 22 | function func_plot(func_name) 23 | 24 | [lb,ub,dim,fobj]=Get_Functions_details(func_name); 25 | 26 | switch func_name 27 | case 'F1' 28 | x=-100:2:100; y=x; %[-100,100] 29 | 30 | case 'F2' 31 | x=-10:0.2:10; y=x; %[-10,10] 32 | 33 | case 'F3' 34 | x=-100:2:100; y=x; %[-100,100] 35 | 36 | case 'F4' 37 | x=-100:2:100; y=x; %[-100,100] 38 | case 'F5' 39 | x=-5:0.1:5; y=x; %[-5,5] 40 | case 'F6' 41 | x=-100:2:100; y=x; %[-100,100] 42 | case 'F7' 43 | x=-1:0.03:1; y=x %[-1,1] 44 | case 'F8' 45 | x=-500:10:500;y=x; %[-500,500] 46 | case 'F9' 47 | x=-5.12:0.1:5.12; y=x; %[-5,5] 48 | case 'F10' 49 | x=-20:0.5:20; y=x;%[-500,500] 50 | case 'F11' 51 | x=-500:10:500; y=x;%[-0.5,0.5] 52 | case 'F12' 53 | x=-10:0.1:10; y=x;%[-pi,pi] 54 | case 'F13' 55 | x=-5:0.08:5; y=x;%[-3,1] 56 | case 'F14' 57 | x=-100:2:100; y=x;%[-100,100] 58 | case 'F15' 59 | x=-5:0.1:5; y=x;%[-5,5] 60 | case 'F16' 61 | x=-1:0.01:1; y=x;%[-5,5] 62 | case 'F17' 63 | x=-15:0.1:15; y=x;%[-5,5] 64 | case 'F18' 65 | x=-5:0.06:5; y=x;%[-5,5] 66 | case 'F19' 67 | x=-100:1:100; y=x;%[-5,5] 68 | case 'F20' 69 | x=-5:0.1:5; y=x;%[-5,5] 70 | case 'F21' 71 | x=-5:0.1:5; y=x;%[-5,5] 72 | case 'F22' 73 | x=-5:0.1:5; y=x;%[-5,5] 74 | case 'F23' 75 | x=-5:0.1:5; y=x;%[-5,5] 76 | end 77 | 78 | 79 | 80 | L=length(x); 81 | f=[]; 82 | 83 | for i=1:L 84 | for j=1:L 85 | if strcmp(func_name,'F15')==0 && strcmp(func_name,'F19')==0 && strcmp(func_name,'F20')==0 && strcmp(func_name,'F21')==0 && strcmp(func_name,'F22')==0 && strcmp(func_name,'F23')==0 86 | f(i,j)=fobj([x(i),y(j)]); 87 | end 88 | if strcmp(func_name,'F15')==1 89 | f(i,j)=fobj([x(i),y(j),0,0]); 90 | end 91 | if strcmp(func_name,'F19')==1 92 | f(i,j)=fobj([x(i),y(j),0]); 93 | end 94 | if strcmp(func_name,'F20')==1 95 | f(i,j)=fobj([x(i),y(j),0,0,0,0]); 96 | end 97 | if strcmp(func_name,'F21')==1 || strcmp(func_name,'F22')==1 ||strcmp(func_name,'F23')==1 98 | f(i,j)=fobj([x(i),y(j),0,0]); 99 | end 100 | end 101 | end 102 | 103 | surfc(x,y,f,'LineStyle','none'); 104 | min(min(f)) 105 | [position1,position2]=find(f==min(min(f))); 106 | x(position1) 107 | y(position2) 108 | end 109 | 110 | -------------------------------------------------------------------------------- /benchmark functions/main1.m: -------------------------------------------------------------------------------- 1 | %% 2022.3.25 帝企鹅算法测试函数 2 | % AFO on shifted classcial benchmark functions 3 | clc; 4 | clear; 5 | close all; 6 | warning off 7 | %% 8 | rng('default') 9 | %% 测试函数 10 | global option 11 | option.no=7; %选择测试函数 12 | option.F=['F',num2str(option.no)]; 13 | [lb,ub,dim,fobj] = Get_Functions_details(option.F); 14 | option.lb=lb; 15 | option.ub=ub; 16 | option.dim=dim; 17 | if length(option.lb)==1 18 | option.lb=ones(1,option.dim)*option.lb; 19 | option.ub=ones(1,option.dim)*option.ub; 20 | end 21 | option.fobj0=fobj; 22 | option.fobj=@fitFCN_BX; 23 | option.showIter=0; 24 | 25 | %% 实验参数 26 | option.repeatNum=10; % Number of repetitions of the test 27 | option.numAgent=150; % size of population 28 | option.maxIteration=200; % maximum number of interation 29 | option.v_lb=-(option.ub-option.lb)/4; 30 | option.v_ub=(option.ub-option.lb)/4; 31 | option.w2=0.5; %weight of Moving strategy III 32 | option.w4=1;%weight of Moving strategy III 33 | option.w5=1;%weight of Moving strategy III 34 | option.pe=0.01; % rate to judge Premature convergence 35 | option.gap0=ceil(sqrt(option.maxIteration*2))+1; 36 | option.gapMin=5; % min gap 37 | option.dec=2; % dec of gap 38 | option.L=10; % Catastrophe 39 | data=[]; 40 | str_legend=[{'AFO1'},{'AFO2'},{'AFO3'}]; 41 | for ii=1:option.repeatNum 42 | ii 43 | rng(ii) 44 | %% shift classcial benchmark functions 45 | option.RateB1=0.6; %Bound of Shift in x space 46 | option.RateB2=0.3; %Bound of Shift in x space 47 | temp1=rand(1,option.dim).*(option.RateB1-option.RateB2).*option.ub+option.RateB2.*option.ub; 48 | temp2=rand(1,option.dim).*(option.RateB1-option.RateB2).*option.lb+option.RateB2.*option.lb; 49 | tempR=rand(1,option.dim); 50 | if lb==0 51 | option.XB=temp1; 52 | elseif ub==0 53 | option.XB=temp2; 54 | else 55 | option.XB=zeros(1,option.dim); 56 | option.XB(tempR>0.5)=temp1(tempR>0.5); 57 | option.XB(tempR<0.5)=temp2(tempR<0.5); 58 | end 59 | option.XB=-option.XB; 60 | %% Initialize population individuals (common to control experiment algorithm) 61 | x=ones(option.numAgent,option.dim); 62 | y=ones(option.numAgent,1); 63 | for i=1:option.numAgent 64 | x(i,:)=rand(size(option.lb)).*(option.ub-option.lb)+option.lb; 65 | y(i)=option.fobj(x(i,:),option,data); 66 | end 67 | %% ʹÓÃËã·¨Çó½â 68 | % Based on the same population, solve the selected benchmarks functions by using different algorithms 69 | bestX=x; 70 | rng(ii) 71 | tic 72 | [bestY(1,:),bestX(1,:),recording(1)]=AFO1(x,y,option,data); 73 | tt(ii,1)=toc; 74 | rng(ii) 75 | tic 76 | [bestY(2,:),bestX(2,:),recording(2)]=AFO2(x,y,option,data); 77 | tt(ii,2)=toc; 78 | rng(ii) 79 | tic 80 | [bestY(3,:),bestX(3,:),recording(3)]=AFO3(x,y,option,data); 81 | tt(ii,3)=toc; 82 | for i=1:length(recording) 83 | recordingCruve{i}(ii,1:option.maxIteration)=recording(i).bestFit(1:option.maxIteration); 84 | recordingY(i,ii)=bestY(i,:); 85 | end 86 | end 87 | %% Cruve 88 | figure 89 | hold on 90 | for i=1:length(recording) 91 | if i>=8 92 | plot(mean(recordingCruve{i}),'LineWidth',2) 93 | else 94 | plot(mean(recordingCruve{i}),'--','LineWidth',2) 95 | end 96 | end 97 | legend(str_legend) 98 | %% Cruve based log 99 | figure 100 | hold on 101 | for i=1:length(recording) 102 | if i >=8 103 | plot(log(mean(recordingCruve{i})),'LineWidth',2) 104 | else 105 | plot(log(mean(recordingCruve{i})),'-.','LineWidth',2) 106 | end 107 | end 108 | legend(str_legend) 109 | %% »ã×ܽá¹û Aggregate results 110 | meanY=mean(recordingY'); 111 | stdY=std(recordingY'); 112 | minY=min(recordingY'); 113 | maxY=max(recordingY'); 114 | maeY=mean(abs(recordingY'-meanY)); 115 | runningT=mean(tt(2:end,:)); 116 | %% »æÖƺ¯ÊýͼÏñ Plotting function images 117 | option.F=['F',num2str(option.no)]; 118 | figure 119 | func_plot(option.F) 120 | --------------------------------------------------------------------------------