📄 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 + -