RunGames executable class is one of the main entry points to using TAG. It will run a number of games between multiple agents (or just using a single agent), and you can plug-in different metrics to report on the results.
This page attempts to document all the run-time options available. For the most up-to-date summary, you can also look at the code.
The arguments are all specified by command line tags:
|The game to be played. This can be a pipe-delimited list of games, if you want to run a set of reports on a number of games.
|The number of players in each game
nPlayers will suffice (and overrides
playerRange; but it is possible to specify a range, say 3-5, or
all to repeat the run with varying numbers of players
|A directory that contains one JSON file for each agent to be included in the tournament. See here for details.
|A JSON file that defines the ‘focus’ of the tournament. This focusPlayer will be present in every single game. In this case the
matchups argument defines the number of games to be run with the focus agent in each possible position. For example in a 3-player game, setting
matchups=1000 will run 3000 games in total.
exhaustive will iterate through every possible permutation of players across all game positions.
random will allocate players randomly in each game, while ensuring that there are no duplicates in any one game, and that all players get the same number of games.
sequential will run a tournament between every single pair of agents
|if true then it is possible for multiple copies of a player to be included in any one game
|The number of games to run for each combination of players (mode=exhastive or sequential), or the total number of games to run (mode=random). See also
|A JSON file detailing the game parameters to use. See here for details.
|The full name of an
IGameListener implementation or the location of a JSON file from which a listener can be instantiated. A pipe-delimited list can be provided to gather many types of statistics. See section below on Listeners
|(Optional) The full class name of an
IMetricsCollection implementation. The recommended usage is to include these in the JSON file that defines the listener.
|The directory to which any reported metrics will be written. If this is run for multiple games and/or player counts, then a sub-directory will be created for each.
|(Optional) If true, then this will also add a timestamp to
destDir for tracking of repeats of the same run.
|(Optional) If specified, the summary results (percentage wins by each agent) will be written to a file with this name.
true then various additional information is printed to system.out
|If provided, this will be used to generate the seeds used to generate each game. This is useful for comparison runs in a game with high variability, for example in an intial deal.
|If this is provided it overrides all other parameters, and should be the only one provided. This is then the name of a JSON file which details the parameters to use, with each parameter as a name-value JSON pair.
Anything that implements the
IGameListener interface can be used to listen to events generated by a game (such as at the end of a player’s turn, each time a player makes a decision, or at the end of a game; see the separate documentation on IGameListeners for more details on the technical implementation, including on specifying the configuration via a JSON file.
Useful defaults provided in the framework:
data\listenershas sample listener definitions (in JSON)