Class ManualAgent

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ManualAgent
    extends Agent
    An interface for AI bots to implement. They are simply given a Board object indicating the positions of all pieces, the history of the game and whose turn it is, and they respond with a move, expressed as a pair of positions.
    • Constructor Summary

      Constructors 
      Constructor Description
      ManualAgent()
      A no argument constructor, required for tournament management.
      ManualAgent​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finalBoard​(Board finalBoard)
      Displays the final board position to the agent, if required for learning purposes.
      Position[] playMove​(Board board)
      Play a move in the game.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ManualAgent

        public ManualAgent()
        A no argument constructor, required for tournament management.
      • ManualAgent

        public ManualAgent​(java.lang.String name)
    • Method Detail

      • playMove

        public Position[] playMove​(Board board)
        Play a move in the game. The agent is given a Board Object representing the position of all pieces, the history of the game and whose turn it is. They respond with a move represented by a pair (two element array) of positions: the start and the end position of the move.
        Specified by:
        playMove in class Agent
        Parameters:
        board - The representation of the game state.
        Returns:
        a two element array of Position objects, where the first element is the current position of the piece to be moved, and the second element is the position to move that piece to.
      • toString

        public java.lang.String toString()
        Specified by:
        toString in class Agent
        Returns:
        the Agent's name, for annotating game description.
      • finalBoard

        public void finalBoard​(Board finalBoard)
        Displays the final board position to the agent, if required for learning purposes. Other a default implementation may be given.
        Specified by:
        finalBoard in class Agent
        Parameters:
        finalBoard - the end position of the board