fullparamholder.java
来自「用于求解TSP(Traveling salesman problem」· Java 代码 · 共 99 行
JAVA
99 行
/** * Description: Holds the Special parameters. * * @ Author Create/Modi Note * Xiaofeng Xie Jun 17, 2006 * * 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. * * @version 1.0 * @Since MAOS1.0 * */package implement.TSP.infoIO;import Global.define.*;import Global.methods.*;import maosKernel.infoIO.*;public class FullParamHolder extends BasicParamHolder { /**************** Parameters For Landscape *****************************/ /*************** Parameters for intermediate ****************************/ //for neighbor public int Knni = 20; //importance: high level public boolean isAlpha = true; //For problem size to calcluate the penalty values public int Nalpha = 500; /**************** Parameters For Consturctor*****************************/ //For initial rule public double rBit3Opt = 0.01; /****************Parameters For LS & Mutaters****************************/ /**************** Parameters For Generator *****************************/ //For eaxGenerator public double EAXCd = 1.5; //importance: high level public int EAXNmtm = 30; //importance: high level /*********************************************************/ public FullParamHolder() { this.setKey("Traveling Saleman Problem (TSP)"); solutionSuffix = ".tour"; defaultProblemSuffixes = new String[]{".tsp", ".dat", ".txt"}; } protected String getSpecResultFileNameBody() { String sumStr = ""; sumStr += "_Knni"+Knni; sumStr += "_isAlpha("+isAlpha+")"; sumStr += "_3Opt[rBit"+rBit3Opt+"]"; sumStr += "_EAX[Cd"+EAXCd; sumStr += "_Nmtm"+EAXNmtm+"]"; return sumStr; } protected String getSpecSummary() { String sumStr = ""; sumStr += "Knni="+Knni+","; sumStr += "isAlpha="+isAlpha+","; sumStr += "rBit3Opt="+rBit3Opt+","; sumStr += "EAXCd="+EAXCd+","; sumStr += "EAXNmtm="+EAXNmtm+","; sumStr += "Nalpha="+Nalpha; return sumStr; } protected boolean parserSpecParam(String name, String value) throws Exception { if(name.equalsIgnoreCase("Nalpha")) Nalpha = TypeConverter.toInteger(value); else if(name.equalsIgnoreCase("Knni")) Knni = TypeConverter.toInteger(value); else if(name.equalsIgnoreCase("isAlpha")) isAlpha = TypeConverter.toBoolean(value); else if(name.equalsIgnoreCase("rBit3Opt")) rBit3Opt = TypeConverter.toDouble(value); else if(name.equalsIgnoreCase("EAXCd")) EAXCd = TypeConverter.toDouble(value); else if(name.equalsIgnoreCase("EAXNmtm")) EAXNmtm = TypeConverter.toInteger(value); else return false; return true; } protected String getSpecUsage() { String usageStr = ""; usageStr += "Knni integer Candidate set: The size of neighbors"+BasicTag.RETURN_TAG; usageStr += "EAXCd integer RG_EAX: diffusion coefficient"+BasicTag.RETURN_TAG; usageStr += "EAXNmtm integer RG_EAX: size for multi-trail mechanism"+BasicTag.RETURN_TAG; return usageStr; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?