use of aima.core.search.adversarial.IterativeDeepeningAlphaBetaSearch in project aima-java by aimacode.
the class TicTacToeApp method proposeMove.
/** Uses adversarial search for selecting the next action. */
private void proposeMove() {
AdversarialSearch<TicTacToeState, XYLocation> search;
XYLocation action;
switch(strategyCombo.getSelectionModel().getSelectedIndex()) {
case 0:
search = MinimaxSearch.createFor(game);
break;
case 1:
search = AlphaBetaSearch.createFor(game);
break;
case 2:
search = IterativeDeepeningAlphaBetaSearch.createFor(game, 0.0, 1.0, 1000);
break;
default:
search = IterativeDeepeningAlphaBetaSearch.createFor(game, 0.0, 1.0, 1000);
((IterativeDeepeningAlphaBetaSearch<?, ?, ?>) search).setLogEnabled(true);
}
action = search.makeDecision(currState);
searchMetrics = search.getMetrics();
currState = game.getResult(currState, action);
update();
}
Aggregations