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

📄 spawner.java

📁 用C编写的数据挖掘的相关算法
💻 JAVA
字号:
package chc;import shared.LogOptions;import java.util.*;  public class Spawner {  private int attrselectionsize;  private LogOptions logOptions = new LogOptions("WRAPPER");  private Random rand;  public Spawner(int attrselsize) {    if (attrselsize < 1) {      logOptions.ERR(0, "Atribute attrselectionsize cannot be zero.");    }    attrselectionsize = attrselsize;    rand = new Random(System.currentTimeMillis());  }  public Hypothesis[] spawnPopulation(int number, int generation) {    logOptions.LOG(3, "Spawning"+CHC.ENDL);      Hypothesis[] result = new Hypothesis[number];      for (int i = 0; i < number; i++) {        result[i] = newHypo(generation);      }    return result;  }  public Hypothesis newHypo(int generation) {      int[] newint = new int[attrselectionsize];      for (int j = 0; j < attrselectionsize; j++) {        newint[j] = rand.nextInt(2);      }    Hypothesis newhypo = new Hypothesis(generation, newint);    return newhypo;  }    }

⌨️ 快捷键说明

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