HeuristicPlayer

com.phasmidsoftware.gambit.examples.tictactoe.HeuristicPlayer
class HeuristicPlayer(implicit state: State[Board, TicTacToe]) extends Player[TicTacToe, Int, Boolean]

A player that uses the existing heuristic (TicTacToeState$.heuristic) to greedily pick the best available move. Useful as a strong baseline.

Attributes

Graph
Supertypes
trait Player[TicTacToe, Int, Boolean]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def chooseMove(ttt: TicTacToe, random: Random): Option[Int]

Choose a move from the given state. Returns None if no move is available (terminal position).

Choose a move from the given state. Returns None if no move is available (terminal position).

Value parameters

random

a Random instance.

s

the current state.

Attributes

Returns

Some(move) or None.

Definition Classes

Inherited methods

def gameOver(result: GameResult[Boolean], me: Boolean): Unit

Called at the end of a game with the full result and this player's identity. Default implementation is a no-op. Override to implement learning or logging.

Called at the end of a game with the full result and this player's identity. Default implementation is a no-op. Override to implement learning or logging.

Value parameters

me

this player's identity, used to extract the relevant score.

result

the game result (all players' scores).

Attributes

Inherited from:
Player