单目标优化问题 常用的 测试函数
近段时间因为需要完成任务所以在研究群智能算法,在这过程中需要不断的拿一些测试函数去做实验,为了以后使用方便在这里将常用的一些测试函数做下记录。
1.Rastrigin's 函数
对于有两个独立变量的Rastrigin函数,其定义的形式如下:
下面是具有两个独立变量的Rastrigin函数图形。
在图形化表示中,该函数有非常多的局部极小点,而仅仅只有一个全局最小点,这个点就是[0 0],在这个点处的函数的值为0,该函数被用来测试遗传算法的主要原因是,对于传统的基于梯度的算法对付这个具有非常多局部极小点的函数来说,那是十分的困难呀。
下面给出该函数的等高线图:
网址:http://blog.csdn.net/niuyongjie/article/details/4879326
给出了 适应度函数 的 最优值与平均值会在一个图形窗口不断的绘制出,等算法运行结束,绘制的图形如下所示。
在图形中上面蓝色的点表示适应度函数平均值的变化,而下面黑色的点表示了,每次迭代中最佳适应度值的变化。
外国网站上给出的:http://www.sfu.ca/~ssurjano/rastr.html
Description:
Dimensions: d
The Rastrigin function has several local minima. It is highly multimodal, but locations of the minima are regularly distributed. It is shown in the plot above in its two-dimensional form.
Input Domain:
The function is usually evaluated on the hypercube xi ∈ [-5.12, 5.12], for all i = 1, …, d.
Global Minimum:
2. SCHAFFER FUNCTION N. 2
http://www.sfu.ca/~ssurjano/schaffer2.html
Description:
Dimensions: 2
The second Schaffer function. It is shown on a smaller input domain in the second plot to show detail.
Input Domain:
The function is usually evaluated on the square xi ∈ [-100, 100], for all i = 1, 2.
Global Minimum:
还有一种写法:
f(x)=0.5 -
该函数在(0,...,0)处有最大值1,因此不需要取相反数。
3. Ackley函数,函数图形如下:
%Ackley 函数
%输入x,给出相应的y值,在x=(0,0,…,0) 处有全局极小点0,为得到最大值,返回值取相反数
result=-20*exp(-0.2*sqrt((1/col)*(sum(x.^2))))-exp((1/col)*sum(cos(2*pi.*x)))+exp(1)+20;
result=-result;
http://www.sfu.ca/~ssurjano/ackley.html
Description:
Dimensions: d
The Ackley function is widely used for testing optimization algorithms. In its two-dimensional form, as shown in the plot above, it is characterized by a nearly flat outer region, and a large hole at the centre. The function poses a risk for optimization algorithms, particularly hillclimbing algorithms, to be trapped in one of its many local minima.
Recommended variable values are: a = 20, b = 0.2 and c = 2π.
Input Domain:
The function is usually evaluated on the hypercube xi ∈ [-32.768, 32.768], for all i = 1, …, d, although it may also be restricted to a smaller domain.
Global Minimum:
4. Griewank函数,图形如下所示:
http://www.sfu.ca/~ssurjano/griewank.html
Description:
Dimensions: d
The Griewank function has many widespread local minima, which are regularly distributed. The complexity is shown in the zoomed-in plots.
Input Domain:
The function is usually evaluated on the hypercube xi ∈ [-600, 600], for all i = 1, …, d.
Global Minimum:
更多的 单目标测试函数 网址:
http://www.sfu.ca/~ssurjano/optimization.html
posted on 2017-02-06 20:31 Angry_Panda 阅读(18215) 评论(0) 编辑 收藏 举报