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

📄 realproblemdata.java

📁 用于求解TSP(Traveling salesman problem
💻 JAVA
字号:
/**
 * Description: provide the information for the problem data
 *
 * @ Author        Create/Modi     Note
 * Xiaofeng Xie    Jul 12, 2006     xiaofengxie@tsinghua.org.cn
 */

package implement.TSP.represent;

import  maosKernel.represent.*;

public class RealProblemData extends AbsProblemData implements IGetProblemDataEngine {
  int[][] costMatrix;

  public RealProblemData(int[][] costMatrix) {
    this.costMatrix = costMatrix;
  }

  public int[][] getCostMatrix() {
    return costMatrix;
  }

  public int getLocalCost(int nodeA, int nodeB) {
    return costMatrix[nodeA][nodeB];
  }

  public int getNodeNumber() {
    return costMatrix.length;
  }
}

⌨️ 快捷键说明

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