Runs a round-robin tournament between all Connect Four player types and prints the league table to stdout.
Player parameters (depths, iteration counts, exploration constant) are read from application.conf via com.phasmidsoftware.gambit.game.GambitConfig. Edit the config file to tune contestants without recompiling.
Players entered:
RandomPlayer
HeuristicPlayer (one-ply greedy)
AlphaBeta(d=d1) (minimax, depth from config)
AlphaBeta(d=d2) (minimax, deeper depth from config)
MCTS(i=i1) (Monte Carlo, iteration count from config)
MCTS(i=i2) (Monte Carlo, higher iteration count from config)
def run(gamesPerPairing: Int = ..., seed: Long = ..., out: String=>Unit = ..., flush: () =>Unit = ...): String
Build and run the tournament, printing progress and returning the league table.
Build and run the tournament, printing progress and returning the league table.
Output is written via out and flushed via flush, both of which default to stdout behaviour. Pass alternative implementations for testing or redirection:
val sb = new StringBuilder
val table = Connect4Tournament.run(
gamesPerPairing = 2, seed = 42L,
out = s => { sb.append(s); sb.append('\n') },
flush = () => ()
)
Player parameters are read from GambitConfig (application.conf). Override by editing the config file -- no recompilation needed.
Value parameters
flush
flush function called after progress lines (default stdout flush).
gamesPerPairing
number of games each ordered pair plays (default from config: gambit.tournament.gamesPerPairing).
out
output function for progress lines (default println).
seed
random seed; default is System.currentTimeMillis().