Package threeChess.agents
Class RandomAgent
- java.lang.Object
-
- threeChess.Agent
-
- threeChess.agents.RandomAgent
-
- All Implemented Interfaces:
java.lang.Runnable
public class RandomAgent 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 RandomAgent()A no argument constructor, required for tournament management.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalBoard(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.StringtoString()
-
-
-
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.
-
toString
public java.lang.String toString()
-
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:
finalBoardin classAgent- Parameters:
finalBoard- the end position of the board
-
-