Running a game

Running a game

The best way to run a single game is to run the gui.Frontend main method. This provides a rough-and-ready GUI to select one of the implemented games and run it with (or without) a GUI if implemented. If watching a game between agents, then this can be slowed down (by setting the pause between frames), and can be Paused/Resumed as required.

This can be run in the IDE, or an executable jar file (Frontend-jar-with-dependencies.jar) is generated by the maven build. Note that if using the jar file, this needs to be run somewhere with a data directory containing any game-specific GUI graphical assets or json configuration files, as these are not packaged in the jar).

Running a tournament between agents

The evaluation.RoundRobinTournament class provides a convenient way to run a tournament to determine win rates across different agents for a game. This is fully documented here, and allows you to specify:

  • the game
  • the number of players
  • the directory containing a set of JSON files, one for each of the agents to be included in the tournament. Details here
  • whether to run in ‘exhaustive’ or ‘random’ mode. The former runs a number of games for every possible player combination across every possible position. The latter runs a total number of games, randomising the players (and their positions) in each - it is more tractable for larger numbers of players, and/or if each game takes some time.
  • optionally a set of objects that implement the IGameListener interface to log details of the games as the proceed.

This can be run via an IDE, or a Tournament-jar-with-dependencies.jar is generated by the maven build. For full details on usage use java -jar Tournament-jar-with-dependencies.jar --help.

Running multiple games for reporting metrics of any sort

The evaluation.GameReport class provides support for running multiple games with the same agent used for all players. This is fully documented here, and includes options to:

  • run for one, a list of specific games, or every game in the framework
  • run for a specified set of player counts
  • optionally a set of objects that implement the IGameListener interface interface to log details of the games as the proceed. The default here will generate data on game characteristics like branching factor, the size of the action space, proportion of hidden information and so forth (see example here).

For full details on usage use the --help option on the command line. This can be run via an IDE, or a GameReport-jar-with-dependencies.jar is generated by the maven build.