derand1exp.java
来自「Differential Evolution(JAVA)」· Java 代码 · 共 34 行
JAVA
34 行
package DeApp1.de;
public class DERand1Exp extends DEStrategy
/***********************************************************
** **
** Perhaps the most universally applicaple strategy, but **
** not always the fastest one. Still **
** this is one of my favourite strategies. It works espe- **
** cially well when the "Best"-schemes experience mis- **
** convergence. Try e.g. F=0.7 and CR=0.5 as a first **
** guess. **
** **
** Authors: Mikal Keenan **
** Rainer Storn **
** **
***********************************************************/
{
public void apply (double F, double Cr, int dim, double[]x, double[]gen_best,
double[][]g0)
{
prepare (dim);
do
{
x[i] = g0[0][i] + F * (g0[1][i] - g0[2][i]);
i = ++i % dim;
} while ((deRandom.nextDouble() < Cr) && (++counter < dim));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?