public void makeMiniMaxMove() { getMiniMaxValue(presentState); GameState nextState = (GameState)presentState.get("next"); if (nextState == null) { throw new RuntimeException("Mini Max Move failed"); } makeMove(presentState, nextState.get("moveMade")); }
public TicTacToeBoard getBoard(GameState state) { return (TicTacToeBoard) state.get("board"); }
public override bool terminalTest(GameState state) { TicTacToeBoard board = (TicTacToeBoard) state.get("board"); bool line = board.lineThroughBoard(); bool filled = board.getNumberOfMarkedPositions() == 9; return (line || filled); }
public override int computeUtility(GameState state) { int utility = computeUtility((TicTacToeBoard) state.get("board"), (getPlayerToMove(state))); return utility; }
public int getUtility(GameState h) { return(((int)h.get("utility")).intValue()); }
public String getPlayerToMove(GameState state) { return((String)state.get("player")); }
public List getMoves(GameState state) { return((List)state.get("moves")); }
public int getLevel(GameState g) { return(((int)g.get("level")).intValue()); }
public int getUtility(GameState h) { return ((int)h.get("utility")).intValue(); }
public String getPlayerToMove(GameState state) { return (String)state.get("player"); }
public List getMoves(GameState state) { return (List)state.get("moves"); }
public int getLevel(GameState g) { return (((int)g.get("level")).intValue()); }