📄 goldsteinprice.java
字号:
/**
* Description: GoldsteinPrice(GP) function
*
* @ Author Create/Modi Note
* Xiaofeng Xie Apr 20, 2003
* Xiaofeng Xie May 11, 2004
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* Please acknowledge the author(s) if you use this code in any way.
*
* @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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -