Chadwick Gambit: Software Tools for Game Theory

pygambit.gambit.MixedStrategy.__setitem__#

MixedStrategy.__setitem__(index: Strategy | str, value: Any) None#

Sets the probability a strategy is played.

Parameters:
  • index (Strategy, or str) –

    The part of the profile to set:

    • If index is a Strategy, sets the probability the strategy is played.

    • If index is a str, attempts to resolve the referenced object by searching for a strategy with that label, and sets the probability for that strategy.

  • value – Any value which can be converted to the data type of the MixedStrategyProfile.

Raises:

MismatchError – If strategy is a Strategy that does not belong to this MixedStrategy’s player.