Player

com.phasmidsoftware.gambit.game.Player
trait Player[S, M, Pl]

A Player in a game of type S, making moves of type M, identified as player Pl.

Type parameters

M

the move type.

Pl

the player identity type.

S

the state type.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class RandomPlayer
class MenacePlayer
class RandomPlayer
class AlphaBetaPlayer[P, S, M, Pl]
class MCTSPlayer[P, S, M, Pl]
Show all

Members list

Value members

Abstract methods

def chooseMove(s: S, random: Random): Option[M]

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.

Concrete methods

def gameOver(result: GameResult[Pl], me: Pl): 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