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

📄 abssinglesystematicchanger.java

📁 pso源程序
💻 JAVA
字号:
/**
 * Description: The description of 1-change strategy.
 *
 * @ Author        Create/Modi     Note
 * Xiaofeng Xie    Jun 12, 2006
 * Xiaofeng Xie    Aug 08, 2006    To common class by using ILocalChangeEngine
 * Xiaofeng Xie    Sep 08, 2006    Use SymmetryBMatrix & ISystematicChangeEngine
 *
 * @version 1.0
 *
 * @Reference
 * [1] Taillard ED. FANT: Fast ant system. Technical Report, IDSIA-46-98, Lugano: IDSIA, 1998.
 */

package maosKernel.behavior.greedy;

import Global.basic.data.matrix.*;
import Global.basic.data.collection.*;

import maosKernel.behavior.channel.*;

public abstract class AbsSingleSystematicChanger extends AbsSystematicChanger implements ISetMaskFlagsEngine {
  protected SymmetryBMatrix testFlagMatrix = null;
  private IAlienICollectionEngine maskFlags;

  public AbsSingleSystematicChanger() {}

  protected void init(int nodeNumber) {
    super.init(nodeNumber);
    testFlagMatrix = new SymmetryBMatrix(nodeNumber);
    maskFlags = new DualIAlienArray(nodeNumber);
  }

  public void setMaskFlags(IAlienICollectionEngine checkFlags) {
    this.maskFlags = checkFlags;
  }

  //If any location is false, then related elements will not be checked
  protected void initTestFlagMatrix() {
    testFlagMatrix.initAll(true);
  }

  protected void refreshTestFlagMatrixAt(int nodeID) {
    testFlagMatrix.initNode(nodeID, true);
  }

  protected boolean isNodeInvalid(int nodeID) {
    return maskFlags.getElementID(nodeID)!=-1;
  }
}

⌨️ 快捷键说明

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