• 大小: 149KB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-02-03
  • 语言: 其他
  • 标签: PSO  spark  

资源简介

项目名称:基于Spark的PSO并行计算 编程语言:scala 项目内容:将粒子群算法pso实现的了并行,并成功集成了bencmark的测试函数,可以利用该标准的测试函数,来验证算法的性能. 测试结果:在benchmark的20个测试函数当中有9个超过decc-g的测试结果 注意:本算法会因机器的性能,函数的特性不同执行的效率也不一样,本程序还有很大的改进空间,希望大家可以继续完善.

资源截图

代码片段和文件信息

package pso;/*
 * Copyright (c) 2009 Thomas Weise for NICAL
 * http://www.it-weise.de/
 * tweise@gmx.de
 *
 * GNU LESSER GENERAL PUBLIC LICENSE (Version 2.1 February 1999)
 */


/**
 * This internal class holds the default values for everything
 * 
 * @author Thomas Weise
 */
final class Defaults {

  /** the default dimension */
  static final int DEFAULT_DIM = 1000;

  /** the default m */
  static int DEFAULT_M = 50;

  /**
   * Obtain the randomizer
   * 
   * @param c
   *          the class to get the randomizer for
   * @return the randomizer
   */
  static final Randomizer getRandomizer(final Class/*  */c) {
    long l;

    try {
      l = Long.parseLong(c.getSimpleName().substring(1));
    } catch (Throwable tt) {
      throw new RuntimeException(tt);
    }

    return new Randomizer(l);
  }

  // /** the full directory path of this package */
  // private static final String FULL_DIR = Kernel.class.getPackage()
  // .getName().replace(‘.‘ File.pathSeparatorChar);
  //
  // /** the rotation matrix suffix */
  //  private static final String ROT_MAT_SUFFIX = “_M.txt“; //$NON-NLS-1$
  //
  // /** the shift vector suffix */
  //  private static final String SHIFT_VECTOR_SUFFIX = “_o.txt“; //$NON-NLS-1$
  //
  // /** the permutation vector suffix */
  //  private static final String PERM_VECTOR_SUFFIX = “_P.txt“; //$NON-NLS-1$
  //
  // /**
  // * Obtain the default rotation matrix for class c
  // *
  // * @param c
  // * the class
  // * @return the default rotation matrix for class c
  // */
  // static final double[] defaultRotMatrix(final Class c) {
  // final InputStream is;
  // final String s;
  // final double[] d;
  //
  // s = c.getSimpleName() + ROT_MAT_SUFFIX;
  //
  // try {
  // is = Kernel.class.getResourceAsStream(s);
  // if (is != null) {
  // d = Utils.loadRotMatrix(is);
  // } else {
  // d = Utils.loadRotMatrix(FULL_DIR + File.pathSeparatorChar + s);
  // }
  // DEFAULT_M = (int) (0.9d + Math.sqrt(d.length));
  // return d;
  // } catch (Throwable t) {
  // return Utils.defaultRandomRotMatrix(DEFAULT_M);
  // }
  // }
  //
  // /**
  // * Obtain the default shift vector for class c
  // *
  // * @param c
  // * the class
  // * @return the default shift vector for class c
  // */
  // static final double[] defaultShiftVec(final Class c) {
  // final InputStream is;
  // final String s;
  // double min max;
  // final double[] d;
  //
  // s = c.getSimpleName() + SHIFT_VECTOR_SUFFIX;
  //
  // try {
  // is = Kernel.class.getResourceAsStream(s);
  // if (is != null) {
  // d = Utils.loadShiftVector(is);
  // } else {
  // d = Utils.loadShiftVector(FULL_DIR + File.pathSeparatorChar + s);
  // }
  // return d;
  // } catch (Throwable t) {
  //
  // try {
  //        min = ((Number) (c.getDeclaredField(“MIN“).get(null))).doubleValue(); //$NON-NLS-1$      
  // } catch (Throwable tt) {
  // min = -100d;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-05-31 11:44  PsoSpark\
     文件      290857  2015-05-25 20:15  PsoSpark\.cache
     文件         501  2015-05-09 10:51  PsoSpark\.classpath
     文件         442  2015-05-09 10:28  PsoSpark\.project
     目录           0  2015-05-31 11:44  PsoSpark\.settings\
     文件         598  2015-05-09 10:28  PsoSpark\.settings\org.eclipse.jdt.core.prefs
     文件         215  2015-05-09 14:28  PsoSpark\.settings\org.scala-ide.sdt.core.prefs
     目录           0  2015-05-31 11:44  PsoSpark\bin\
     目录           0  2015-05-31 11:44  PsoSpark\bin\org\
     目录           0  2015-05-31 11:44  PsoSpark\bin\org\hebut\
     目录           0  2015-05-31 11:44  PsoSpark\bin\org\hebut\pso\
     文件         469  2015-05-22 19:07  PsoSpark\bin\org\hebut\pso\DimIndex$.class
     文件        2288  2015-05-22 19:07  PsoSpark\bin\org\hebut\pso\DimIndex.class
     目录           0  2015-05-31 11:44  PsoSpark\bin\pso\
     文件        1027  2015-05-22 19:07  PsoSpark\bin\pso\Defaults.class
     文件        1871  2015-05-22 19:07  PsoSpark\bin\pso\Demo.class
     文件        1290  2015-05-22 19:07  PsoSpark\bin\pso\F1.class
     文件        1810  2015-05-22 19:07  PsoSpark\bin\pso\F10.class
     文件        1801  2015-05-22 19:07  PsoSpark\bin\pso\F11.class
     文件        1698  2015-05-22 19:07  PsoSpark\bin\pso\F12.class
     文件        2033  2015-05-22 19:07  PsoSpark\bin\pso\F13.class
     文件        1809  2015-05-22 19:07  PsoSpark\bin\pso\F14.class
     文件        1736  2015-05-22 19:07  PsoSpark\bin\pso\F15.class
     文件        1730  2015-05-22 19:07  PsoSpark\bin\pso\F16.class
     文件        1635  2015-05-22 19:07  PsoSpark\bin\pso\F17.class
     文件        1904  2015-05-22 19:07  PsoSpark\bin\pso\F18.class
     文件        1208  2015-05-22 19:07  PsoSpark\bin\pso\F19.class
     文件        1201  2015-05-22 19:07  PsoSpark\bin\pso\F2.class
     文件        1504  2015-05-22 19:07  PsoSpark\bin\pso\F20.class
     文件        1509  2015-05-22 19:07  PsoSpark\bin\pso\F3.class
     文件        1857  2015-05-22 19:07  PsoSpark\bin\pso\F4.class
............此处省略81个文件信息

评论

共有 条评论