?? mymovemanager.java
字號:
import org.coinor.opents.*;public class MyMoveManager implements MoveManager{ public Move[] getAllMoves( Solution solution ) { int[] tour = ((MySolution)solution).tour; Move[] buffer = new Move[ tour.length*tour.length ]; int nextBufferPos = 0; // Generate moves that move each customer // forward and back up to five spaces. for( int i = 1; i < tour.length; i++ ) for( int j = -5; j <= 5; j++ ) if( (i+j >= 1) && (i+j < tour.length) && (j != 0) ) buffer[nextBufferPos++] = new MySwapMove( tour[i], j ); // Trim buffer Move[] moves = new Move[ nextBufferPos]; System.arraycopy( buffer, 0, moves, 0, nextBufferPos ); return moves; } // end getAllMoves } // end class MyMoveManager
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -