⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 derandtobest1exp.java

📁 Differential Evolution(JAVA)
💻 JAVA
字号:
package DeApp1.de;


public class DERandToBest1Exp extends DEStrategy
/***********************************************************
**                                                        **
** This strategy seems to be one of the best strategies.  **
** Try F=0.85 and CR=1. If you get misconvergence try to  **
** increase NP. If this doesn't help you should play      **
** around with all three control variables.               **
**                                                        **
** 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] += F * ((gen_best[i] - x[i]) + (g0[0][i] - g0[1][i]));		
      i = ++i % dim;
    } while ((deRandom.nextDouble() < Cr) && (++counter < dim));
  }
}





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -