Interface Agent

All Known Implementing Classes:
BadAgent, BaseAgent, BetterGreedyAgent, DeterministicAgent, FlippedLutAgent, GreedyAgent, LeastAdvancedGreedyAgent, LikelihoodAgent, LutAgent, RandomAgent

public interface Agent
An agent that can autonomously play the Royal Game of Ur. Agents are designed to be used on any game, and should not hold game-specific state.
  • Method Summary

    Modifier and Type
    Method
    Description
    decideMove(Game game, List<Move> availableMoves)
    Determines the move to be executed from the current state of the game.
    static int
    playAutonomously(Game game, Agent light, Agent dark)
    Completes this game using the two agents to play its moves.
    void
    playTurn(Game game)
    Initiates the agent to play their turn in the given game.
  • Method Details

    • playTurn

      void playTurn(Game game)
      Initiates the agent to play their turn in the given game.
      Parameters:
      game - The game to play a turn in.
    • decideMove

      Move decideMove(Game game, List<Move> availableMoves)
      Determines the move to be executed from the current state of the game.
      Parameters:
      game - The game to find the best move in.
      availableMoves - The list of available moves to be chosen from.
      Returns:
      The move that the agent chose to play.
    • playAutonomously

      static int playAutonomously(Game game, Agent light, Agent dark)
      Completes this game using the two agents to play its moves.
      Parameters:
      game - The game to complete.
      light - The agent to play as the light player.
      dark - The agent to play as the dark player.
      Returns:
      The number of actions that were made by both agents combined. Includes rolls of the dice and moves.