aisearchstate.java

来自「用于求解TSP(Traveling salesman problem」· Java 代码 · 共 64 行

JAVA
64
字号
/** * Description: provide the location information of a state * * @ Author        Create/Modi     Note * Xiaofeng Xie    Apr  6, 2005 * Xiaofeng Xie    Apr 28, 2006    MAOS-TSP Beta 1.1.002 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. * * Please acknowledge the author(s) if you use this code in any way. */package maosKernel.represent.space;import Global.methods.*;import Global.basic.data.point.*;public class AISearchState extends StableIPoint {  public AISearchState(int nodeNumber) {    super(nodeNumber);  }  public AISearchState(int[] content) {    super(content);  }  public int getPreValue(int index){    return location[BasicArray.getPrecessorID(getNodeNumber(), index)];  }  public int getValueIndex(int value) {    return BasicArray.getExactIndex(location, value);  }  public void swap(int nodeA, int nodeB) {    ArrayOperator.swapData(this.getIArray(), nodeA, nodeB);  }  public void nnSwap(int nodeID) {    swap(nodeID, nodeID+1);  }  public void insertion(int baseID, int tobeID) {    ArrayOperator.insertTo(this.getIArray(), baseID, tobeID);  }  public int getPostValue(int index){    return location[BasicArray.getSuccessorID(getNodeNumber(), index)];  }  public void importSearchState(AISearchState point) {    System.arraycopy(point.location, 0, location, 0, location.length);  }}

⌨️ 快捷键说明

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