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

📄 commonxgenerator.java

📁 pso源程序
💻 JAVA
字号:
/**
 * Description: Common Crossover create an offspring with the values common to both parents.
 *
 * @ Author        Create/Modi     Note
 * Xiaofeng Xie    Aug 19, 2006
 *
 *
 * @version 1.0
 *
 */

package implement.common.behavior.combine;

import Global.basic.data.collection.*;
import maosKernel.represent.space.*;
import maosKernel.behavior.generate.*;

public class CommonXGenerator extends AbsSBILXBlindGenerator {

  public CommonXGenerator() {
  }

  protected boolean blindSBILXBehavior(SearchState trailPoint, SearchState basePoint, SearchState referPoint) {
    trailPoint.clear();
    IAlienICollectionEngine baseCollection = basePoint.getTrueElements();
    IAlienICollectionEngine referCollection = referPoint.getTrueElements();

    for (int i=0; i<baseCollection.getSize(); i++) {
      if (referCollection.getElementID(baseCollection.getElementAt(i))!=-1) {
        trailPoint.setValueAt(baseCollection.getElementAt(i));
      }
    }
    return true;
  }
}

⌨️ 快捷键说明

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