pygambit.gambit.Game.add_strategy#
- Game.add_strategy(player: Player | str, label: str) Strategy#
Add a new strategy to the set of strategies for player.
Changed in version 16.7.0: A label is now required and must be nonempty and unique among the player’s strategies.
- Parameters:
player (Player or str) – The player to create the new strategy for
label (str) – The label for the new strategy. Must be nonempty and not already in use by another of the player’s strategies.
- Returns:
The newly-created strategy
- Return type:
- Raises:
MismatchError – If player is a Player from a different game.
UndefinedOperationError – If called on a game which has an extensive representation.
ValueError – If label is empty or is already the label of another of the player’s strategies.
