Package aima.core.search.adversarial

Examples of aima.core.search.adversarial.AlphaBeta


  @Override
  public int getAlphaBetaValue(GameState state) {

    if (getPlayerToMove(state).equalsIgnoreCase("X")) {
      AlphaBeta initial = new AlphaBeta(Integer.MIN_VALUE,
          Integer.MAX_VALUE);
      int max = maxValue(state, initial);
      return max;

    } else {
      // invert?
      AlphaBeta initial = new AlphaBeta(Integer.MIN_VALUE,
          Integer.MAX_VALUE);
      return minValue(state, initial);
    }
  }
View Full Code Here


    t.makeMove(1, 2); // x
    t.makeMove(1, 1); // o

    t.makeMove(2, 1); // x

    int minValue = t.minValue(t.getState(), new AlphaBeta(
        Integer.MIN_VALUE, Integer.MAX_VALUE));
    Assert.assertEquals(0, minValue);
  }
View Full Code Here

TOP

Related Classes of aima.core.search.adversarial.AlphaBeta

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.