RunGames
The 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:
Tag | Description | Default |
---|---|---|
game= |
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. | all |
nPlayers= |
The number of players in each game | 2 |
playerRange= |
normally 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 |
all |
playerDirectory= |
A directory that contains one JSON file for each agent to be included in the tournament. See here for details. | None |
focusPlayer= |
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. |
None |
mode= |
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 |
exhaustive |
selfPlay= |
if true then it is possible for multiple copies of a player to be included in any one game | false |
matchups= |
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 focusPlayer effect. |
1 |
gameParams= |
A JSON file detailing the game parameters to use. See here for details. | Game defaults |
listener= |
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 |
evaluation.listeners.MetricsGameListener |
metrics= |
(Optional) The full class name of an IMetricsCollection implementation. The recommended usage is to include these in the JSON file that defines the listener. |
evaluation.metrics.GameMetrics |
destDir= |
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. | metrics\out |
addTimeStamp= |
(Optional) If true, then this will also add a timestamp to destDir for tracking of repeats of the same run. |
false |
output= |
(Optional) If specified, the summary results (percentage wins by each agent) will be written to a file with this name. | None |
verbose= |
If true then various additional information is printed to system.out |
false |
seed= |
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. | |
config= |
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. | None |
Listeners
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\listeners
has sample listener definitions (in JSON)