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 documents the main 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
budget= If this is set to a positive number then this will be used to set the time (or other) budget of all agents (where they are AnyTime agents, such as MCTS or RHEA, this will not affect hard-coded agents). The default will use the budget specified in the Agent JSON descriptions. 0
mode= exhaustive will iterate through every possible permutation of unique players across all game positions (without replacement, so no repetition of an agent in any permutation), exhaustiveSP will do the same but allowing self-play. 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. The number of games to be run for each permutation will be calculated automatically to keep within the total number of matchups specified. exhaustive
matchups= The total number of games to run in each tournament. The precise number will vary depending on the mode, but this will set the upper limit. 1
gameParams= A JSON file detailing the game parameters to use. See here for details. Game defaults
listener= The location of a JSON file from which a listener can be instantiated. A pipe-delimited list can be provideds. See section below on Listeners metrics/MetricsGameListener.json
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
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.  
byTeam= Determines if the same Agent is applied to all players on the same team (the default). This is only relevant for team-based games such as Resistance (2 teams) or Pandemic (1 team). true
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:

  • json\listeners has a sample listener definition (in JSON)