HeuristicPlayer

com.phasmidsoftware.gambit.examples.connect4.HeuristicPlayer
class HeuristicPlayer extends Player[Connect4, Int, Boolean]

A player that greedily selects the highest-heuristic successor.

Attributes

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

Members list

Value members

Concrete methods

def chooseMove(s: Connect4, 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.

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