Agents

The othello.agent package contains an abstract base class Agent that all agent classes should be derived from. New agent types can be registered as plugins.

othello.agent.base

Abstract base class for agents.

class othello.agent.base.Agent

Agent abstract base class.

abstract select_move(game_state)

Select move given game state.

Return type

Move

othello.agent.human

Human agent module.

class othello.agent.human.Human

Human agent.

static notation_to_move(move_input)

Convert notation string to Point instance.

Parameters

move_input (str) – Notation to be converted.

Return type

Move

Returns

Move.

static point_to_notation(point)

Convert Point instance to notation string.

Parameters

point (Point) – Point to be converted.

Return type

str

Returns

Notation.

Raises

NotationError – No notation exists for given point.

select_move(game_state)

Select move using user input.

Parameters

game_state (GameState) – Current game state.

Return type

Move

Returns

Move instance.

static validate_input(move_input)

Validate human input.

Parameters

move_input (str) – Notation input.

Raises

InvalidInputError – Input is not valid move notation.

Return type

None

exception othello.agent.human.InvalidInputError

Exception class for when input is not a valid move selection.

exception othello.agent.human.NotationError

Exception class for when game notation related errors.

othello.agent.random_bot

Random bot agent module.

class othello.agent.random_bot.RandomBot

RandomBot agent.

select_move(game_state)

Choose a random valid move.

Parameters

game_state (GameState) – Current game state.

Return type

Move

Returns

Move instance.