goldsteinprice.java
来自「基于差分进化与粒子群混合算法优化源程序,这是一个java语言编制的源程序,很实用」· Java 代码 · 共 32 行
JAVA
32 行
/**
* Description: GoldsteinPrice(GP) function
*
* @ Author Create/Modi Note
* Xiaofeng Xie Apr 20, 2003
* Xiaofeng Xie May 11, 2004
*
* @version 1.0
* @Since MAOS1.0
*
* @References:
* [1] Serra P, Stanton A F, Kais S. Comparison study of pivot methods for global
* optimization. J. Chem. Phys, 1997, 106(17): 7170-7177
*/
package problem.unconstrained;
import problem.*;
public class GoldsteinPrice extends UnconstrainedProblemEncoder {
static final int NX = 2;
public GoldsteinPrice() throws Exception {
super(NX);
setDefaultXAt(0, -2, 2);
setDefaultXAt(1, -2, 2);
}
public double calcTarget(double[] VX) {
return (1+Math.pow(VX[0]+VX[1]+1, 2)*(19-14*VX[0]+3*VX[0]*VX[0]-14*VX[1]+6*VX[0]*VX[1]+3*VX[1]*VX[1]))*(30+(Math.pow(2*VX[0]-3*VX[1], 2)*(18-32*VX[0]+12*VX[0]*VX[0]+48*VX[1]-36*VX[0]*VX[1]+27*VX[1]*VX[1])));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?