deproblem.java

来自「Differential Evolution(JAVA)」· Java 代码 · 共 57 行

JAVA
57
字号
package DeApp1.problem;

import java.awt.*;         // Import all classes from the java.awt package
                           // AWT is the Abstract Window Toolkit. The AWT
import java.io.*;
import DeApp1.de.*;



public abstract class DEProblem
/***********************************************************
**                                                        **
** Describes the problem to solve.                        **
** The abstract class declares the methods that all       **
** subtypes must have. Not all of them, however, are      **
** implemented in the abstract class.                     **
**                                                        **
** Authors:            Mikal Keenan                       **
**                     Rainer Storn                       **
**                                                        **
***********************************************************/
{
  /*----Public variables---------------------*/
  public static final int NAPTIME = 10;
  public double mincost;

  /*----Protected variables------------------*/
  double best[];
  int    dim;


  /*----Function stubs-----------------------*/
  public abstract boolean completed(); // TRUE if evaluation is completed
  public abstract double evaluate (T_DEOptimizer t_DEOptimizer, double[] X, int dim); //the actal cost function


  public final double[] getBest ()
  /**********************************
  ** Best vector.                  **
  **********************************/
  {
    return best;
  }

  public final int getLength ()
  /***********************************
  ** Dimensionality of the problem. **
  ***********************************/
  {
    return dim;
  }
}




⌨️ 快捷键说明

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