Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d489a4a
feat: add support for generating games using the GAMUT suite via load…
edwardchalstrey1 Jun 5, 2026
5776eb0
docs: add gamut_jar parameter to catalog examples
edwardchalstrey1 Jun 5, 2026
af1db2e
feat: expand home directory paths for GAMUT jar
edwardchalstrey1 Jun 5, 2026
0e905ba
refactor: rename load_gamut to generate_gamut and tidy GAMUT user doc…
edwardchalstrey1 Jun 5, 2026
c6c4e39
Add gamut tutorial
edwardchalstrey1 Jun 5, 2026
b0d5edb
use enumpure_solve
edwardchalstrey1 Jun 5, 2026
fa1b48c
test: skip GAMUT notebook test
edwardchalstrey1 Jun 5, 2026
0fe46d0
Merge branch 'master' into catalog/910
edwardchalstrey1 Jun 15, 2026
7d51ec4
Set max payoff in battle of the sexes example to 3 (not 100)
edwardchalstrey1 Jun 15, 2026
d19a37f
remove superfluous lines
edwardchalstrey1 Jun 15, 2026
bf35038
review classic 2p game tutorial section
edwardchalstrey1 Jun 15, 2026
7d06960
simplify paramaterised section
edwardchalstrey1 Jun 15, 2026
2b4c3a0
reorder notebook
edwardchalstrey1 Jun 15, 2026
4bf702e
feat: add gamut_games function to list available GAMUT game classes w…
edwardchalstrey1 Jun 15, 2026
274ccd7
docs: replace gamut_games documentation with an interactive dropdown
edwardchalstrey1 Jun 15, 2026
7142aee
Merge branch 'master' into catalog/910
edwardchalstrey1 Jun 17, 2026
70da956
refactor: rename load_openspiel to generate_openspiel
edwardchalstrey1 Jun 17, 2026
a54b67a
Merge branch 'master' into catalog/910
edwardchalstrey1 Jun 19, 2026
efc30c1
Save OpenSpiel nb with fix
edwardchalstrey1 Jun 19, 2026
d270b04
save gamut nb with outputs
edwardchalstrey1 Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions doc/catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Catalog of games
Below is a complete list of games included in Gambit's catalog.
Check out the :ref:`pygambit API reference <pygambit-catalog>` for instructions on how to search and load these games in Python, and the :ref:`Updating the games catalog <updating-catalog>` guide for instructions on how to contribute new games to the catalog.
Games from the OpenSpiel library are also available; see :ref:`Loading OpenSpiel games <catalog-openspiel>`.
Games can also be generated on the fly from the GAMUT suite; see :ref:`Generating GAMUT games <catalog-gamut>`.

.. include:: catalog_table.rst

Expand All @@ -14,13 +15,13 @@ Games from the OpenSpiel library are also available; see :ref:`Loading OpenSpiel
.. rubric:: Loading OpenSpiel games

Games from the `OpenSpiel <https://openspiel.readthedocs.io/en/latest/games.html>`_ library
can be loaded using :func:`pygambit.catalog.load_openspiel`:
can be generated using :func:`pygambit.catalog.generate_openspiel`:

.. code-block:: python

pygambit.catalog.load_openspiel("matrix_rps")
pygambit.catalog.load_openspiel("tiny_hanabi")
pygambit.catalog.load_openspiel("blotto", params={"players": 2, "coins": 3, "fields": 2})
pygambit.catalog.generate_openspiel("matrix_rps")
pygambit.catalog.generate_openspiel("tiny_hanabi")
pygambit.catalog.generate_openspiel("blotto", params={"players": 2, "coins": 3, "fields": 2})

The ``params`` argument is forwarded directly to ``pyspiel.load_game``; see the
`OpenSpiel game list <https://openspiel.readthedocs.io/en/latest/games.html>`_ for
Expand All @@ -31,3 +32,41 @@ not available on Windows). The game is exported to EFG or NFG format on the fly
and loaded into Gambit. Not all OpenSpiel games can be exported; a
:class:`ValueError` is raised for games that are incompatible with either format.
See the :doc:`OpenSpiel interoperability tutorial <tutorials/interoperability_tutorials/openspiel>` for worked examples.

.. _catalog-gamut:

.. rubric:: Generating GAMUT games

Games from the `GAMUT <http://gamut.stanford.edu>`_ generator suite can be created
using :func:`pygambit.catalog.generate_gamut`:

.. code-block:: python

pygambit.catalog.generate_gamut("RandomGame", params={"players": 2, "actions": 3}, gamut_jar="/path/to/gamut.jar")
pygambit.catalog.generate_gamut("CovariantGame", params={"players": 2, "actions": [3, 3]}, gamut_jar="/path/to/gamut.jar")
pygambit.catalog.generate_gamut(
"RandomGame",
params={"players": 3, "actions": 4, "normalize": True, "min_payoff": 0, "max_payoff": 100},
gamut_jar="/path/to/gamut.jar",
)

The ``params`` argument maps directly to GAMUT command-line flags. Boolean flags such as
``-normalize`` and ``-int_payoffs`` are passed as ``True``; list values for ``-actions``
expand to space-separated tokens. See the
`GAMUT documentation <http://gamut.stanford.edu/documentation.htm>`_ for the full list
of game classes and parameters.

GAMUT requires Java (install from `java.com <https://www.java.com/en/download/>`_) and
``gamut.jar`` to be installed. Provide the path to ``gamut.jar`` via the ``gamut_jar``
argument or the ``GAMUT_JAR`` environment variable. Download GAMUT from
http://gamut.stanford.edu/.

.. dropdown:: All 35 GAMUT game classes

.. jupyter-execute::
:hide-code:

import pygambit as gbt
gbt.catalog.gamut_games()

See the :doc:`GAMUT interoperability tutorial <tutorials/interoperability_tutorials/gamut>` for worked examples.
4 changes: 3 additions & 1 deletion doc/pygambit.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,5 +357,7 @@ Catalog of games
:toctree: api/

load
load_openspiel
generate_openspiel
generate_gamut
gamut_games
games
1 change: 1 addition & 0 deletions doc/pygambit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ These tutorials assume you have read the new user tutorials and are familiar wit
:maxdepth: 2

tutorials/interoperability_tutorials/openspiel
tutorials/interoperability_tutorials/gamut

API documentation
----------------
Expand Down
Loading
Loading