pygambit.catalog.generate_gamut#

pygambit.catalog.generate_gamut(game_class: str, params: dict | None = None, gamut_jar: Path | str | None = None) Game#

Generate a game using the GAMUT game generator.

GAMUT (http://gamut.stanford.edu) is a Java-based suite of parameterised game generators. This function calls GAMUT as an external process and returns the resulting game as a Game object.

Parameters:
  • game_class (str) – The GAMUT game class name (e.g. "RandomGame", "CovariantGame"). See the GAMUT documentation for available game classes and their parameters.

  • params (dict, optional) –

    Parameters forwarded to GAMUT as command-line flags. Each key becomes -key. Values are handled as follows:

    • True → flag with no value token (e.g. {"normalize": True}-normalize)

    • list or tuple → space-separated tokens (e.g. {"actions": [3, 3]}-actions 3 3)

    • anything else → single token (e.g. {"players": 2}-players 2)

    Multi-word GAMUT flags use underscores: {"min_payoff": 0, "max_payoff": 100}.

  • gamut_jar (pathlib.Path or str, optional) – Path to gamut.jar. If omitted, the GAMUT_JAR environment variable is used. Raises FileNotFoundError if neither is supplied.

Returns:

The generated game.

Return type:

Game

Raises:
  • RuntimeError – If java is not found on the system PATH.

  • FileNotFoundError – If gamut.jar cannot be located.

  • ValueError – If GAMUT exits with a non-zero return code (e.g. invalid game class or parameters).