?? mysolution.java
字號:
import org.coinor.opents.*;public class MySolution extends SolutionAdapter { public int[] tour; public MySolution(){} // Appease clone() public MySolution( double[][] customers ) { // Crudely initialize solution tour = new int[ customers.length ]; for( int i = 0; i < customers.length; i++ ) tour[i] = i; } // end constructor public Object clone() { MySolution copy = (MySolution)super.clone(); copy.tour = (int[])this.tour.clone(); return copy; } // end clone public String toString() { StringBuffer s = new StringBuffer(); s.append( "Solution value: " + getObjectiveValue()[0] ); s.append( "Sequence: [ " ); for( int i = 0; i < tour.length - 1; i++ ) s.append( tour[i] ).append( ", " ); s.append( tour[ tour.length - 1 ] ); s.append( " ]" ); return s.toString(); } // end toString } // end class MySolution
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -