Interface BotStrategy

All Known Implementing Classes:
AlphaBeta, Custom, MaxN, Minimax, MonteCarloTreeSearch, Paranoid, Random

public sealed interface BotStrategy permits AlphaBeta, Minimax, MaxN, Random, Paranoid, MonteCarloTreeSearch, Custom
An interface representing a bot strategy for a game returning a move for the current game state.
  • Field Details

    • RANDOM

      static final ToIntFunction<GameState> RANDOM
      Returns a function that returns the best move for the current game state using a Random strategy.
    • MINIMAX

      static final ToIntFunction<GameState> MINIMAX
      Returns a function that returns the best move for the current game state using a Minimax strategy.
    • ALPHABETA

      static final ToIntFunction<GameState> ALPHABETA
      Returns a function that returns the best move for the current game state using a Minimax w. Alpha-Beta Pruning strategy.
    • MAXN

      static final ToIntFunction<GameState> MAXN
      Returns a function that returns the best move for the current game state using a MaxN strategy.
    • PARANOID

      static final ToIntFunction<GameState> PARANOID
      Returns a function that returns the best move for the current game state using a Paranoid strategy.
    • MCTS

      static final ToIntFunction<GameState> MCTS
      Returns a function that returns the best move for the current game state using a Monte Carlo Search Tree strategy.
    • DEFAULT

      static final ToIntFunction<GameState> DEFAULT
      Returns a function that returns the best move for the current game state using a default strategy (Random).
  • Method Details

    • bestMove

      int bestMove()
      Returns the best move for the current game state.
      Returns:
      the index of the best move to make
    • random

      static ToIntFunction<GameState> random(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a Random strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a Random strategy
    • minimax

      static ToIntFunction<GameState> minimax(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a Minimax strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a Minimax strategy
    • alphabeta

      static ToIntFunction<GameState> alphabeta(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a Minimax w. Alpha-Beta Pruning strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a Minimax w. Alpha-Beta Pruning strategy
    • maxn

      static ToIntFunction<GameState> maxn(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a MaxN strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a MaxN strategy
    • paranoid

      static ToIntFunction<GameState> paranoid(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a Paranoid strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a Paranoid strategy
    • mcts

      static ToIntFunction<GameState> mcts(BotStrategyConfig config)
      Returns a function that returns the best move for the current game state using a Monte Carlo Tree Search strategy.
      Parameters:
      config - the configuration for the bot strategy
      Returns:
      a function that returns the best move for the current game state using a Monte Carlo Tree Search strategy