Chadwick Gambit: Software Tools for Game Theory

pygambit.gambit.Game.write#

Game.write(format='native') str#

Produce a serialization of the game.

Several output formats are supported, depending on the representation of the game.

  • efg: A representation of the game in the .efg extensive game file format. Not available for games in strategic representation.

  • nfg: A representation of the game in the .nfg strategic game file format. For an extensive game, this uses the reduced strategic form representation.

  • gte: The XML representation used by the Game Theory Explorer tool. Only available for extensive games.

  • native: The format most appropriate to the underlying representation of the game, i.e., efg or nfg.

This method also supports exporting to other output formats (which cannot be used directly to re-load the game later, but are suitable for human consumption, inclusion in papers, and so on).

  • html: A rendering of the strategic form of the game as a collection of HTML tables. The first player is the row chooser; the second player the column chooser. For games with more than two players, a collection of tables is generated, one for each possible strategy combination of players 3 and higher.

  • sgame: A rendering of the strategic form of the game in LaTeX, suitable for use with Martin Osborne’s sgame style. The first player is the row chooser; the second player the column chooser. For games with more than two players, a collection of tables is generated, one for each possible strategy combination of players 3 and higher.