public class Config {
static final int STATION_COUNT = 10;//車站數
static final float TIME_OF_ONE_RIDE = 3.0f;//行走一個站的時間(分鐘)
static final float TIME_OF_ONE_STOP = 0.5f;//停靠一次站的時間(分鐘)
static final String[] STATION_NAMES = new String[]{"A","B","C","D","E","F","G","H","I","J"};//站名
static final int INIT_INDEX = 7;//車子的起始站點號
static int[][] countsOfFromTo = null;//從某站到目的站的候車人數
/*
* 下面通過靜態構造器來對二維數組進行初始化
*/
static {
//countsOfFromTo[i][j]表示從i站到j站的候車人數
countsOfFromTo = new int[][]{
/**************A,B,C,D,E,F,G,H,I,J*/
/*A*/new int[]{0,5,3,7,8,2,6,4,2,3},
/*B*/new int[]{1,0,4,3,7,6,3,4,2,6},
/*C*/new int[]{3,2,0,7,5,4,7,5,1,2},
/*D*/new int[]{5,1,2,0,5,3,3,1,8,6},
/*E*/new int[]{4,2,7,3,0,6,1,5,4,3},
/*F*/new int[]{2,9,6,2,1,0,3,6,5,1},
/*G*/new int[]{6,1,4,3,5,2,0,3,2,4},
/*H*/new int[]{3,2,5,1,8,2,3,0,7,4},
/*I*/new int[]{4,2,6,3,1,7,5,2,0,3},
/*J*/new int[]{7,1,4,8,1,2,9,1,5,0}
};
}
}