@Test public void testGetInitialState() throws Exception { int nonZeroCount = 0; double[] features = state.getFeatures(); for (double f : features) { if (f > 0) nonZeroCount++; } assertEquals(nonZeroCount, 2); }
public static State2048 getInitialState(int numLocations, RandomDataGenerator random) { State2048 state = new State2048(); for (int i = 0; i < numLocations; i++) { state.addRandomTile(random); } return state; }
State2048 implements BoardState { public static State2048 getInitialState(int numLocations, RandomDataGenerator random) { State2048 state = new State2048(); for (int i = 0; i < numLocations; i++) { state.addRandomTile(random); } return state; } }
State2048 implements BoardState { public static State2048 getInitialState(int numLocations, RandomDataGenerator random) { State2048 state = new State2048(); for (int i = 0; i < numLocations; i++) { state.addRandomTile(random); } return state; } private  State2048();  State2048(State2048 state);  State2048(double[] features); }
State2048 implements BoardState { public static State2048 getInitialState(int numLocations, RandomDataGenerator random) { State2048 state = new State2048(); for (int i = 0; i < numLocations; i++) { state.addRandomTile(random); } return state; } private  State2048();  State2048(State2048 state);  State2048(double[] features); static int getNumValues(); int[][] getPowerGrid(); @Override double[] getFeatures(); int getValue(int flatLocation); List<Pair<Double, EnvTransition<State2048>>> getPossibleEnvironmentTransitions(); void addRandomTile(RandomDataGenerator random); List<Integer> getEmptyLocations(); int moveUp(); void rotateBoard(); int makeMove(Action2048 action); List<Action2048> getPossibleMoves(); boolean isTerminal(); int getMaxTile(); void printHumanReadable(); static State2048 getInitialState(int numLocations, RandomDataGenerator random); static State2048 getInitialState(RandomDataGenerator random); @Override Game2048Board getBoard(); @Override String toString(); boolean hasValue(int[] values, int value); int[] getValues(); int getStage(int num_segments, int max_segment); }
State2048 implements BoardState { public static State2048 getInitialState(int numLocations, RandomDataGenerator random) { State2048 state = new State2048(); for (int i = 0; i < numLocations; i++) { state.addRandomTile(random); } return state; } private  State2048();  State2048(State2048 state);  State2048(double[] features); static int getNumValues(); int[][] getPowerGrid(); @Override double[] getFeatures(); int getValue(int flatLocation); List<Pair<Double, EnvTransition<State2048>>> getPossibleEnvironmentTransitions(); void addRandomTile(RandomDataGenerator random); List<Integer> getEmptyLocations(); int moveUp(); void rotateBoard(); int makeMove(Action2048 action); List<Action2048> getPossibleMoves(); boolean isTerminal(); int getMaxTile(); void printHumanReadable(); static State2048 getInitialState(int numLocations, RandomDataGenerator random); static State2048 getInitialState(RandomDataGenerator random); @Override Game2048Board getBoard(); @Override String toString(); boolean hasValue(int[] values, int value); int[] getValues(); int getStage(int num_segments, int max_segment); static final int SIZE; static final RectSize BOARD_SIZE; static final int NUM_INITIAL_LOCATIONS; static final double RANDOM_FOUR_PROB; static final int REWARDS; }