player.gamer.statemachine.sadna

## Class MinMaxTreeActionChooser

- java.lang.Object
- - player.gamer.statemachine.sadna.MinMaxTreeActionChooser

- All Implemented Interfaces:
    ActionChooser

      public class MinMaxTreeActionChooser
      extends java.lang.Object
      implements ActionChooser

  Choose next move in Connect Four game by building Min Max Tree with Alpha Beta Pruning and randomization

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TREE_DEFAULT_DEPTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MinMaxTreeActionChooser(ScoreCalculator calculator, boolean trainingMode)`
    `MinMaxTreeActionChooser(ScoreCalculator calculator, boolean trainingMode, int treeDepth)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAction(Board gameBoard)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TREE_DEFAULT_DEPTH

          public static final int TREE_DEFAULT_DEPTH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MinMaxTreeActionChooser

          public MinMaxTreeActionChooser(ScoreCalculator calculator,
                                 boolean trainingMode,
                                 int treeDepth)

    - #### MinMaxTreeActionChooser

          public MinMaxTreeActionChooser(ScoreCalculator calculator,
                                 boolean trainingMode)

  - ### Method Detail

    - #### getAction

          public int getAction(Board gameBoard)

      Specified by:
        `getAction` in interface `ActionChooser`
      Parameters:
        `gameBoard` - The game board
      Returns:
        The best move to play, that is the best column to put the player coin in